How would I estimate the sum of a series of numbers like this: $$1^n+2^n+\cdots+n^n$$
-
1What sort of estimate do you want? There is an exact formula for the sum of $k$th powers from $1$ to $n$ : only that it involves the Bernoulli numbers, and is a polynomial of degree $k+1$. – Sarvesh Ravichandran Iyer Oct 12 '18 at 07:28
-
Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to. – José Carlos Santos Oct 12 '18 at 07:29
-
https://en.wikipedia.org/wiki/Faulhaber%27s_formula – Matti P. Oct 12 '18 at 07:34
-
With, for example $5^5=3125$, $4^4=256$ and $3^3=27$, you will find that $n^n$ is a pretty good estimate of the sum even for quite modest $n$ – Mark Bennet Oct 12 '18 at 07:38
-
1@ChinnapparajR This is not the same, because the number of summands in this question is $n$, which is not constant – Mark Bennet Oct 12 '18 at 07:42
-
Aah!I see......... – Chinnapparaj R Oct 12 '18 at 07:45
-
@MarkBennet It's not summing $k^k$, though, it's summing $k^n$. So you shouldn't compare $5^5$ to $4^4$, but rather to $4^5 = 1024$. That's some bit off in my opinion. – Arthur Oct 12 '18 at 08:13
3 Answers
The sequence $$S_n=\sum_{k=1}^n k^n=H_n^{(-n)}$$ where appear generalized harmonic numbers.
If you look here, you will find that the asymptotics is given by $$S_n \sim \frac{e }{e-1}n^n$$ Rigorous is $$S_n=\zeta (-n)-\zeta (-n,n+1)$$ where appear the Riemann zeta function and the generalized Riemann zeta function.
Edit
Without any proof, it seems that a good approximation could be $$\color{blue}{S_n\sim\frac{ (e n+1)}{(e-1) (n+1)}n^n}$$ The table below compares the results for the first values of $n$. $$\left( \begin{array}{ccc} n & \sum_{k=1}^n k^n & \text{Round}\left[\frac{ (e n+1)}{(e-1) (n+1)}n^n\right] \\ 1 & 1 & 1 \\ 2 & 5 & 5 \\ 3 & 36 & 36 \\ 4 & 354 & 354 \\ 5 & 4423 & 4425 \\ 6 & 67144 & 67171 \\ 7 & 1199883 & 1200304 \\ 8 & 24677030 & 24684612 \\ 9 & 574148140 & 574304985 \\ 10 & 14910676160 & 14914341925 \\ 11 & 427580444554 & 427675990236 \\ 12 & 13419209344613 & 13421957361110 \\ 13 & 457507427534348 & 457593884876401 \\ 14 & 16838135509568547 & 16841089312342855 \\ 15 & 665369566514106019 & 665478473553144000 \\ 16 & 28097216849617149638 & 28101527071305611528 \\ 17 & 1262717032961647490451 & 1262899292504270591313 \\ 18 & 60174237491183944648348 & 60182438244917445266889 \\ 19 & 3030892828884033952381378 & 3031284048960901518840700 \\ 20 & 160889061690602034858545167 & 160908785696531607621474266 \end{array} \right)$$
For $n=20$, the result is off by $0.0126$% and for $n=100$, the result is off by $0.0024$%.
For sure, this leads to the same asymptotics as the one mentioned in the $OEIS$ page.
- 260,315
We have $$ 1^n + \cdots + n^n = n^n\left(\left(\frac{1}{n}\right)^n + \left(\frac{2}{n}\right)^n + \cdots + \left(\frac{n-1}{n}\right)^n + \left(\frac{n}{n}\right)^n\right) $$ Now, we use the approximation $\left(\frac{n-k}{n}\right)^n\approx e^{-k}$. It will be quite accurate for the rightmost terms, and the leftmost terms are small anyway, so the error in approximation there doesn't matter much. Thus we continue $$ \approx n^n\left(e^{1-n} + e^{2-n} + \cdots + e^{-1} + e^0\right)\\ = n^n\frac{e^{1-n}(1-e^n)}{1-e} $$ According to WolframAlpha, it's off by $3\%$ for $n = 20$, and $0.7\%$ for $n = 100$. I know that one shouldn't extrapolate, but that looks like a pretty decent approximation to me.
- 199,419
-
-
@ClaudeLeibovici I have no proof of the asymptotic behaviour here, though. I don't really know where to even start analyzing it. Inserting into WA, for $n = 100$, the two estimates have more than 40 significant digits in common, with mine being slightly smaller (and therefore more correct, as it is clearly an overestimation). But is it worth it? Maybe I should've just simplified $1-e^n$ to $-e^n$. – Arthur Oct 12 '18 at 08:22
-
I found something "funny" (in my edit). Totally empirical but it seems to work quite well. Cheers. – Claude Leibovici Oct 12 '18 at 10:13
If you were to integrate $x^n$ after the first couple of terms, you could have
$\frac{1 + 2^n + [(n + 0.5)^{n + 1} - (2.5)^{n + 1}]}{(n + 1)}$ for an approximation.
- 376
- 265