OFFSET
0,22
COMMENTS
Stirling's series for N! is an asymptotic expansion. It does not converge to N! as more terms are included in the sum.
LINKS
G. Marsaglia and J. C. W. Marsaglia, A new derivation of Stirling's approximation to n!, Amer. Math. Monthly, 97 (1990), 827-829. MR1080390 (92b:41049)
FORMULA
MAPLE
h := proc(k) option remember; local j; `if`(k=0, 1, (h(k-1)/k-add((h(k-j)*h(j))/(j+1), j=1..k-1))/(1+1/(k+1))) end:
StirlingAsympt := proc(n) option remember; h(2*n)*2^n*pochhammer(1/2, n) end:
S:=proc(k, N) local i; global c; sqrt(2*Pi)*N^(N+1/2)*exp(-N)*add(c(i)/N^i, i=0..k); end;
Digits:=200;
T:=proc(N, M) local k; [seq(round(evalf(S(k, N))), k=0..M)]; end;
T(1, 40);
CROSSREFS
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Apr 15 2023
STATUS
approved