OFFSET
0,4
COMMENTS
Also, the number of (w,x,y,z) with all terms in {1,...,n} and 3w=x+y+z-n-2.
For a guide to related sequences, see A211795.
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).
From Benedict W. J. Irwin, Sep 05 2016: (Start)
a(n)=2/9-n/2-n^2/3+5*n^3/18-2/9*cos(2*n*Pi/3)+4*sin(2*n*Pi/3)/(9*sqrt(3)).
G.f.: x^3*(3+2*x)/((x-1)^4*(1+x+x^2)).
(End)
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[3 w == x + y + z + n + 2, s = s + 1],
{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
Map[t[#] &, Range[0, 40]] (* A212252 *)
(* Peter J. C. Moses, Apr 13 2012 *)
Table[2/9-n/2-n^2/3+5n^3/18-2/9Cos[2 n Pi/3] + 4Sin[2 n Pi/3]/9/Sqrt[3], {n, 0, 20}] (* Benedict W. J. Irwin, Sep 05 2016 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 15 2012
STATUS
approved