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!)
A260657 Rounded error in Stirling's formula: a(n) = round(n! - exp(-n)*n^(n+1/2)*sqrt(2*Pi)). 1
1, 0, 0, 0, 0, 2, 10, 60, 418, 3343, 30104, 301175, 3314114, 39781325, 517289459, 7243645801, 108675472777, 1739099429899, 29569079533691, 532313816538037, 10115161415506606, 202324846199795597, 4249233149373416698, 93491368355657653179, 2150474710445177712523 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,6
LINKS
FORMULA
a(n) ~ exp(-n)*n^(n-1/2)*sqrt(2*Pi)/12.
a(n) = A000142(n) - A005394(n). - Alois P. Heinz, Jan 24 2024
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
Sequence in context: A276310 A098616 A082042 * A079856 A073329 A290446
KEYWORD
nonn
AUTHOR
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 24 04:02 EDT 2024. Contains 371918 sequences. (Running on oeis4.)