What is the sum of all positive integers from 1 to 1000?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Well in my case, I rediscovered the same! :P and used it!
The formula for the sum of n numbers starting from 1 is
S[n] = n(n + 1)/2
Therefore,
S[1000] = 1000(1000 + 1)/2
= 500(1000 + 1)
= 500(1001)
= 500500
how to quickly to do it, add up the numbers 1 to 1000, The first stage, if 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 = 50, then when summed 100 = 5050, if summed up 1000 = 500500, use the concept of logical thinking.
2 n × ( n + 1 )
where: n is any positive number
2 1 0 0 0 × ( 1 0 0 0 + 1 ) = 5 0 0 × 1 0 0 1 = 5 0 0 5 0 0
n (n+1)/2 = 1000 ( 1000 + 1 ) / 2 = 500500
1+2+5 .. .. ..+n = n(n+1)/2
.
1 to 1000 = 1000(1001)/2=500500
Problem Loading...
Note Loading...
Set Loading...
Using the same method as Carl Friedrich Gauss did - pairing up the first and last numbers and multiplying by the number of pairs - we get: ( 1 + 1 0 0 0 ) × 2 1 0 0 0 = 5 0 0 5 0 0