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.

A106539 a(1)=1, a(2)=1, a(n) = (n-1)*a(n-1) - (n-2)*a(n-2) - ... - a(1) for n>=3.

Original entry on oeis.org

1, 1, 1, 0, -6, -36, -192, -1104, -7248, -54816, -472512, -4573824, -49064448, -577130496, -7381281792, -101940854784, -1511556077568, -23945902043136, -403579232182272, -7209532170092544, -136064164749017088, -2705030337674674176, -56501002847058788352
Offset: 1

Views

Author

Alexandre Wajnberg, May 08 2005

Keywords

Comments

Beginning with a(0)=0, a(1)=1 gives 0, 1, 2, 4, 8, 16, ..., 2^(n-1).

Examples

			a(7) = 6*(-36) - 5(-6) - 4*0 - 3*1 - 2*1 - 1*1 = -216 + 30 - 0 - 3 - 2 - 1 = -192.
		

Crossrefs

Cf. A001571.

Programs

  • Magma
    [n le 2 select 1 else n*Self(n-1) - 2*(n-2)*Self(n-2): n in [1..30]]; // G. C. Greubel, Sep 03 2021
    
  • Maple
    nmax:=24; a[1]:=1: a[2]:=1: for n from 3 to nmax do a[n]:=(n-1)*a[n-1]-add(k*a[k],k=1..n-2) od: seq(a[n],n=1..nmax); # Emeric Deutsch, Feb 03 2006
  • Mathematica
    RecurrenceTable[{a[n]==n*a[n-1] - 2*(n-2)*a[n-2], a[1]==a[2]==1}, a[n], {n,1,20}] (* Georg Fischer, Jun 18 2021 *)
  • Sage
    def a(n): return 1 if (n<3) else n*a(n-1) - 2*(n-2)*a(n-2)
    [a(n) for n in (1..30)] # G. C. Greubel, Sep 03 2021

Formula

D-finite with recurrence: a(n) = n*a(n-1) - 2*(n-2)*a(n-2), a(1)=1, a(2)=1. - Georg Fischer, Jun 18 2021
a(n) = e^(-2)*( - Gamma(n)*E_{n}(-2) + 2^(n-1)*(-Ei(2) + e^2 - Pi*i), where Ei(x) and E_{n}(x) are exponential integrals. - G. C. Greubel, Sep 03 2021

Extensions

More terms from Emeric Deutsch, Feb 03 2006
Definition adapted to offset by Georg Fischer, Jun 18 2021