OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,1,-2)
FORMULA
G.f.: (1-2*x)^2/(1-x^2+2*x^3).
a(n) = (-1)^n*A052947(n+4). - R. J. Mathar, Jun 24 2024
MATHEMATICA
LinearRecurrence[{0, 1, -2}, {1, -4, 5}, 100] (* G. C. Greubel, Jun 13 2016 *)
CoefficientList[Series[(1-4x+4x^2)/(1-x^2+2x^3), {x, 0, 40}], x] (* Harvey P. Dale, Nov 08 2022 *)
PROG
(PARI) x='x+O('x^40); Vec((1-4*x+4*x^2)/(1-x^2+2*x^3)) \\ G. C. Greubel, Jun 27 2018
(Magma) I:=[1, -4, 5]; [n le 3 select I[n] else Self(n-2) - 2*Self(n-3): n in [1..40]]; // G. C. Greubel, Jun 27 2018
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Nov 03 2009
STATUS
approved