News for hackers. Stuff that matters.
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