Sum of powers

The sum of integers is easily calculated (arithmetic series) :
1 + 2 + 3 +...+ n = n(n+1)/2
The sum of squares S2(n) = 12 + 22 + 32 +...+ n2 is a little more tricky.
We first take the expansion of (n+1)3 = n3 + 3 n2 + 3n + 1
(0+1)3 = 03 + 3 x 02 + 3 x 0 + 1
(1+1)3 = 13 + 3 x 12 + 3 x 1 + 1
(2+1)3 = 23 + 3 x 22 + 3 x 2 + 1
(3+1)3 = 33 + 3 x 32 + 3 x 3 + 1
...
(n+1)3 = n3 + 3 x n2 + 3 x n + 1    summing up and reducing the similar terms :
(n+1)3 = 03 + 3S2(n) + 3n(n+1)/2 + (n+1)
that is S2(n) = ((n+1)3 - 3n(n+1)/2 - (n+1))/3 = n3/6 + n2/2 + n/6 = n(n+1)(2n+1)/6

In the same way, we can calculate the sum of cubes, by expanding (n+1)4 :
S3(n) = 13 + 23 + 33 +...+ n3 = n2(n+1)2/4 which by the way is the square of the sum of integers.

A general formula for Sk(n)=1k+2k+3k+4k+...+nk uses the Bernoulli numbers Bi.
Sk(n) = nk+1/(k+1) + nk/2 + ∑i=2k Ck+1i Bi nk+1-i

 

Home Arithmetic Geometric Misc Topics Scripts Games Exercices Mail Version Franšaise Previous topic Next topic