Proof and Reasoning

Gauss's Sum of 1 to 100 and the Proofs Behind the Formula

Why 1 + 2 + ... + 100 equals 5050, shown by pairing, pictures, induction, counting and telescoping, with extensions to other sums.

Key takeaways

  • The sum 1 + 2 + ... + n equals n(n + 1)/2, which gives 5050 when n = 100.
  • Writing the sum forward and backward proves the formula for odd and even n at once.
  • Induction, a staircase picture, a counting argument and a telescoping sum all give independent proofs.
  • The schoolboy Gauss story is a later-embroidered anecdote, and the method itself is much older than he is.

The sum of the whole numbers from 1 to 100 is 5050. The quick way to see it is to pair the first number with the last: 1 + 100, 2 + 99, 3 + 98 and so on. Each pair totals 101, there are 50 pairs, and 50 × 101 = 5050.

The general formula is that 1 + 2 + ... + n equals n(n + 1)/2 for every positive integer n. It can be proved in several quite different ways, and each way suggests a different extension.

The story and what is known

The tale goes that a teacher asked young Carl Friedrich Gauss's class to add a long list of numbers, hoping to keep the pupils busy, and that Gauss produced the answer almost at once. The earliest written account comes from Wolfgang Sartorius von Waltershausen, who knew Gauss and wrote a memorial of him after his death. It describes a classroom exercise in summing an arithmetic series. The particular numbers 1 to 100, and many colorful details, appear in later retellings.

So treat the scene as an anecdote. What is not in doubt is that Gauss became one of the most important mathematicians of all time. It is also clear that people knew how to sum such series long before the eighteenth century. The figures built from these sums, 1, 3, 6, 10, 15 and so on, are called triangular numbers and were studied in ancient Greece.

The pairing argument and the odd case

Pairing works neatly when n is even: you get n/2 pairs, each summing to n + 1.

When n is odd, one number is left in the middle. For n = 7 the pairs are 1 + 7, 2 + 6 and 3 + 5, each equal to 8, and the number 4 stands alone. The total is 3 × 8 + 4 = 28, which is 7 × 8/2. The formula still holds, but the explanation now needs a second case.

A small change removes the cases. Write the sum twice, once in each direction:

S  =   1  +   2  +   3  + ... + n
S  =   n  + (n−1) + (n−2) + ... + 1
2S = (n+1) + (n+1) + (n+1) + ... + (n+1)     (n terms)
2S = n(n + 1)
S  = n(n + 1)/2

Each column totals n + 1, and there are n columns. No assumption about odd or even was needed. This is a model of a good proof: short, general and explanatory.

A staircase picture

Draw one dot in the first row, two in the second, three in the third, down to n dots in the last. You have a staircase with 1 + 2 + ... + n dots. Now take a second copy, rotate it half a turn, and fit it against the first. Together they form a rectangle with n rows and n + 1 columns.

The rectangle holds n(n + 1) dots, so each staircase holds half that. For n = 4 the rectangle is 4 by 5, with 20 dots, and each staircase has 10.

This is the forward-and-backward proof drawn instead of written. A drawing shows one value of n, but nothing in the construction depends on which value you drew. That distinction is examined in proofs without words.

Induction

Mathematical induction proves a statement for all positive integers in two steps.

Base case (n = 1):  the sum is 1, and 1·2/2 = 1.

Step: assume 1 + ... + k = k(k + 1)/2 for some k ≥ 1.
1 + ... + k + (k + 1) = k(k + 1)/2 + (k + 1)
                      = (k + 1)(k/2 + 1)
                      = (k + 1)(k + 2)/2

The last line is the formula with n = k + 1, so the statement holds for every positive integer.

Induction is reliable and mechanical. Its weakness is that you must already know the formula you want to prove. It confirms a guess; it does not usually produce one.

Counting pairs

Here is a proof that never adds anything up. Consider all ways to choose two different numbers from the list 0, 1, 2, ..., n. There are n + 1 numbers, so the number of pairs is (n + 1)n/2.

Now sort the pairs by their larger member. If the larger number is m, the smaller can be any of 0, 1, ..., m − 1, which gives m pairs. Letting m run from 1 to n, the total is 1 + 2 + ... + n.

The two counts describe the same collection, so they are equal. This is a combinatorial proof, and it explains why the same numbers count handshakes: n + 1 people, each pair shaking hands once, make n(n + 1)/2 handshakes.

Five ways to reach n(n + 1)/2
1 + 2 + ... + n Equals n(n + 1)/2 Telescoping Differences of squares Count pairs Sort by the larger Reverse and add n columns of n + 1 Staircases Two make a rectangle Induction Base case, then step 1 + 2 + ... + n Equals n(n + 1)/2 Reverse and add n columns of n + 1 Staircases Two make a rectangle Induction Base case, then step Count pairs Sort by the larger Telescoping Differences of squares

Guessing the formula in the first place

Suppose you had never seen the answer. Computing small cases gives 1, 3, 6, 10, 15, 21 for n from 1 to 6. The numbers themselves are not obviously a formula, but dividing each by n gives 1, 1.5, 2, 2.5, 3, 3.5. Those rise by exactly one half each time, and they equal (n + 1)/2.

That suggests S = n(n + 1)/2. At this point you have a conjecture, supported by six cases and nothing more. Any of the proofs here turns it into a theorem.

The ratio also has a meaning. S divided by n is the average of the numbers being added, and the average of an evenly spaced list is the midpoint between its smallest and largest entries. For 1 to 100 the average is 50.5, and 100 numbers averaging 50.5 total 5050. This may be the fastest route of all to do in your head.

Telescoping squares

The identity (k + 1)² − k² = 2k + 1 holds for every k. Write it for k = 1 up to n and add. On the left almost everything cancels:

(2² − 1²) + (3² − 2²) + ... + ((n+1)² − n²) = (n+1)² − 1

On the right you get 2(1 + 2 + ... + n) + n. Setting them equal,

2S = (n + 1)² − 1 − n = n² + n
S  = n(n + 1)/2

A sum whose middle terms cancel in this way is called telescoping. Its great advantage is that it scales up.

Sums of squares and cubes

Use (k + 1)³ − k³ = 3k² + 3k + 1 and add from 1 to n. Writing Q for the sum of the squares and S as above,

(n+1)³ − 1 = 3Q + 3S + n
3Q = n³ + 3n² + 3n − 3n(n+1)/2 − n
Q  = n(n + 1)(2n + 1)/6

For n = 3 this gives 3 · 4 · 7/6 = 14, matching 1 + 4 + 9. The sum of cubes has a striking form: it equals S², the square of the ordinary sum. For n = 3, 1 + 8 + 27 = 36 = 6².

Repeating the method with fourth powers gives the sum of cubes, and so on upward. The general pattern leads to the Bernoulli numbers.

Any evenly spaced list

The reverse-and-add idea works for any arithmetic series, a sum in which each term differs from the previous one by a constant. The total is the number of terms times the average of the first and last.

Take 17 + 20 + 23 + ... + 62. The common difference is 3, so the number of terms is (62 − 17)/3 + 1 = 16. The sum is 16 × (17 + 62)/2 = 8 × 79 = 632.

The easy mistake is the count of terms. Dividing the gap by the difference gives the number of steps, which is one less than the number of terms.

Another famous case is the sum of the first n odd numbers. The first term is 1, the last is 2n − 1, their average is n, and so the sum is n × n = n². Hence 1 + 3 + 5 + 7 = 16.

Where triangular numbers turn up

The numbers n(n + 1)/2 appear whenever things are compared in pairs. A round-robin league with 12 teams, each meeting every other once, needs the sum 1 + 2 + ... + 11 = 11 · 12/2 = 66 games. Notice that n here is 11, one less than the number of teams, because the first team has 11 new opponents, the second has 10, and so on.

The same count describes the work done by a simple sorting method that compares each item with every later one. Sorting 1,000 items this way takes 999 · 1000/2 = 499,500 comparisons. Doubling the list roughly quadruples the work, since the formula grows like n²/2. Programmers watch for exactly this pattern.

Two neighboring triangular numbers always make a square: n(n − 1)/2 + n(n + 1)/2 = n². For instance, 10 + 15 = 25. In the dot picture, a square grid splits along a line just beside its diagonal into two staircases of sizes n − 1 and n.

Which proof is best

There is no single winner, because the proofs do different jobs.

Method What it needs What it gives you
Reverse and add basic algebra all arithmetic series
Staircase picture a drawing immediate intuition
Induction a formula to test a rigorous check of any guess
Counting pairs counting selections the link to handshakes
Telescoping expanding powers sums of squares and higher powers

If you meet an unfamiliar sum, try reversing it first. If the columns do not come out equal, look for a difference of consecutive values that telescopes. If you can only guess an answer from small cases, finish with induction. A guess from small cases is never enough alone, since a pattern can hold for a long run and then fail.

What the formula does not say

The expression n(n + 1)/2 counts finite sums. The unending series 1 + 2 + 3 + ... has partial sums that grow without bound, so it diverges. Claims that it "equals" −1/12 refer to a value assigned by a different procedure, explained in what the −1/12 claim really means.

It also does not apply to lists that are not evenly spaced. For 1, 2, 4, 8 and 16 the average of the first and last is 8.5, and five times that is 42.5, while the true sum is 31. Series in which each term is a fixed multiple of the one before need their own method: multiply the sum by the ratio, subtract the original, and watch the middle terms cancel.

Finally, check the starting point. The list from 0 to 100 has the same total as the list from 1 to 100, but it has 101 terms with an average of 50. Whenever the first term changes, recount the terms and recompute the average.

To test your understanding, pick one proof and adapt it. Find the sum of the even numbers up to 2n, then the sum of the integers from 50 to 150. You should get n(n + 1) and 10,100.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 41 articles in Proof and Reasoning →

Latest news on this topic