sciandu
Mathematics

Mathematics

Sums & series

Add every number from 1 to 100 in a few seconds. The trick is 250 years old and still works.

The story gets told often: a teacher wanted to keep his class busy and had them add all the numbers from 1 to 100. Young Carl Friedrich Gauss finished after a short while with 5050. He had not calculated faster than the others, he had calculated differently. And that different way of looking is a tool that saves you work on many sums.

The trick with the pairs

Write the numbers once forwards and underneath them backwards: 1, 2, 3, … , 100 and 100, 99, 98, … , 1. Every column adds up to 101, and there are 100 columns, so 10,100 in total. Because you counted every number twice, you divide by 2 and get 5050. This idea turns into a formula that works for any endpoint.

1+2+3++n=n(n+1)21 + 2 + 3 + \dots + n = \frac{n \cdot (n + 1)}{2}
The count of numbers times the sum of one pair, divided by 2.

Arithmetic series in general

The trick works for any sequence where the same amount is added each time. An example: the first row of a theatre has 12 seats, every further row one more, 20 rows in total. The last row has 31 seats. First plus last makes 43, that holds for every pair, and with 20 rows that makes 10 pairs: 1043=43010 \cdot 43 = 430 seats.

As a formula: the count times the sum of the first and last term, divided by 2. So you only need three pieces of information and do not have to know a single term in between. That is exactly what makes this formula so comfortable as soon as many terms are involved.

When multiplication is involved

In geometric sequences the same amount is not added each time, instead the same factor is multiplied each time. A well known example: 1+2+4+8+16=311 + 2 + 4 + 8 + 16 = 31. That is exactly one less than 32, and 32 is the next power of two. This observation holds in general: the sum of the powers of two from 202^0 to 2n2^n is always 2n+112^{n+1} - 1.

Growth bars
Base2
Exponent3
0
1
1
2
2
4
3
8
23 = 2 × 2 × 2 = 8
Set the base to 2 and the exponent to 4. The bars show 1, 2, 4, 8 and 16. Add them in your head: 31. Push the exponent to 5, the 32 joins in and the sum becomes 63. Every time, the sum of all the bars is exactly 1 less than the next bar. That is why you can work out a long doubling sum in a single step.

For writing down long sums there is a shorthand, the summation sign. k=15k\sum_{k=1}^{5} k means: substitute 1 up to 5 for kk one after another and add everything, so 1+2+3+4+5=151 + 2 + 3 + 4 + 5 = 15. Below it says where to start, above where to stop, and after it what is to be added. There is nothing more to it.

Exercises

0 of 6 solved

Time to try it yourself. You can't break anything, every attempt counts.

Work out the sum of all numbers from 1 to 20.

What is the Gauss trick based on?

A stack of logs has 15 logs at the bottom, one fewer in each layer above, and exactly one log at the very top. How many logs are there in total?

The sign \sum is shorthand for .

Work out 1+2+4+8++2561 + 2 + 4 + 8 + \dots + 256.

Match each sum to its result.

1+2++51 + 2 + \dots + 5
1+2++91 + 2 + \dots + 9
1+2+4+8+161 + 2 + 4 + 8 + 16
1+2+4+8+16+321 + 2 + 4 + 8 + 16 + 32