AnyTopic / Mathematics

How does pairing give the formula for 1 + 2 + ... + n?

For a positive integer n, the sum is n(n + 1)/2. Write the list once forward and once backward. Each column then adds to n + 1, and there are n columns. That is twice the sum you wanted, so divide by 2.

AI release decision: . Decision date, not an asserted public publication date.

Reader question

How can you add all the whole numbers from 1 to n without doing every addition separately, and why does the shortcut work when n is odd?

Short answer

For a positive integer n, the sum is n(n + 1)/2. Write the list once forward and once backward. Each column then adds to n + 1, and there are n columns. That is twice the sum you wanted, so divide by 2.

Worked example: the middle term is not missing

For 1 through 9, pair the outside terms: 1 + 9, 2 + 8, 3 + 7, and 4 + 6. Each pair totals 10. Four pairs contribute 40, and the unpaired middle term is 5. The sum is 45.

Worked example: the middle term is not missing

The formula agrees: 9 times 10 divided by 2 is 45. When n is odd, do not simply count n/2 physical pairs and forget that one term is left over. The two-list proof below avoids that problem entirely.

Worked example: the middle term is not missing

For an even endpoint, the outside-pair picture is especially direct. From 1 through 20 there are ten pairs, each totaling 21, giving 210.

Proof: use two complete lists

Call the required sum S. One copy is S = 1 + 2 + ... + (n - 1) + n. A second copy, in reverse order, is S = n + (n - 1) + ... + 2 + 1.

Proof: use two complete lists

In column i, the first list contributes i and the reversed list contributes n + 1 - i. Their sum is n + 1. Since i takes the n positions from 1 through n, adding the lists gives 2S = n(n + 1). Dividing this equality by 2 yields S = n(n + 1)/2.

Proof: use two complete lists

For odd n, the middle term appears once in each copy. It is counted twice just like every other term; there is no special exception to the proof. Also, one of the consecutive integers n and n + 1 is even, so their product is divisible by 2. The formula therefore returns an integer.

Limits: the starting point and step matter

The formula describes consecutive integers starting at 1 and ending at a positive integer n, with both endpoints included. It is not a formula for an arbitrary collection of n numbers. Skipping a number or using a different step changes the problem.

Limits: the starting point and step matter

The empty sum at n = 0 can consistently be defined as 0, and the expression 0(0 + 1)/2 gives 0. That is an explicit extension of the convention, not a list with a first and last term to pair. A negative endpoint or a noninteger n is outside the stated finite-list problem.

Small checkable takeaway

For 1 through 50, the expression is 50 times 51 divided by 2, or 1,275. Check a small case directly before using the shortcut: 1 + 2 + 3 + 4 = 10, and 4 times 5 divided by 2 is also 10.

Evidence

Original first-party algebraic derivation in the proof above; examples and assumptions are stated in the article. No external source material was used.