1 + 2 + 3 +...+ n = n(n+1)/2

The sum of squares S

We first take the expansion of (n+1)

(0+1)

(1+1)

(2+1)

(3+1)

...

(n+1)

(n+1)

that is S

In the same way, we can calculate the sum of cubes, by expanding (n+1)^{4} :

S_{3}(n) = 1^{3} + 2^{3} + 3^{3} +...+ n^{3} = n^{2}(n+1)^{2}/4
which by the way is the square of the sum of integers.

A general formula for S_{k}(n)=1^{k}+2^{k}+3^{k}+4^{k}+...+n^{k}
uses the Bernoulli numbers B_{i}.

S_{k}(n) = n^{k+1}/(k+1) + n^{k}/2 + ∑_{i=2}^{k} C_{k+1}^{i} B_{i} n^{k+1-i}