OFFSET
0,2
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,3,0,-2).
FORMULA
G.f.: (1+4*x+5*x^2-x^3)/((1-x)*(1+x)*(1-2*x^2)).
a(n) = a(n-1)*2 if n even.
a(n) = a(n-1)+3 if n odd.
a(n) = 3*a(n-2) - 2*a(n-4) with a(0)=1, a(1)=4, a(2)=8, a(3)=11.
a(n) = 7*2^floor(n/2) - (3/2)*(3+(-1)^n).
MATHEMATICA
Table[7 2^Floor[n/2] - (3/2) (3 + (-1)^n), {n, 0, 40}] (* Bruno Berselli, Apr 13 2013 *)
LinearRecurrence[{0, 3, 0, -2}, {1, 4, 8, 11}, 40] (* T. D. Noe, Apr 17 2013 *)
PROG
(Magma) m:=41; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1+4*x+5*x^2-x^3)/((1-x)*(1+x)*(1-2*x^2)))); // Bruno Berselli, Apr 13 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Philippe Deléham, Apr 13 2013
STATUS
approved