Saturday, 5 February 2011

How to add a sequence of numbers at lightning speed

The usual starting place is to add the numbers from 1 to 100. This is a good one to demonstrate the technique.

Imagine you were to write out all the numbers from zero to 100 in a long line.

0 ... 1 ... 2 ... 3 ... ... 98 ... 99 ... 100

Then underneath these, write the same sequence backwards – 100 down to zero.

100 ... 99 ... 98 ... ... 3 ... 2 ... 1 ... 0

Now you have 1 to 100 written twice (with a couple of zeros) so if you add all this lot together, you will have double the answer you want.

Each pair of numbers (0 + 100, 1 + 99, 2 + 98 etc) adds up to 100.

There are 101 pairs. I.e. 101 lots of 100, which is a simple sum. 100 times 101 is 10100.
Divide by 2 to get the answer you are looking for, which is 5050.

Generally, the sum of any sequence of whole numbers from 1 to x is
x (x + 1) / 2

If you don’t want to start at 1, then it’s not so simple, but I’m not going into that here.

No comments:

Post a Comment