cp's OEIS Frontend

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.

A260657 Rounded error in Stirling's formula: a(n) = round(n! - exp(-n)*n^(n+1/2)*sqrt(2*Pi)).

This page as a plain text file.
%I A260657 #25 Jan 24 2024 10:01:46
%S A260657 1,0,0,0,0,2,10,60,418,3343,30104,301175,3314114,39781325,517289459,
%T A260657 7243645801,108675472777,1739099429899,29569079533691,532313816538037,
%U A260657 10115161415506606,202324846199795597,4249233149373416698,93491368355657653179,2150474710445177712523
%N A260657 Rounded error in Stirling's formula: a(n) = round(n! - exp(-n)*n^(n+1/2)*sqrt(2*Pi)).
%H A260657 G. C. Greubel, <a href="/A260657/b260657.txt">Table of n, a(n) for n = 0..200</a>
%F A260657 a(n) ~ exp(-n)*n^(n-1/2)*sqrt(2*Pi)/12.
%F A260657 a(n) = A000142(n) - A005394(n). - _Alois P. Heinz_, Jan 24 2024
%p A260657 a:= n-> n!-round(sqrt(2*Pi*n)*(n/exp(1))^n):
%p A260657 seq(a(n), n=0..25);  # _Alois P. Heinz_, Jan 24 2024
%t A260657 Table[Round[n! - Exp[-n] n^(n+1/2) Sqrt[2 Pi]], {n, 0, 24}]
%o A260657 (Sage)
%o A260657 def a(n): # Throws an error if result could not be computed exactly.
%o A260657     rif = RealIntervalField(max(4,10*n))
%o A260657     r = rif(factorial(n)-(n^(1/2+n)*sqrt(2*pi))/exp(n))
%o A260657     return r.unique_round()
%o A260657 for n in (0..100): print(n, a(n)) # b-file style; _Peter Luschny_, Nov 18 2015
%Y A260657 Cf. A000142, A005394.
%K A260657 nonn
%O A260657 0,6
%A A260657 _Vladimir Reshetnikov_, Nov 13 2015