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.

A088139 a(n) = 2*a(n-1) - 6*a(n-2), a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 2, -2, -16, -20, 56, 232, 128, -1136, -3040, 736, 19712, 35008, -48256, -306560, -323584, 1192192, 4325888, 1498624, -22958080, -54907904, 27932672, 385312768, 603029504, -1105817600, -5829812224, -5024718848, 24929435648, 80007184384
Offset: 0

Views

Author

Paul Barry, Sep 20 2003

Keywords

Crossrefs

Programs

  • GAP
    a:=[0,1];; for n in [3..30] do a[n]:=2*a[n-1]-6*a[n-2]; od; a; # Muniru A Asiru, Oct 23 2018
  • Magma
    I:=[0,1]; [n le 2 select I[n] else 2*Self(n-1) - 6*Self(n-2): n in [1..30]]; // G. C. Greubel, Oct 22 2018
    
  • Maple
    seq(coeff(series(x/(1-2*x+6*x^2),x,n+1), x, n), n = 0 .. 30); # Muniru A Asiru, Oct 23 2018
  • Mathematica
    Join[{a=0,b=1},Table[c=2*b-6*a;a=b;b=c,{n,100}]] (* Vladimir Joseph Stephan Orlovsky, Jan 17 2011*)
    TrigExpand@Table[(6^(n/2) Sin[n ArcTan[Sqrt[5]]])/Sqrt[5], {n, 0, 20}] (* or *)
    Table[Sum[(-5)^k Binomial[n, 2 k + 1], {k, 0, n/2}], {n, 0, 20}] (* Vladimir Reshetnikov, Sep 20 2016 *)
    LinearRecurrence[{2,-6},{0,1},40] (* Harvey P. Dale, Nov 22 2024 *)
  • PARI
    x='x+O('x^30); concat([0], Vec(x/(1-2*x+6*x^2))) \\ G. C. Greubel, Oct 22 2018
    
  • Sage
    [lucas_number1(n,2,6) for n in range(0, 30)] # Zerinvary Lajos, Apr 23 2009
    

Formula

G.f.: x/(1-2*x+6*x^2).
E.g.f.: exp(x)*sin(sqrt(5)*x)/sqrt(5).
a(n) = ((1+i*sqrt(5))^n-(1-i*sqrt(5))^n)/(2*i*sqrt(5)).
a(n) = Im{(1+i*sqrt(5))^n/sqrt(5)}.
a(n) = Sum_{k=0..floor(n/2)} C(n, 2k+1)(-5)^k.
a(n+1) = (-1)^n*Sum_{k, 0<=k<=n} A172250(n,k)*(-2)^k. - Philippe Deléham, Feb 15 2012