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.

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

Original entry on oeis.org

0, 1, 3, 9, 29, 90, 284, 890, 2797, 8780, 27574, 86581, 271881, 853732, 2680833, 8418132, 26433983, 83005929, 260648825, 818469251, 2570093890, 8070410030, 25342077544, 79577232067, 249882270390, 784660981474, 2463931734897
Offset: 1

Views

Author

Gary W. Adamson and Roger L. Bagula, Oct 26 2006

Keywords

Crossrefs

Programs

  • GAP
    a:=[0,1,3,9];; for n in [5..30] do a[n]:=2*a[n-1]+4*a[n-2]-a[n-3] -a[n-4]; od; a; # G. C. Greubel, Aug 05 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 30); [0] cat Coefficients(R!( x^2*(1+x-x^2)/(1-2*x-4*x^2+x^3+x^4) )); // G. C. Greubel, Aug 05 2019
    
  • Maple
    seq(coeff(series(x^2*(1+x-x^2)/(1-2*x-4*x^2+x^3+x^4), x, n+1), x, n), n = 1..30); # G. C. Greubel, Aug 05 2019
  • Mathematica
    M = {{0,-1,-1,0,1}, {-1,0,0,0,-1}, {-1,0,1,0,-1}, {0,0,-1,0,0}, {1,-1, -1,0,1}}; v[1] = {0,0,0,0,1}; v[n_]:= v[n] = M.v[n-1]; Table[v[n][[1]], {n, 30}]
    CoefficientList[Series[x^2*(1+x-x^2)/(1-2*x-4*x^2+x^3+x^4), {x, 0, 30}], x] (* G. C. Greubel, Aug 05 2019 *)
  • PARI
    my(x='x+O('x^30)); concat([0], Vec(x^2*(1+x-x^2)/(1-2*x-4*x^2+x^3+x^4))) \\ G. C. Greubel, Aug 05 2019
    
  • Sage
    a=(x^2*(1+x-x^2)/(1-2*x-4*x^2+x^3+x^4)).series(x, 30).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Aug 05 2019