A257076 Expansion of (1 - x^3) / (1 - x + x^2) in powers of x.
1, 1, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0, 2, 2, 0, -2, -2, 0
Offset: 0
Examples
G.f. = 1 + x - 2*x^3 - 2*x^4 + 2*x^6 + 2*x^7 - 2*x^9 - 2*x^10 + 2*x^12 + ...
Links
- G. C. Greubel, Table of n, a(n) for n = 0..2500
- Index entries for linear recurrences with constant coefficients, signature (1, -1).
Programs
-
Magma
m:=50; R
:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 - x^3)/(1-x+x^2))); // G. C. Greubel, Aug 03 2018 -
Mathematica
a[ n_] := SeriesCoefficient[ (1 - x^3) / (1 - x + x^2), {x, 0, n}]; Join[{1, 1},LinearRecurrence[{1, -1},{0, -2},76]] (* Ray Chandler, Aug 10 2015 *)
-
PARI
{a(n) = n++; if( n<3, n>0, 2 * (n%3>0) * (-1)^(n\3))};
-
PARI
{a(n) = if( n<0, 0, polcoeff( (1 - x^3) / (1 - x + x^2) + x * O(x^n), n))};
Formula
Euler transform of length 6 sequence [ 1, -1, -2, 0, 0, 1].
G.f.: (1 - x^2) * (1 - x^3)^2 / ((1 - x) * (1 - x^6)).
a(n) = -a(n+3) if n>1.
a(n) = A109265(n-1) if n>0.
Convolution inverse of A257075.
a(n) = A130772(n) for n>1. - R. J. Mathar, Apr 19 2015
a(n) = A184334(n+1) if n>1. - Michael Somos, Sep 01 2015