Kolton Ndoj

Add 1 to n in one step

Adding the first hundred whole numbers takes one multiplication, not a hundred additions.

1+2+3+⋯+n=n(n+1)21+2+3+\dots+n=\frac{n(n+1)}{2}

What the symbols mean

nn
how many numbers you add
n+1n+1
the sum of each pair: first + last, second + second-to-last, and so on
12\tfrac12
because writing the list twice counts every pair two times

Why it works — the picture

Write the list 1 to n, then write it backwards underneath. Every column adds up to the same number, n+1, and there are n columns. That is a rectangle n tall and n+1 wide, and your original list is exactly half of it. Or see it as a staircase of blocks: two staircases snap together into a rectangle.

Graph for Add 1 to n in one step 0202200
The height at t is 1+2+...+t. Notice it bends upward like a parabola: the sum grows roughly like t squared over 2, because the staircase is half of a square. (drawn with the default slider values — move the sliders live)

Try it yourself

Where it’s used in real life

Programmers use it to count how many steps a nested loop takes; the number of pairs among n objects is a close cousin of it.

The story behind it

A famous story says the young Carl Friedrich Gauss used this trick in school; the details are folklore, but the pairing idea is very old.

Related

Play with it live →

Math · Series & algebra · Beginner-friendly