## Sunday, March 15, 2020

### [jetcokdb] Euler and Stirling

Euler's famous equation e^(i*pi) + 1 = 0 relates e and pi.  Some consider this surprising because the two numbers seem to come from very different areas of mathematics.

Stirling's approximation to the factorial and to the gamma function also contains e and pi.

log(n!) ~= n*log(n) - n + (1/2)*log(2*pi*n) + 1/(12*n) - 1/(360*n^3) + 1/(1260*n^5) - 1/(1680*n^7) + 1/(1188*n^9) - 691/(360360*n^11) + 1/(156*n^13) - 3617/(122400*n^15) + 43867/(244188*n^17) - 174611/(125400*n^19) + ...

e is hidden inside the natural logarithm, and pi is in the third term.  Are Euler's and Stirling's formulae related?

The above presentation of Stirling shows even powers disappearing and gives enough terms to show that the coefficients are pretty weird (related to the Bernoulli numbers which are pretty weird), not anything as well behaved as the first two terms 1/12 and -1/360 might suggest.  For more terms using Mathematica: `Series[LogGamma[z+1],{z,Infinity,99}]`

Incidentally, Stirling's approximation does not converge because Bernoulli numbers grow very quickly.  However, Wikipedia does have an unsourced series for log gamma using rising exponentials and Stirling numbers of the first kind that claims to converge.  Its even powers do not vanish.