OFFSET
1,1
LINKS
Index entries for linear recurrences with constant coefficients, signature (3,-2,-1,1).
FORMULA
a(n) = 3*a(n-1)-2*a(n-2)-a(n-3)+a(n-4). G.f.: x*(2-4*x^2-x^3)/((1-x)^2*(1-x-x^2)). [Colin Barker, Jun 10 2012]
MATHEMATICA
M = {{0, 1, 0, 0}, {1, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 3, 1}}; v[1] = {0, 1, 1, 0}; v[n_] := v[n] = M.v[n - 1] a = Table[Apply[Plus, v[n]], {n, 1, 50}]
Rest[CoefficientList[Series[x (2-4x^2-x^3)/((1-x)^2(1-x-x^2)), {x, 0, 40}], x]] (* or *) LinearRecurrence[{3, -2, -1, 1}, {2, 6, 10, 15}, 40] (* Harvey P. Dale, Jan 04 2013 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Jan 08 2008
EXTENSIONS
New name from Colin Barker and Joerg Arndt, Jun 10 2012
STATUS
approved