Could you please post the formula to find the sum of all numbers from 1 to 1000?
The method explained here should help you to work it out.
1 + 1000 = 1001
2 + 999 = 1001
3 + 998 = 1001
...............
499 + 502 = 1001
500 + 501 = 1001
therfore sum of numbers = (1000/2)×1001
= 500500
Apparently Gauss worked this out when he was about 6 years old, thereby demonstrsating his great precosciousnes
He was giving this as a punishment, i think, he amazed his
teacher by doing this in less than a half an hour..
for any n:
s(n)= n(n+1)/2
Heres how you work out the formula for an arithmetic
series:
S is the sum of the first n terms
a is the first term
d is the common difference
n is the number of terms
S = a + (a+d) + (a+2d) +....+(a+(n-1)d)
Rearrange the series with the last term first:
S = (a+(n-1)d) + (a+(n-2)d)+....+ a
Add the two series together:
2S = (2a+(n-1)d) + (2a+(n-1)d) +...+ (2a+(n-1)d)
2S = n(2a+(n-1)d)
S = n/2(2a+(n-1)d)
In the case of 1 to 1000:
a = 1
d = 1
n = 1000
Hence S = 1000/2(2 + 999)
= 500×1001
= 500500
The Gauss one was all the numbers from 1 to 100, his teacher was amazed he just had 5050 written on his slate, nothing else at all.