Number Theory
Basic

Sum of First n Integers

Closed form for the sum of the first n natural numbers.

Formula

k=1nk=n(n+1)2\sum_{k=1}^{n} k = \frac{n(n+1)}{2}

Variables

nUpper limit

Example

1 + 2 + … + 100 = 100·101/2 = 5050 (as young Gauss famously found).

Did You Know?

Gauss allegedly found this formula as a schoolboy to sum 1 through 100 in seconds.