Pure Mathematics

Sum of the First n Integers

Adding 1 through 100 one term at a time is slow. What trick collapses the whole sum, and the general sum to n, into a single line?

solvedeasy1 min

What is the sum of the integers from 1 to 100? More generally, what is the sum of the integers from 1 to nn?

Reveal solutionHide solution

#Pair from both ends

Write the sum forwards, then backwards beneath it, and add column by column. Each of the nn columns totals n+1n + 1,

S=1+2++(n1)+n,S=n+(n1)++2+1.(1)\begin{aligned} S &= 1 + 2 + \cdots + (n-1) + n, \\ S &= n + (n-1) + \cdots + 2 + 1. \end{aligned} \tag{1}

Adding the two rows gives 2S=n(n+1)2S = n(n+1), so

S=k=1nk=n(n+1)2.(2)S = \sum_{k=1}^{n} k = \frac{n(n+1)}{2}. \tag{2}
Stack the rows 1 through n into a staircase, then add a mirror-image staircase on top. The two together fill a rectangle of width n plus 1 and height n, so each staircase is half its area. For n equal to 100 that is 100 times 101 over 2, which is 5050.

#The case n equal to 100

Substituting n=100n = 100,

k=1100k=1001012=5050.(3)\sum_{k=1}^{100} k = \frac{100 \cdot 101}{2} = 5050. \tag{3}

This is the pairing Gauss reportedly found as a schoolboy, grouping 1+1001 + 100, 2+992 + 99, and so on into fifty pairs of 101. The closed form turns a hundred additions into one multiplication.