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.

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

Original entry on oeis.org

1, -1, -1, -2, 0, -1, 2, -1, 3, -3, 4, -6, 7, -10, 13, -17, 23, -30, 40, -53, 70, -93, 123, -163, 216, -286, 379, -502, 665, -881, 1167, -1546, 2048, -2713, 3594, -4761, 6307, -8355, 11068, -14662, 19423, -25730, 34085, -45153, 59815, -79238, 104968, -139053, 184206, -244021, 323259, -428227, 567280
Offset: 0

Views

Author

Paul Barry, Jun 23 2005

Keywords

Comments

Diagonal sums of Riordan array (1-x-2x^2,x(1-x)), A109246.

Programs

  • Magma
    I:=[1,-1,-1,-2,0,-1]; [n le 6 select I[n] else Self(n-2)-Self(n-3): n in [1..60]]; // Vincenzo Librandi, Mar 12 2014
    
  • Mathematica
    a[0] = 1; a[1] = -1; a[2] = -1; a[n_] := a[n - 2] - a[n - 3]; Table[a[n], {n, 0, 50}] (* Wesley Ivan Hurt, Mar 06 2014 *)
    CoefficientList[Series[(1 - x - 2 x^2)/(1 - x^2 + x^3), {x, 0, 40}], x] (* Vincenzo Librandi. Mar 12 2014 *)
    LinearRecurrence[{0,1,-1},{1,-1,-1},60] (* Harvey P. Dale, Jun 03 2014 *)
  • PARI
    Vec((1-x-2*x^2)/(1-x^2+x^3) + O(x^50)) \\ Michel Marcus, Sep 17 2016

Formula

a(n) = a(n-2) - a(n-3), starting 1, -1, -1.
a(n) = (-1)^n * (A000931(n) - A000931(n-3) ), for n>2. - Ralf Stephan, Mar 10 2014