*Originally posted by Virak*

**This is approximately grade 10 math.
**

The simple solution is..

(1+ 2+ 3 +4 +5+...+100)+

(100+99 +98+.... +1)=

101+101+.... +101= 100*101=10100

But we counted each number twice so divide by 2.

10100/2=5050

Similiarly 1+2+...+n=n*(n+1)/2

(m+1)+(m+2)+...+n= n*(n+1)/2 - m*(m+1)/2

The story is that Guass (Arguably the ...[text shortened]... his class quite for the day). He wrote down the answer to the teachers annoyance and amazement.

Correct apart from the slight mistake in the second part. You added from (m+1) to n, should be m to n:

m+(m+1)+(m+2)+...+n = (n*(n+1)/2) - (m*(m+1)/2) + m

Which could be simplified to:

http://www.lunacy.force9.co.uk/images/gauss.jpg