OFFSET
0,5
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,-1,-1).
FORMULA
a(0)=1, a(1)=-1, a(2)=-1, a(n) = -a(n-2) - a(n-3). - Harvey P. Dale, Sep 14 2012
a(n) = (-1)^n * A097333(-2-n) for all n in Z. - Michael Somos, Nov 02 2021
EXAMPLE
G.f. = 1 - x - x^2 + 2*x^4 + x^5 - 2*x^6 - 3*x^7 + x^8 + 5*x^9 + ... - Michael Somos, Nov 02 2021
MAPLE
seq(coeff(series((1-x)/(1+x^2+x^3), x, n+1), x, n), n = 0..60); # G. C. Greubel, Aug 05 2019
MATHEMATICA
CoefficientList[Series[(1-x)/(1+x^2+x^3), {x, 0, 60}], x] (* or *) LinearRecurrence[{0, -1, -1}, {1, -1, -1}, 60] (* Harvey P. Dale, Sep 14 2012 *)
a[ n_] := If[n >= 0, SeriesCoefficient[(1 - x)/(1 + x^2 + x^3), {x, 0, n}], SeriesCoefficient[(x^2 - 1)/(1 + x + x^3), {x, 0, 1 - n}]]; (* Michael Somos, Nov 02 2021 *)
PROG
(PARI) my(x='x+O('x^60)); Vec((1-x)/(1+x^2+x^3)) \\ G. C. Greubel, Aug 05 2019
(PARI) {a(n) = if(n>=0, polcoeff( (1 - x)/(1 + x^2 + x^3) + x*O(x^n), n), polcoeff( (x^2 - 1)/(1 + x + x^3) + x*O(x^(1-n)), 1-n))}; /* Michael Somos, Nov 02 2021 */
(Magma) R<x>:=PowerSeriesRing(Integers(), 60); Coefficients(R!( (1-x)/(1+x^2+x^3) )); // G. C. Greubel, Aug 05 2019
(Sage) ((1-x)/(1+x^2+x^3)).series(x, 60).coefficients(x, sparse=False) # G. C. Greubel, Aug 05 2019
(GAP) a:=[1, -1, -1];; for n in [4..60] do a[n]:=-a[n-2]-a[n-3]; od; a; # G. C. Greubel, Aug 05 2019
CROSSREFS
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved