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.

A098554 G.f.: x*(1-x^2)/((1+x^2)*(1+x+x^2)).

Original entry on oeis.org

0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2, -1, 1, 0, 1, -1, -2, 3, 1, -4, 1, 3, -2
Offset: 0

Views

Author

N. J. A. Sloane, Oct 26 2004

Keywords

Programs

  • Magma
    I:=[0,1,-1,-2]; [n le 4 select I[n] else -Self(n-1) - 2*Self(n-2) -Self(n-3) - Self(n-4): n in [1..30]]; // G. C. Greubel, Jan 17 2018
  • Mathematica
    CoefficientList[Series[x*(1-x^2)/((1+x^2)*(1+x+x^2)),{x,0,110}],x] (* or *) LinearRecurrence[{-1,-2,-1,-1},{0,1,-1,-2},110] (* Harvey P. Dale, Jan 16 2016 *)
  • PARI
    x='x+O('x^30); concat([0], Vec(x*(1-x^2)/((1+x^2)*(1+x+x^2)))) \\ G. C. Greubel, Jan 17 2018
    

Formula

Let b(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*(0^(n-2k)-(-1)^(n-2k)). Then a(n) = b(n) - b(n-2), or a(n) = Sum_{j=0..n} b(n-j)*(binomial(1, j/2)*(-1)^(j/2)*(1+(-1)^j)/2). The g.f. is obtained from the g.f. x/(1+x) of 0^n-(-1)^n by applying the transformation G(x)->((1-x^2)/(1+x^2))G(x/(1+x^2)). - Paul Barry, Oct 26 2004
a(n) = (-1)^n*(A112553(n-1) - A112553(n-3)). - R. J. Mathar, Sep 27 2014
a(0)=0, a(1)=1, a(2)=-1, a(3)=-2, a(n) = a(n-1) - 2*a(n-2) - a(n-3) - a(n-4). - Harvey P. Dale, Jan 16 2016