OFFSET
0,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,-4,4).
FORMULA
EXAMPLE
G.f. = 1 + 3*x + 10*x^2 + 32*x^3 + 100*x^4 + 312*x^5 + 976*x^6 + 3056*x^7 + ...
MATHEMATICA
CoefficientList[Series[(1-x+2*x^2)/(1-4*x+4*x^2-4*x^3), {x, 0, 60}], x] (* G. C. Greubel, Aug 04 2018 *)
PROG
(PARI) {a(n) = if( n<0, polcoeff( (2*x - x^2 + x^3) / (4 - 4*x + 4*x^2 - x^3) + x * O(x^-n), -n), polcoeff( (1 - x + 2*x^2) / (1 - 4*x + 4*x^2 - 4*x^3) + x * O(x^n), n))};
(Haskell)
a247595 n = a247595_list !! n
a247595_list = 1 : 3 : 10 : map (* 4) (zipWith3 (((+) .) . (-))
(drop 2 a247595_list) (tail a247595_list) a247595_list)
-- Reinhard Zumkeller, Sep 21 2014
(Magma) m:=60; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 - x +2*x^2)/(1-4*x+4*x^2-4*x^3))); // G. C. Greubel, Aug 04 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Somos, Sep 20 2014
STATUS
approved