# Finite Sum of Power?

Sorry for the remedial math but:

Can someone tell me how to get a closed form for

$$\sum_{k=1}^n k^x$$

For $x = 1$, it's just the classic $n(n+1)/2$. What is it for $x > 1$?

-
Is x intended to be an integer? –  Rick Decker Jun 7 '12 at 14:47
as far as i know there is no such a general formula to calculate $\sum_{k=1}^{n}k^x$ even for $x$ is an integer; –  Abdelmajid Khadari Jun 7 '12 at 14:48
If $x$ is an integer, then Faulhaber's formula is what you're looking for. I believe this question has been asked before, but I can't find the duplicate. –  Zev Chonoles Jun 7 '12 at 14:50

The general formula is fairly complicated:

$$\sum_{k=1}^n{k^x} = {1\over x+1}\sum_{k=0}^x{{x+1\choose k}B_k n^{x+1-k}}$$

Where $B_k$ are the Bernoulli numbers, discovered around the same time, but independently, by Johann Bernoulli and Seki Takakazu.

This is commonly called "Faulhaber's formula", but that is a misattribution. The Donald Knuth paper "Johann Faulhaber and sums of powers" explains the history in some detail, including what Faulhaber did and did not know. In particular, he did not know the general formula above, although he did work on many special cases.

The first few special cases are:

$$\begin{array}{rl} \sum_{k=1}^n 1 & = n \\ \sum_{k=1}^n k & = \frac12{(n^2+n)} \\ \sum_{k=1}^n k^2 & = \frac16{(2n^3+3n^2+n)} \\ \sum_{k=1}^n k^3 & = \frac14{(n^4+2n^3+n^2)} \\ \sum_{k=1}^n k^4 & = \frac1{30}{(6n^5+15n^4+10n^3-n)} \\ \sum_{k=1}^n k^5 & = \frac1{12}{(2n^6+6n^5+5n^4-n^2)} \\ \end{array}$$

-