OFFSET
0,3
COMMENTS
For a guide to related sequences, see A211795.
LINKS
Index entries for linear recurrences with constant coefficients, signature (3, -2, -2, 3, -1).
FORMULA
a(n) = 3*a(n-1)-3*a(n-2)+2*a(n-3)-3*a(n-4)+3*a(n-5)-a(n-6).
G.f.: x*(1+x+3*x^2)/((1+x)*(1-x)^4). [Bruno Berselli, May 30 2012]
a(n) = (2*n*(10*n^2+3*n+2)-9(-1)^n+9)/48. [Bruno Berselli, May 30 2012]
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[2 w == x + y + z - n, s = s + 1],
{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
Map[t[#] &, Range[0, 60]] (* A212246 *)
FindLinearRecurrence[%]
(* Peter J. C. Moses, Apr 13 2012 *)
LinearRecurrence[{3, -2, -2, 3, -1}, {0, 1, 4, 13, 29}, 42] (* Ray Chandler, Aug 02 2015 *)
CoefficientList[Series[x (1+x+3x^2)/((1+x)(1-x)^4), {x, 0, 50}], x] (* Harvey P. Dale, Jul 06 2021 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 09 2012
STATUS
approved