OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..500
FORMULA
a(n) = -A038156(n) for n>0.
a(n) = n! - floor(e*n!) + 1, n>0. - Gary Detlefs, Jun 06 2010
a(n) = (n+2)*a(n-1) - (2*n-1)*a(n-2) + (n-2)*a(n-3). - R. J. Mathar, Jul 28 2013
MATHEMATICA
RecurrenceTable[{a[0]==1, a[n]==n(a[n-1]-1)}, a[n], {n, 20}] (* Harvey P. Dale, Jul 25 2011 *)
PROG
(Magma) [n le 1 select 1 else (n-1)*(Self(n-1) - 1): n in [1..41]]; // G. C. Greubel, Nov 30 2024
(Python)
def A166554(n): return 1 +factorial(n) -int(exp(1)*factorial(n)) +int(n==0)
print([A166554(n) for n in range(41)]) # G. C. Greubel, Nov 30 2024
CROSSREFS
KEYWORD
sign
AUTHOR
Philippe Deléham, Oct 16 2009
STATUS
approved