OFFSET
0,6
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..2500
Index entries for linear recurrences with constant coefficients, signature (2,-3,1).
FORMULA
EXAMPLE
G.f. = 1 - x^2 - x^3 + x^4 + 4*x^5 + 4*x^6 - 3*x^7 - 14*x^8 - 15*x^9 + ...
MATHEMATICA
CoefficientList[Series[(1-2*x+2*x^2)/(1-2*x+3*x^2-x^3), {x, 0, 50}], x] (* or *) LinearRecurrence[{2, -3, 1}, {1, 0, -1}, 50] (* G. C. Greubel, Aug 08 2018 *)
PROG
(PARI) {a(n) = if( n<0, polcoeff( (1 - x) / (1 - 3*x + 2*x^2 - x^3) + x * O(x^-n), -n), polcoeff( (1 - 2*x + 2*x^2) / (1 - 2*x + 3*x^2 - x^3) + x * O(x^n), n))}
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1-2*x+2*x^2)/(1-2*x+3*x^2-x^3))); // G. C. Greubel, Aug 08 2018
CROSSREFS
KEYWORD
sign
AUTHOR
Michael Somos, Dec 14 2013
STATUS
approved