A220753 Expansion of (1+4*x+5*x^2-x^3)/((1-x)*(1+x)*(1-2*x^2)).
1, 4, 8, 11, 22, 25, 50, 53, 106, 109, 218, 221, 442, 445, 890, 893, 1786, 1789, 3578, 3581, 7162, 7165, 14330, 14333, 28666, 28669, 57338, 57341, 114682, 114685, 229370, 229373, 458746, 458749, 917498, 917501, 1835002, 1835005, 3670010, 3670013
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,3,0,-2).
Programs
-
Magma
m:=41; R
:=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 -
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 *)
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).