The polygonal number theorem
The Greeks already arranged pebbles into figures. With 1, 3, 6, 10 pebbles you make triangles; with 1, 4, 9, 16, squares; with 1, 5, 12, 22, pentagons. These are the polygonal numbers.
The formula The $n$-th number with $k$ sides is obtained by adding up an arithmetic progression that starts at 1 and grows in steps of $k - 2$:
$$P_k(n) = 1 + (k-1) + (2k-3) + \cdots = \frac{n\,\big((k-2)n - (k-4)\big)}{2}.$$For $k = 3$ we get the triangular numbers $\frac{n(n+1)}{2}$: 1, 3, 6, 10, 15, … For $k = 4$, the squares $n^2$. For $k = 5$, the pentagonal numbers $\frac{n(3n-1)}{2}$: 1, 5, 12, 22, 35, … We will also count zero, $P_k(0) = 0$.