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.

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

Original entry on oeis.org

1, 0, -2, -1, 3, 3, -4, -7, 4, 14, -1, -25, -9, 40, 33, -56, -82, 63, 171, -37, -316, -71, 524, 350, -769, -945, 943, 2064, -767, -3952, -354, 6783, 3539, -10381, -10676, 13625, 24596, -13330, -48897, 2359, 86823, 33208, -138079, -117672, 191694, 288959, -212101, -598325, 114836, 1099385, 271388
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

With 1 prepended, and up to sign this is the q-deformation of 12/5. See Leclere and Morier-Genoud. - Michel Marcus, Jul 01 2021

Examples

			G.f. = 1 - 2*x^2 - x^3 + 3*x^4 + 3*x^5 - 4*x^6 - 7*x^7 + 4*x^8 + ...
		

Crossrefs

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
    CoefficientList[Series[(1-x)/(1-x+2x^2-x^3),{x,0,50}],x] (* or *) LinearRecurrence[{1,-2,1},{1,0,-2},51] (* Harvey P. Dale, Feb 18 2013 *)
  • PARI
    {a(n) = if( n<0, polcoeff( (1 - 2*x) / (1 - 2*x + x^2 - x^3) + x * O(x^-n), -n), polcoeff( (1 - x) / (1 - x + 2*x^2 - x^3) + x * O(x^n), n))} /* Michael Somos, Sep 18 2012 */
    
  • 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) = a(n-1) - 2*a(n-2) + a(n-3). - Michael Somos, Sep 18 2012
a(n) = -A000931(-2*n - 1). - Michael Somos, Sep 18 2012
G.f.: (1+x)/x^3 - 1/( Q(0) - x )/x^3 where Q(k) = 1 - x^2/(x^2*k - 1 )/Q(k+1) ; (recursively defined continued fraction). - Sergei N. Gladkovskii, Feb 23 2013
a(n) = (-1)^(n-1)*(A077979(n) + A077979(n-1)) = A077954(n) - A077954(n-1). - G. C. Greubel, Jun 29 2019