cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A001120 a(0) = a(1) = 1; for n > 1, a(n) = n*a(n-1) + (-1)^n.

This page as a plain text file.
%I A001120 M2760 N1110 #55 Feb 19 2024 01:47:58
%S A001120 1,1,3,8,33,164,985,6894,55153,496376,4963761,54601370,655216441,
%T A001120 8517813732,119249392249,1788740883734,28619854139745,486537520375664,
%U A001120 8757675366761953,166395831968477106,3327916639369542121,69886249426760384540,1537497487388728459881
%N A001120 a(0) = a(1) = 1; for n > 1, a(n) = n*a(n-1) + (-1)^n.
%D A001120 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A001120 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A001120 Alois P. Heinz, <a href="/A001120/b001120.txt">Table of n, a(n) for n = 0..450</a> (terms n = 1..100 from T. D. Noe)
%H A001120 J. Gebel, <a href="/A001014/a001014.txt">Integer points on Mordell curves</a> [Cached copy, after the original web site tnt.math.se.tmu.ac.jp was shut down in 2017]
%F A001120 Nearest integer to n!(1+1/e).
%F A001120 a(n) = A000166(n) + [n > 0] * n!. - _Philippe Deléham_, Sep 04 2005
%F A001120 a(n) = (n-1)*(a(n-1)+a(n-2)), n>2. - _Gary Detlefs_, Apr 11 2010
%F A001120 E.g.f.: (exp(x)*x+1)*exp(-x)/(1-x). - _Alois P. Heinz_, May 08 2020
%p A001120 a:= proc(n) option remember;
%p A001120      `if`(n<2, 1, n*a(n-1)+(-1)^n)
%p A001120     end:
%p A001120 seq(a(n), n=0..23);  # _Alois P. Heinz_, May 09 2020
%t A001120 t = {1}; Do[AppendTo[t, n*t[[-1]] + (-1)^n], {n, 2, 20}]; t (* _T. D. Noe_, Jun 26 2012 *)
%t A001120 RecurrenceTable[{a[1]==1,a[n]==n a[n-1]+(-1)^n},a,{n,30}] (* _Harvey P. Dale_, Feb 19 2018 *)
%o A001120 (PARI) a(n)=if(n<2,n>0,n*a(n-1)+(-1)^n)
%o A001120 (PARI) a(n)=if(n<1,0,n!*polcoeff((1+exp(-x+x*O(x^n)))/(1-x),n))
%Y A001120 A000166 has a similar recurrence.
%Y A001120 Column k=1 of A334715.
%Y A001120 Cf. A000142.
%K A001120 nonn,easy
%O A001120 0,3
%A A001120 _N. J. A. Sloane_, _Simon Plouffe_
%E A001120 a(0)=1 prepended by _Alois P. Heinz_, May 08 2020