|
|
A213388
|
|
Number of (w,x,y) with all terms in {0,...,n} and 2|w-x| >= max(w,x,y)-min(w,x,y).
|
|
2
|
|
|
1, 6, 21, 48, 93, 158, 249, 368, 521, 710, 941, 1216, 1541, 1918, 2353, 2848, 3409, 4038, 4741, 5520, 6381, 7326, 8361, 9488, 10713, 12038, 13469, 15008, 16661, 18430, 20321, 22336, 24481, 26758, 29173, 31728, 34429, 37278, 40281, 43440, 46761, 50246, 53901
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
For a guide to related sequences, see A212959.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5).
G.f.: ((1 + 3*x + 5*x^2 + x^3)/((1 - x)^4*(1 + x))).
a(n) = (8*n^3+30*n^2+28*n+3*((-1)^n+3))/12.
a(n) = (4*n^3+15*n^2+14*n+6)/6 for n even.
a(n) = (4*n^3+15*n^2+14*n+3)/6 for n odd.
(End)
|
|
MATHEMATICA
|
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[Max[w, x, y] - Min[w, x, y] <= 2 Abs[w - x], s = s + 1], {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
m = Map[t[#] &, Range[0, 45]] (* A213388 *)
|
|
PROG
|
(PARI) Vec((1+3*x+5*x^2-x^3)/((1-x)^4*(1+x)) + O(x^100)) \\ Colin Barker, Jan 28 2016
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|