OFFSET
0,3
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2, -4, 4).
FORMULA
G.f.: (x-4*x^2)/(1-2*x+4*x^2-4*x^3).
MATHEMATICA
LinearRecurrence[{2, -4, 4}, {0, 1, -2}, 40] (* Harvey P. Dale, Dec 01 2024 *)
PROG
(Haskell)
a035302 n = a035302_list !! (n-1)
a035302_list = 0 : 1 : (-2) :
zipWith (+) (drop 2 $ map (* 2) a035302_list)
(map (* 4) $ zipWith (-) a035302_list $ tail a035302_list)
-- Reinhard Zumkeller, Mar 18 2012
(PARI) a(n)=([0, 1, 0; 0, 0, 1; 4, -4, 2]^n*[0; 1; -2])[1, 1] \\ Charles R Greathouse IV, May 29 2026
CROSSREFS
KEYWORD
sign,easy
AUTHOR
STATUS
approved
