2 ms·
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
by three14 17y ago
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 http://www.wolframalpha.com/input/?i=sum+of+n+from+1+to+n