login
A212251
Number of (w,x,y,z) with all terms in {1,...,n} and 3w = x + y + z + n + 1.
3
0, 0, 1, 6, 15, 30, 54, 87, 131, 189, 261, 349, 456, 582, 729, 900, 1095, 1316, 1566, 1845, 2155, 2499, 2877, 3291, 3744, 4236, 4769, 5346, 5967, 6634, 7350, 8115, 8931, 9801, 10725, 11705, 12744, 13842, 15001, 16224, 17511, 18864, 20286, 21777, 23339, 24975
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.
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
Cf. A211795.
Sequence in context: A024802 A331073 A011886 * A262464 A353695 A232169
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 15 2012
STATUS
approved