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.

A078021 Expansion of (1-x)/(1-x+2*x^2+x^3).

Original entry on oeis.org

1, 0, -2, -3, 1, 9, 10, -9, -38, -30, 55, 153, 73, -288, -587, -84, 1378, 2133, -539, -6183, -7238, 5667, 26326, 22230, -36089, -106875, -56927, 192912, 413641, 84744, -935450, -1518579, 267577, 4240185, 5223610, -3524337, -18211742, -16386678, 23561143, 74546241, 43810633, -128842992
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Crossrefs

Cf. A077978.

Programs

  • GAP
    a:=[1,0,-2];; for n in [4..50] do a[n]:=a[n-1]-2*a[n-2]-a[n-3]; od; a; # G. C. Greubel, Jun 29 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1-x)/(1-x+2*x^2+x^3) )); // G. C. Greubel, Jun 29 2019
    
  • Mathematica
    LinearRecurrence[{1,-2,-1}, {1,0,-2}, 50] (* or *) CoefficientList[ Series[(1-x)/(1-x+2*x^2+x^3), {x, 0, 50}], x] (* G. C. Greubel, Jun 29 2019 *)
  • PARI
    my(x='x+O('x^50)); Vec((1-x)/(1-x+2*x^2+x^3)) \\ G. C. Greubel, Jun 29 2019
    
  • Sage
    ((1-x)/(1-x+2*x^2+x^3)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Jun 29 2019
    

Formula

a(n) = A077978(n) - A077978(n-1). - G. C. Greubel, Jun 29 2019
a(n) = a(n-1)-2*a(n-2)-a(n-3). - Wesley Ivan Hurt, Apr 26 2021