OFFSET
0,3
FORMULA
E.g.f.: x * (1 + x) * exp(-x) / (1 - x).
a(0) = 0; a(n) = n * (a(n-1) + (-1)^n * (n-2)).
a(n) = n * (2 * A000166(n-1) + (-1)^n).
MATHEMATICA
Table[n! Sum[(-1)^k (k - 2)/(k - 1)!, {k, 1, n}], {n, 0, 22}]
nmax = 22; CoefficientList[Series[x (1 + x) Exp[-x]/(1 - x), {x, 0, nmax}], x] Range[0, nmax]!
PROG
(PARI) a(n) = n!*sum(k=1, n, (-1)^k * (k-2) / (k-1)!); \\ Michel Marcus, Oct 20 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Oct 11 2021
STATUS
approved