OFFSET
0,2
COMMENTS
a(n) = (n-1)*(a(n-1)+a(n-2)), n>2. - Gary Detlefs, Apr 11 2010
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..450
FORMULA
a(n) = 3*n! + floor((n!+1)/e) for n>0. - Gary Detlefs, Apr 11 2010
E.g.f.: (3*exp(x)*x+1)*exp(-x)/(1-x). - Alois P. Heinz, May 07 2020
MAPLE
a:= proc(n) option remember;
`if`(n<2, 2*n+1, n*a(n-1)+(-1)^n)
end:
seq(a(n), n=0..23); # Alois P. Heinz, May 07 2020
MATHEMATICA
RecurrenceTable[{a[1]==3, a[n]==n a[n-1]+(-1)^n}, a, {n, 20}] (* Harvey P. Dale, Nov 21 2011 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Philippe Deléham, Sep 04 2005
EXTENSIONS
a(0)=1 prepended by Alois P. Heinz, May 07 2020
STATUS
approved