News for hackers. Stuff that matters.
Re:I wear your shirt by Raphael on Wednesday November 25, 2009 @02:37AM (#960801)
$66,795. Not bad.
Re:I wear your shirt by m0th87 on Wednesday November 25, 2009 @03:13AM (#960832)
This is one of those domain-specific areas in which Wolfram is awesome: http://www.wolframalpha.com/input/?i=sum+of+n+from+1+to+365
Re:I wear your shirt by patio11 on Wednesday November 25, 2009 @03:35AM (#960853)
We can't all be Gauss but, then again, we're not in fourth grade anymore, either. You can sum over any range trivially: average of the endpoints times length of the range. The average of 1 and 365 is 183. There are 365 elements between 1 and 365 (both inclusive). 183 * 365 = 66795. Yay, right answer.

(There is a formula. I have a poor memory for formulas but am good at transforming English into them, so I just remember the English gloss.)

I'm decently impressed that Wolfram was able to spit out something equivalent to the right formula with only a little massaging of the inputs from me:

http://www.wolframalpha.com/input/?i=sum+of+n+from+n%3Da+to+...

Re:I wear your shirt by m0th87 on Wednesday November 25, 2009 @01:03PM (#961533)
I was referring to the fact that Wolfram actually understood the input, not that it answered a trivial math question :)
Re:I wear your shirt by mahmud on Thursday November 26, 2009 @08:10PM (#963299)

  (loop for x from 1 to 365 summing x)  ==> 66795
Re:I wear your shirt by three14 on Wednesday November 25, 2009 @03:40AM (#960860)
There's a famous possibly true story about Gauss having to sum the numbers 1 to 100 as a child. Most versions tell it that he noticed that 1 + 100 = 2 + 99 = 3 + 98 and so on, yielding a general formula of n * (n + 1) / 2, so you could probably skip Wolfram for this one. (Explanation: you have n numbers, on average each is equal to the first + the last divided by 2)

Unless you want it for this: http://www.wolframalpha.com/input/?i=sum+of+n+from+1+to+n

Re:I wear your shirt by icey on Wednesday November 25, 2009 @08:18AM (#961047)
A REPL is nice too:

  (reduce + (range 366))
Re:I wear your shirt by Torn on Wednesday November 25, 2009 @09:56AM (#961169)
Python:

  reduce (operator.add, range(366))
Re:I wear your shirt by tome on Wednesday November 25, 2009 @10:11AM (#961190)
or

   sum(range(366))
Re:I wear your shirt by mahmud on Thursday November 26, 2009 @08:15PM (#963303)

  (sum (range 1 365))
assuming you defined these already; I have them in my utils library ;-)

  (defun range (start end)
    (loop for x from start to end collecting x))

  (defun sum (sequence)
    (reduce #'+ sequence))
Re:I wear your shirt by Torn on Wednesday November 25, 2009 @11:47AM (#961377)
didn't even think of that one! :)
Re:I wear your shirt by karanbhangui on Wednesday November 25, 2009 @12:52PM (#961519)
or plain math: n(n+1)/2
Re:I wear your shirt by mahmud on Thursday November 26, 2009 @08:20PM (#963304)
How quickly can you generalize the plain math formula to these sequences: http://www.research.att.com/njas/sequences/index.html
Re:I wear your shirt by seldo on Wednesday November 25, 2009 @05:11AM (#960922)
I knew there must be a formula but I totally just broke out a spreadsheet and auto-generated the sequence and then auto-summed it.

Math/brain fail.

Re:I wear your shirt by RyanMcGreal on Wednesday November 25, 2009 @09:36AM (#961143)
Alternately: fast repetition of trivial operations win.
Re:I wear your shirt by Raphael on Wednesday November 25, 2009 @03:57AM (#960874)
Preaching to the choir. I used it all day for physics homework.
Re:I wear your shirt by JacobAldridge on Wednesday November 25, 2009 @03:26AM (#960843)
It's a simple business model - all it requires is an easily explainable idea ("I wear your t-shirt") and enough viral marketing in advance to drive the traffic that will drive the advertisers (ie, those who will pay you to wear their shirt).

I'm sitting on two other niches for basically this business model - planning on moving overseas next year at some stage, though, so will wait until 2011 to implement (by which I mean October 2010 to start marketing).

I'm sure we could all come up with some variants.

Edit: It also helps that it's most attractive to retail / mass consumer products, and that these are most in demand in the holiday season, and that the holiday season coincides with the end of the calendar year, so the most expensive dates are also the most valuable.

Re:I wear your shirt by eam on Wednesday November 25, 2009 @03:02AM (#960824)
That's for 2009. For 2010 it'll increment by $2 instead of $1. Why couldn't have I thought of that?
Re:I wear your shirt by patio11 on Wednesday November 25, 2009 @03:38AM (#960857)
He should ask for $1 the first day, $1.10 the second day (10% more), $1.21 (10% more) the third day... and mathematical illiteracy for Christmas.
Re:I wear your shirt by ramidarigaz on Wednesday November 25, 2009 @07:22AM (#961006)
By my calculations that's about $14,000,000,000,000,000.

Not bad for a year.

Re:I wear your shirt by LucaDuval on Wednesday November 25, 2009 @10:27AM (#961221)
A lot less. $ 1,283,305,580,313,390
Re:I wear your shirt by ramidarigaz on Wednesday November 25, 2009 @11:02PM (#962222)
I think that's the payment on day 365, not the year total.

Edit: It is. I just ran the code again, and the payment for day 365 is 1.28331e+15

Re:I wear your shirt by LucaDuval on Thursday November 26, 2009 @07:00AM (#962560)
You are right. I was wrong.
Re:I wear your shirt by euccastro on Wednesday November 25, 2009 @07:44AM (#961025)
You could. After the Red Clip guy, the Million Dollar Page, and the woman who sold a tattoo on her forehead, this is becoming an old trick. Yet it still works!
Re:I wear your shirt by jasonneal on Wednesday November 25, 2009 @08:27AM (#961057)
66,795 is definitely not bad for wearing t-shirts. Not factored into that though, he receives 365 free t-shirts a year! That could be valued around 3650 ($10 per shirt)
Re:I wear your shirt by arfrank on Wednesday November 25, 2009 @10:07AM (#961182)
Add in $2500 per month sponsorships and thats another 30K on top.
Re:I wear your shirt by viggity on Wednesday November 25, 2009 @11:53AM (#961389)
I had yourmaninindia.com run the numbers for me and he came up with 3,096,288 rupees