Skip to content
MasterMath

Sum of Consecutive Numbers

Add every whole number in a range without adding them one by one. Gauss worked this out as a schoolboy, and the trick still holds.

Total sum

—

Total sum—
How many numbers—
Mean—
The even ones add to—
The odd ones add to—

How this was worked out

    The rule

    sum = count × (first + last) ÷ 2

    Why it works

    Pair the first number with the last, the second with the second-to-last, and so on: every pair adds to the same total. Multiply that total by how many pairs there are and you have the sum, without touching the numbers in between.

    How to do it by hand

    1. Count how many numbers there are: last − first + 1
    2. Add the first and the last
    3. Multiply the two
    4. Halve the result, because each pair was counted twice

    What is worth knowing

    The story is that Gauss's teacher set the class to add 1 to 100 as busywork, and Gauss produced 5050 almost immediately by pairing 1 with 100, 2 with 99, and so on: fifty pairs of 101. The story may be embellished but the method is exactly right, and it generalises to any arithmetic progression. The same reasoning gives the formula for triangular numbers, and it is the simplest example of turning a loop into a closed form — the difference between a hundred additions and two.

    Frequently asked questions

    How do you add consecutive numbers quickly?

    Multiply the count by the sum of the first and last, then halve it. Pairing from the ends is why it works.

    What is the sum from 1 to 100?

    5050. That is 100 × 101 ÷ 2, which is the pairing trick Gauss is said to have found as a child.

    Does it work for any range?

    Yes, for any run of consecutive whole numbers, and more generally for any arithmetic progression.

    What are triangular numbers?

    The sums 1, 1+2, 1+2+3 and so on. They come from the same formula with the first term set to 1.