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.

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

Original entry on oeis.org

1, 1, 0, -4, -10, -12, 4, 52, 120, 128, -88, -672, -1424, -1328, 1536, 8576, 16736, 13248, -24128, -108224, -194688, -124672, 356480, 1351680, 2239744, 1063168, -5056512, -16718848, -25451008, -7351296, 69637120, 204878848, 285186048, 21340160, -937449472, -2487951360, -3143684096
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Programs

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

Formula

a(n+3) = 2*a(n+2) - 2*a(n+1) - 2*a(n), where a(0)=1, a(1)=1, a(2)=0. - Sergei N. Gladkovskii, Aug 21 2012