login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A362113 Truncate Stirling's asymptotic series for 1! after n terms and round to the nearest integer. 3
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 12, 13, -131, -144, 1878, 2047, -31243, -34023, 603493, 656720, -13392786, -14565501, 338472513, 367934625, -9665776360, -10502979551, 309738982467, 336455915833, -11068897604205, -12020303454921, 438669580592210 (list; graph; refs; listen; history; text; internal format)
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
In general, we take Stirling's asymptotic series for N! (N >= 1, with N = 1 for the present sequence) and truncate it after n terms. This has the value
sqrt(2*Pi)*N^(N+1/2)*exp(-N)*(Sum_{j = 0..n} c(j)/N^j),
where c(j) = A001163(j)/A001164(j).
We then round this to the nearest integer to get a(n).
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:
c := n -> StirlingAsympt(n); # # Peter Luschny, Feb 08 2011 (This is A001163(n)/A001164(n)).
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
Sequence in context: A243361 A037278 A164852 * A033048 A108771 A041308
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Apr 15 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 30 12:47 EDT 2024. Contains 372134 sequences. (Running on oeis4.)