Stirling's Series

DOWNLOAD Mathematica Notebook

The asymptotic series for the gamma function is given by

 Gamma(z)∼e^(-z)z^(z-1/2)sqrt(2pi)(1+1/(12z)+1/(288z^2)-(139)/(51840z^3)-(571)/(2488320z^4)+...)
(1)

(OEIS A001163 and A001164).

The coefficient a_n of z^(-n) can given explicitly by

 a_n=sum_(k=1)^(2n)(-1)^k(d_3(2n+2k,k))/(2^(n+k)(n+k)!),
(2)

where d_3(n,k) is the number of permutations of n with k permutation cycles all of which are >=3 (Comtet 1974, p. 267). Another formula for the a_ns is given by the recurrence relation

 b_n=1/(n+1)(b_(n-1)-sum_(k=2)^(n-1)kb_kb_(n+1-k)),
(3)

with b_0=b_1=1, then

 a_n=(2n+1)!!b_(2n+1),
(4)

where x!! is the double factorial (Borwein and Corless 1999).

The series for z! is obtained by adding an additional factor of z,

z!=Gamma(z+1)
(5)
∼e^(-z)z^(z+1/2)sqrt(2pi)(1+1/(12z)+1/(288z^2)-(139)/(51840z^3)-(571)/(2488320z^4)+...).
(6)

The expansion of lnGamma(z) is what is usually called Stirling's series. It is given by the simple analytic expression

lnGamma(z)=1/2ln(2pi)+(z-1/2)lnz-z+sum_(n=1)^(infty)(B_(2n))/(2n(2n-1)z^(2n-1))
(7)
=1/2ln(2pi)+(z-1/2)lnz-z+1/(12z)-1/(360z^3)+1/(1260z^5)-...
(8)

(OEIS A046968 and A046969), where B_n is a Bernoulli number. Interestingly, while the numerators in this expansion are the same as those of B_(2n)/(2n) for the first several hundred terms, they differ at n=574, 1185, 1240, 1269, 1376, 1906, 1910, ... (OEIS A090495), with the corresponding ratios being 37, 103, 37, 59, 131, 37, 67, ... (OEIS A090496).

Wolfram Web Resources

Mathematica »

The #1 tool for creating Demonstrations and anything technical.

Wolfram|Alpha »

Explore anything with the first computational knowledge engine.

Wolfram Demonstrations Project »

Explore thousands of free applications across science, mathematics, engineering, technology, business, art, finance, social sciences, and more.

Computerbasedmath.org »

Join the initiative for modernizing math education.

Online Integral Calculator »

Solve integrals with Wolfram|Alpha.

Step-by-step Solutions »

Walk through homework problems step-by-step from beginning to end. Hints help you try the next step on your own.

Wolfram Problem Generator »

Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.

Wolfram Education Portal »

Collection of teaching and learning tools built by Wolfram education experts: dynamic textbook, lesson plans, widgets, interactive Demonstrations, and more.

Wolfram Language »

Knowledge-based programming for everyone.