OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-2).
FORMULA
a(n) = (0^n + (-2)^n)/2, for n > 1, with a(1) = 0.
abs(a(n)) = A034008(n).
From Colin Barker, Jan 06 2013: (Start)
a(n) = (-1)^n * 2^(n-1) for n > 1.
a(n) = -2*a(n-1) for n > 2.
G.f.: (1 +2*x +2*x^2) / (1+2*x). (End)
E.g.f.: (1 + 2*x + exp(-2*x))/2. - Alejandro J. Becerra Jr., Jan 29 2021
MATHEMATICA
Join[{1, 0}, NestList[-2#&, 2, 40]] (* Harvey P. Dale, Dec 28 2015 *)
PROG
(Magma) [n le 1 select 1-n else (0^n + (-2)^n)/2: n in [0..40]]; // G. C. Greubel, Mar 18 2023
(SageMath) [(0^n + (-2)^n)/2 + int(n==1) for n in range(41)] # G. C. Greubel, Mar 18 2023
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Paul Barry, Jun 05 2003
STATUS
approved