login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A110149
a(0) = 1, a(1) = 3; for n>1, a(n) = n*a(n-1) + (-1)^n.
2
1, 3, 7, 20, 81, 404, 2425, 16974, 135793, 1222136, 12221361, 134434970, 1613219641, 20971855332, 293605974649, 4404089619734, 70465433915745, 1197912376567664, 21562422778217953, 409686032786141106, 8193720655722822121, 172068133770179264540
OFFSET
0,2
COMMENTS
A000166, A001120 and A110043 have a similar recurrence.
a(n) = (n-1)*(a(n-1)+a(n-2)), n>2. - Gary Detlefs, Apr 11 2010
LINKS
FORMULA
a(n) = A110043(n) + n! = A001120(n) + 2*n! = A000166(n) + 3*n! for n>0.
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
Column k=3 of A334715.
Sequence in context: A071688 A232687 A211602 * A024331 A007174 A091184
KEYWORD
nonn,easy
AUTHOR
Philippe Deléham, Sep 04 2005
EXTENSIONS
a(0)=1 prepended by Alois P. Heinz, May 07 2020
STATUS
approved