Hello chazlex-ga,
You've stumbled on a special case of what's known as an "arithmetic
series". Unfortunately, you're not the first person to have
discovered this. One of the legends involving Carl Friedrich Gauss,
one of the greatest mathematicians of all time, tells of a story of
him discovering it when he was in elementary school. The story has it
that his teacher tried to keep the students busy by having them add up
all the whole numbers from 1 to 100. He solved it within seconds
using the formula that you described, astonishing everyone.
To understand why it is so, consider this:
Suppose that you are adding all the numbers from 1 to n, with n being
the largest number. You can see that you can group the numbers in the
following way:
1 and n,
2 and n-1,
3 and n-3,
...
Each of these groups of 2 numbers add up to n+1. Now, if n is even,
then there are exactly n/2 pairs of these, so the sum of all the
numbers from 1 to n is precisely (n+1)/2 * n, like you have
discovered.
However, if n is odd, you will notice that there will be one number
left over after you paired up all the numbers. Therefore, you have
only n-1 pairs and one number left over. However, the number left
over is the middle number, which is precisely equal to (n+1)/2, so the
formula above also applies:
(n+1)/2 * (n -1) + (n+1)/2 = (n+1)/2 * n.
You can learn about Gauss and about arithmetic series from the following links:
*http://en.wikipedia.org/wiki/Carl_Friedrich_Gauss#Early_years
*http://en.wikipedia.org/wiki/Arithmetic_series
*http://www.ucl.ac.uk/Mathematics/geomath/level2/series/ser2.html
I hope that this explanation was reasonably clear. If you need
clarification, please request for it before rating this answer.
Thanks,
secret901-ga |