OFFSET
0,4
COMMENTS
Also, the number of (w,x,y,z) with all terms in {1,...,n} and 3w = x + y + z - n - 1.
For a guide to related sequences, see A211795.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-3,2,-3,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^2*(1 + 3*x + x^3) / ((1 - x)^4*(1 + x + x^2)). - Colin Barker, Dec 02 2017
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[3 w == x + y + z + n + 1, s = s + 1],
{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
Map[t[#] &, Range[0, 40]] (* A212251 *)
(* Peter J. C. Moses, Apr 13 2012 *)
PROG
(PARI) concat(vector(2), Vec(x^2*(1 + 3*x + x^3) / ((1 - x)^4*(1 + x + x^2)) + O(x^40))) \\ Colin Barker, Dec 02 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 15 2012
STATUS
approved