OFFSET
0,6
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..200
FORMULA
a(n) ~ exp(-n)*n^(n-1/2)*sqrt(2*Pi)/12.
MAPLE
a:= n-> n!-round(sqrt(2*Pi*n)*(n/exp(1))^n):
seq(a(n), n=0..25); # Alois P. Heinz, Jan 24 2024
MATHEMATICA
Table[Round[n! - Exp[-n] n^(n+1/2) Sqrt[2 Pi]], {n, 0, 24}]
PROG
(Sage)
def a(n): # Throws an error if result could not be computed exactly.
rif = RealIntervalField(max(4, 10*n))
r = rif(factorial(n)-(n^(1/2+n)*sqrt(2*pi))/exp(n))
return r.unique_round()
for n in (0..100): print(n, a(n)) # b-file style; Peter Luschny, Nov 18 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Reshetnikov, Nov 13 2015
STATUS
approved