OFFSET
1,2
FORMULA
a(n)= 2*a(n-1) -2*a(n-3) +a(n-4).
G.f.: -x*(1+x+5*x^2+2*x^3)/((1+x)*(x-1)^3).
MATHEMATICA
M := {{0, 1}, {-1, 2} }
v[1] = {1, 3}
w[n_] = If[Mod[n, 2] == 1, {0, 3}, {0, 6}]
v[n_] := v[n] = M.v[n - 1] + w[n]
Table[v[n][[1]], {n, 1, 30}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Sep 07 2006
EXTENSIONS
Definition replaced by polynomial - The Assoc. Editors of the OEIS, Oct 14 2009
STATUS
approved