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.

A003048 a(n+1) = n*a(n) - (-1)^n.

This page as a plain text file.
%I A003048 #30 May 09 2024 13:26:31
%S A003048 1,2,3,10,39,196,1175,8226,65807,592264,5922639,65149030,781788359,
%T A003048 10163248668,142285481351,2134282220266,34148515524255,
%U A003048 580524763912336,10449445750422047,198539469258018894
%N A003048 a(n+1) = n*a(n) - (-1)^n.
%F A003048 E.g.f.: (2-exp(-x))/(1-x) (if offset 0).
%F A003048 a(n) = (n-1)! + A002467(n-1), n > 0. (index corrected Mar 07 2022)
%F A003048 D-finite with recurrence a(n+2) = n(a(n) + a(n+1)) for n > 0. - _Amarnath Murthy_, Oct 05 2002
%F A003048 a(n) = 2*(n-1)! - floor(((n-1)! + 1)/e), n > 1. - _Gary Detlefs_, Apr 11 2010
%p A003048 a:= proc(p) option remember; p*a(p-1)-(-1)^p end proc: a(0):= 1: seq(a(p),p=0..19); # _Robert Israel_, Jan 05 2008
%t A003048 a[0] = 1; a[p_] := p*a[p - 1] -(-1)^p; a /@ Range[0, 19] (* _Zerinvary Lajos_, Mar 29 2007 *)
%t A003048 FoldList[#1*#2 - (-1)^#2 &, 1, Range[19]] (* _Robert G. Wilson v_, Jul 07 2012 *)
%t A003048 RecurrenceTable[{a[n + 1] == n a[n] - (-1)^n, a[1] == 1}, a[n], {n, 21}] (* _Ray Chandler_, Jul 30 2015 *)
%o A003048 (PARI) a(n)=if(n<2,n>0,(n-1)*a(n-1)+(-1)^n)
%o A003048 (PARI) a(n)=if(n<1,0,(n-1)!*polcoeff((2-exp(-x+O(x^n)))/(1-x),n-1))
%Y A003048 Cf. A002467.
%K A003048 nonn
%O A003048 1,2
%A A003048 _N. J. A. Sloane_