This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A362113 #17 Apr 15 2023 14:27:48 %S A362113 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, %T A362113 -31243,-34023,603493,656720,-13392786,-14565501,338472513,367934625, %U A362113 -9665776360,-10502979551,309738982467,336455915833,-11068897604205,-12020303454921,438669580592210 %N A362113 Truncate Stirling's asymptotic series for 1! after n terms and round to the nearest integer. %C A362113 Stirling's series for N! is an asymptotic expansion. It does not converge to N! as more terms are included in the sum. %H A362113 G. Marsaglia and J. C. W. Marsaglia, <a href="http://www.jstor.org/stable/2324749">A new derivation of Stirling's approximation to n!</a>, Amer. Math. Monthly, 97 (1990), 827-829. MR1080390 (92b:41049) %F A362113 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 %F A362113 sqrt(2*Pi)*N^(N+1/2)*exp(-N)*(Sum_{j = 0..n} c(j)/N^j), %F A362113 where c(j) = A001163(j)/A001164(j). %F A362113 We then round this to the nearest integer to get a(n). %p A362113 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: %p A362113 StirlingAsympt := proc(n) option remember; h(2*n)*2^n*pochhammer(1/2, n) end: %p A362113 c := n -> StirlingAsympt(n); # # Peter Luschny, Feb 08 2011 (This is A001163(n)/A001164(n)). %p A362113 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; %p A362113 Digits:=200; %p A362113 T:=proc(N,M) local k; [seq(round(evalf(S(k,N))),k=0..M)]; end; %p A362113 T(1,40); %Y A362113 Cf. A001163/A001164, A362114-A362116. %K A362113 sign %O A362113 0,22 %A A362113 _N. J. A. Sloane_, Apr 15 2023