Earlier quoted context omitted.
A REPL is nice too: (reduce + (range 366))
Python: reduce (operator.add, range(366))
sum(range(366))21–30 of 34 posts
Earlier quoted context omitted.
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.
By my calculations that's about $14,000,000,000,000,000. Not bad for a year.
$66,795. Not bad.
Earlier quoted context omitted.
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
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 rememb…
Earlier quoted context omitted.
By my calculations that's about $14,000,000,000,000,000. Not bad for a year.
A lot less. $ 1,283,305,580,313,390
Edit: It is. I just ran the code again, and the payment for day 365 is 1.28331e+15