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.

A152718 a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3) - a(n-4) + a(n-5), n > 5.

Original entry on oeis.org

1, 1, 1, 1, 2, 4, 8, 16, 31, 60, 117, 228, 444, 865, 1685, 3282, 6393, 12453, 24257, 47250, 92038, 179280, 349218, 680239, 1325032, 2581019, 5027546, 9793116, 19075931, 37157851, 72379476, 140987393, 274628197, 534946033, 1042017030, 2029736504, 3953707240
Offset: 0

Views

Author

R. J. Mathar, Dec 11 2008

Keywords

Comments

Conjecture: this is the inverse Motzkin transform of A054393.

Programs

  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(1 + x*(-1+x+x^3)/(-1+2*x-x^2+2*x^3-x^4+x^5))); // G. C. Greubel, Sep 01 2018
  • Maple
    a:= n-> `if`(n=0, 1, (<<0|1|0|0|0>, <0|0|1|0|0>, <0|0|0|1|0>,
           <0|0|0|0|1>, <1|-1|2|-1|2>>^n. <<0, 1, 1, 1, 2>>)[1$2]):
    seq(a(n), n=0..40);  # Alois P. Heinz, Nov 08 2016
  • Mathematica
    Join[{1}, LinearRecurrence[{2, -1, 2, -1, 1}, {1, 1, 1, 2, 4}, 50]] (* G. C. Greubel, Sep 01 2018 *)
  • PARI
    a(n) = {if (n==0, return(1)); if (n==1, return(1)); if (n==2, return(1)); if (n==3, return(1)); if (n==4, return(2)); if (n==5, return(4)); return (2*a(n-1)-a(n-2)+2*a(n-3)-a(n-4)+a(n-5));} \\ Michel Marcus, Jul 23 2013
    
  • PARI
    x='x+O('x^50); Vec(1 + x*(-1+x+x^3)/(-1+2*x-x^2+2*x^3-x^4+x^5)) \\ G. C. Greubel, Sep 01 2018
    

Formula

a(n)=1, n < 4. a(4)=2, a(5)=4. a(n) = 2*a(n-1) - a(n-2) + 2a(n-3) - a(n-4) + a(n-5), n > 5.
G.f.: 1 + x*(-1 + x + x^3)/(-1 + 2*x - x^2 + 2*x^3 - x^4 + x^5). - R. J. Mathar, May 26 2016