OFFSET
0,2
COMMENTS
First differences of A077980.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (-1,-2,-2)
FORMULA
a(n) = (1/3) * ((-3+5*(-1)^n)/2 * (-2)^floor(n/2) + 2*(-1)^n ). - Ralf Stephan, Aug 17 2013
a(0)=1, a(1)=-2, a(2)=0, a(n)=-a(n-1)-2*a(n-2)-2*a(n-3). - Harvey P. Dale, Mar 26 2015
MATHEMATICA
CoefficientList[Series[(1 - x) / (1 + x + 2 x^2 + 2 x^3), {x, 0, 50}], x] (* Vincenzo Librandi, Aug 17 2013 *)
LinearRecurrence[{-1, -2, -2}, {1, -2, 0}, 50] (* Harvey P. Dale, Mar 26 2015 *)
PROG
(PARI) a(n)=1/3*((-3+5*(-1)^n)/2*(-2)^floor(n/2)+2*(-1)^n); \\ Ralf Stephan, Aug 17 2013
(Magma) I:=[1, -2, 0]; [n le 3 select I[n] else -Self(n-1)-2*Self(n-2) -2*Self(n-3): n in [1..50]]; // Vincenzo Librandi, Aug 17 2013
CROSSREFS
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Nov 17 2002
STATUS
approved