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.

A052993 a(n) = a(n-1) + 3*a(n-2) - 3*a(n-3), with a(0)=a(1)=1, a(2)=4.

Original entry on oeis.org

1, 1, 4, 4, 13, 13, 40, 40, 121, 121, 364, 364, 1093, 1093, 3280, 3280, 9841, 9841, 29524, 29524, 88573, 88573, 265720, 265720, 797161, 797161, 2391484, 2391484, 7174453, 7174453, 21523360, 21523360, 64570081, 64570081, 193710244
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Crossrefs

Cf. A062318.

Programs

  • Magma
    I:=[1,1,4]; [n le 3 select I[n] else Self(n-1) +3*Self(n-2) -3*Self(n-3): n in [1..30]]; // G. C. Greubel, Nov 21 2018
    
  • Maple
    spec := [S,{S=Prod(Sequence(Prod(Union(Z,Z,Z),Z)),Sequence(Z))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
  • Mathematica
    (3^(1+Floor[(Range@40-1)/2])-1)/2 (* Federico Provvedi, Nov 22 2018 *)
    LinearRecurrence[{1,3,-3}, {1,1,4}, 30] (* or *) RecurrenceTable[{a[n + 2] == 3*a[n] + 1, a[0] == 1, a[1] == 1}, a, {n,0,30}] (* G. C. Greubel, Nov 21 2018 *)
  • PARI
    x='x+O('x^30); Vec(1/((1-3*x^2)*(1-x))) \\ G. C. Greubel, Nov 21 2018
    
  • Sage
    s=(1/((1-3*x^2)*(1-x))).series(x,30); s.coefficients(x, sparse=False) # G. C. Greubel, Nov 21 2018

Formula

G.f.: 1/((1-3*x^2)*(1-x)).
a(n+2) = 3*a(n) + 1, where a(0) = a(1) = 1.
a(n) = -1/2 + Sum((1/4)*(1+3*_alpha)*_alpha^(-1-n), _alpha = RootOf(-1 + 3*_Z^2)).
a(n) = Sum{k=0..n} 3^(k/2)*(1-(-1)^k)/(2*sqrt(3)). - Paul Barry, Jul 28 2004
a(n) = (3^(1+floor((n-1)/2)) - 1)/2. - Federico Provvedi, Nov 22 2018
a(n)-a(n-1) = A254006(n). - R. J. Mathar, Feb 27 2019

Extensions

More terms from James Sellers, Jun 06 2000