OFFSET
0,4
LINKS
Index entries for linear recurrences with constant coefficients, signature (-2,-1,-2).
FORMULA
G.f.: A(x) = (1+x)^2/(1+x^2)/(1+2*x).
From Paul Curtz, Oct 31 2018: (Start)
a(n) + a(n+2) = 1, -2, 4, -8, ... = A122803(n).
a(2n+2) = -2*a(2n+1) = 4*A015521(n). (End)
a(n) = -2a(n-1) - a(n-2) - 2a(n-3). - Charles R Greathouse IV, Nov 06 2018
MAPLE
seq(coeff(series((1+x)^2/(1+x^2)/(1+2*x), x, n+1), x, n), n = 0 .. 35); # Muniru A Asiru, Oct 31 2018
MATHEMATICA
Total /@ Table[SeriesCoefficient[(-1)^k/((1 + x^2) (1 + x)^(k - 1)), {x, 0, n - k}], {n, 0, 35}, {k, 0, n}] (* Michael De Vlieger, Oct 31 2018 *)
LinearRecurrence[{-2, -1, -2}, {1, 0, 0}, 40] (* Harvey P. Dale, Aug 31 2020 *)
PROG
(PARI) a(n)=polcoeff((1+x)^2/(1+x^2)/(1+2*x+x*O(x^n)), n, x)
(PARI) a(n)=([0, 1, 0; 0, 0, 1; -2, -1, -2]^n*[1; 0; 0])[1, 1] \\ Charles R Greathouse IV, Nov 06 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Paul D. Hanna, Apr 27 2006
STATUS
approved