2

Today I tried to derive an asymptotic formula for the sum $$\sum_{k=1}^{m}\log(k!)$$ Here is what I did: This can be rewritten as $$\sum_{k=1}^{m}\sum_{1<n\le k}\log n$$ Now I applied the Euler summation formula, and this turned to $$\sum_{k=1}^{m}\left(\int_{1}^{k}\log t\,dt+\int_{1}^{k}\frac{t-[t]}{t}dt+\log(k)([k]-k)\right)$$ $\int_{1}^{k}\frac{t-[t]}{t}dt$ is dominated by $\int_{1}^{k}\frac{1}{t}dt=\log k$, so $\int_{1}^{k}\frac{t-[t]}{t}dt=O(\log k)$, and it is also true that $\log(k)([k]-k)=O(\log k)$ Now, the sum becomes $$\sum_{k=1}^{m}(1-k+k\log k+O(\log k)+O(\log k))=\sum_{k=1}^{m}(1-k+k\log k+O(\log k))$$ which is equal to $$m-\frac{m(m+1)}{2}+\log H(m)+O(\log m)$$ where $H(m)$ is hyperfactorial. Is my solution right? I could have made a mistake.

  • See http://people.cs.uchicago.edu/~laci/CLASS/HANDOUTS/factorialasymp.pdf – ə̷̶̸͇̘̜́̍͗̂̄︣͟ Dec 16 '20 at 08:50
  • @TheSimpliFire oh thanks. But they gave some other asymptotic. In fact, mine is better than theirs. –  Dec 16 '20 at 08:52
  • In terms of the Barnes-$G$ function and the gamma function, your sum is $ \log G(m + 2) = \log G(m + 1) + \log \Gamma(m) +\log m $. You can use the known asymptotic expansions http://dlmf.nist.gov/5.17.E5 and http://dlmf.nist.gov/5.11.E1 to derive a complete asymptotic expansion for large $m$. – Gary Dec 16 '20 at 09:11
  • 1
    $$\sum_{k=1}^n\log(k!)=(n+1)\log(n!)-\log(H(n))$$ exactly. – robjohn Dec 16 '20 at 20:37
  • @robjohn oh thanks. I also derived another asymptotic formula whose error term is improved to $O(1)$, and that formula does not contain hyperfactorial, so it is very easy to compute it. Even easier than this exact formula. –  Dec 17 '20 at 04:01

2 Answers2

2

Comment on the Answer in the Question

One problem is that $$ \sum_{k=1}^mO(\log(k))=O(m\log(m))\tag1 $$ However, as the result is $\sim\frac{m^2}2\log(m)$, this does not invalidate the entire result.

Equation $(7)$ of this answer shows that $$ \begin{align} \log(H(m)) &=\sum_{k=1}^mk\log(k)\tag{2a}\\ &=\frac{m^2}2\log(m)-\frac{m^2}4+O(m\log(m))\tag{2b} \end{align} $$ so we get $$ m-\frac{m(m+1)}2+\log(H(m))=\frac{m^2}2\log(m)-\frac{3m^2}4+O(m\log(m))\tag3 $$ Thus, as long as the error term is taken to be $O(m\log(m))$ instead of $O(\log(m))$, your answer is correct.


More Precise Asymptotic Expansion

Using a result from an earlier answer, $$ \begin{align} \sum_{k=1}^n\log(k!) &=\sum_{k=1}^n\sum_{j=1}^k\log(j)\tag{4a}\\ &=\sum_{j=1}^n\sum_{k=j}^n\log(j)\tag{4b}\\ &=\sum_{j=1}^n(n-j+1)\log(j)\tag{4c}\\ &=n^2\frac{2\log(n)-3}4+n\log\left(\frac{\sqrt{2\pi}}en\right)+\frac5{12}\log(n)\\ &+\log\left(\frac{\sqrt{2\pi}}{A}\right)+\frac1{12}+\frac1{12n}+O\!\left(\frac{\log(n)}{n^2}\right)\tag{4d}\\ &=\frac{n^2}2\log(n)-\frac{3n^2}4+n\log(n)+\left(\frac12\log(2\pi)-1\right)n+\frac5{12}\log(n)\\ &+\left(\frac1{12}+\frac12\log(2\pi)-\log(A)\right)+\frac1{12n}+O\!\left(\frac{\log(n)}{n^2}\right)\tag{4e} \end{align} $$ Explanation:
$\text{(4a)}$: definition of $n!$
$\text{(4b)}$: change order of summation
$\text{(4c)}$: evaluate the inner sum
$\text{(4d)}$: $(8)$ from this answer, where $A$ is the Glaisher-Kinkelin constant
$\text{(4e)}$: rearranging terms

By taking more terms in the Euler-Maclaurin expansions of $(6)$ and $(7)$ from the answer cited above, we get $$ \begin{align} &\sum_{k=1}^n\log(k!)\\ &=\frac12n^2\log(n)-\frac34n^2+n\log(n)+\left(\frac12\log(2\pi)-1\right)n+\frac5{12}\log(n)\\ &+\left(\frac1{12}+\frac12\log(2\pi)-\log(A)\right)+\frac1{12n}-\frac1{240n^2}-\frac1{360n^3}+\frac1{1008n^4}\\ &+\frac1{1260n^5}-\frac1{1440n^6}-\frac1{1680n^7}+\frac1{1056n^8}+\frac1{1188n^9}+O\!\left(\frac1{n^{10}}\right)\tag5 \end{align} $$

robjohn
  • 345,667
1

As @Gary commented $$\sum_{k=1}^{m}\log(k!)=\log \big[G(m+2)\big]$$ Using a CAS, $$\log \big[G(m+2)\big]=\frac1{12}(6 m^2+12 m+5)\log(m)+m \log \left(\frac{\sqrt{2 \pi }}{e}\right)-\frac 34m^2+$$ $$\log \left(\frac{ \sqrt{2 \pi e^{\frac 16} }}{A}\right)+\frac 1{12m}-\frac{1}{240 m^2}+O\left(\frac{1}{m^3}\right)$$ which shows a relative error lower than $0.01$% as soon as $m>1$