login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

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 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A001120 a(0) = a(1) = 1; for n > 1, a(n) = n*a(n-1) + (-1)^n.
(Formerly M2760 N1110)
6
1, 1, 3, 8, 33, 164, 985, 6894, 55153, 496376, 4963761, 54601370, 655216441, 8517813732, 119249392249, 1788740883734, 28619854139745, 486537520375664, 8757675366761953, 166395831968477106, 3327916639369542121, 69886249426760384540, 1537497487388728459881 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

REFERENCES

N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..450 (terms n = 1..100 from T. D. Noe)

J. Gebel, Integer points on Mordell curves [Cached copy, after the original web site tnt.math.se.tmu.ac.jp was shut down in 2017]

FORMULA

Nearest integer to n!(1+1/e).

a(n) = A000166(n) + [n > 0] * n!. - Philippe Deléham, Sep 04 2005

a(n) = n!*(1+Sum_{k=0..n} (-1)^k/k!, n>=1. - Paolo P. Lava, Nov 21 2008

a(n) = (n-1)*(a(n-1)+a(n-2)), n>2. - Gary Detlefs, Apr 11 2010

E.g.f.: (exp(x)*x+1)*exp(-x)/(1-x). - Alois P. Heinz, May 08 2020

MAPLE

a:= proc(n) option remember;

     `if`(n<2, 1, n*a(n-1)+(-1)^n)

    end:

seq(a(n), n=0..23);  # Alois P. Heinz, May 09 2020

MATHEMATICA

t = {1}; Do[AppendTo[t, n*t[[-1]] + (-1)^n], {n, 2, 20}]; t (* T. D. Noe, Jun 26 2012 *)

RecurrenceTable[{a[1]==1, a[n]==n a[n-1]+(-1)^n}, a, {n, 30}] (* Harvey P. Dale, Feb 19 2018 *)

PROG

(PARI) a(n)=if(n<2, n>0, n*a(n-1)+(-1)^n)

(PARI) a(n)=if(n<1, 0, n!*polcoeff((1+exp(-x+x*O(x^n)))/(1-x), n))

CROSSREFS

A000166 has a similar recurrence.

Column k=1 of A334715.

Cf. A000142.

Sequence in context: A225688 A109655 A184255 * A302629 A339315 A322303

Adjacent sequences:  A001117 A001118 A001119 * A001121 A001122 A001123

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane, Simon Plouffe

EXTENSIONS

a(0)=1 prepended by Alois P. Heinz, May 08 2020

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 November 26 08:23 EST 2022. Contains 358354 sequences. (Running on oeis4.)