|
|
A213398
|
|
Number of (w,x,y) with all terms in {0,...,n} and min(|w-x|,|x-y|) = x.
|
|
3
|
|
|
1, 4, 10, 17, 27, 38, 52, 67, 85, 104, 126, 149, 175, 202, 232, 263, 297, 332, 370, 409, 451, 494, 540, 587, 637, 688, 742, 797, 855, 914, 976, 1039, 1105, 1172, 1242, 1313, 1387, 1462, 1540, 1619, 1701, 1784, 1870, 1957, 2047, 2138, 2232, 2327
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
For a guide to related sequences, see A212959.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
G.f.: (1 + 2*x + 2*x^2 - x^3)/((1 - x)^3*(1 + x)).
E.g.f.: (1 + e^(2*x) * (3 + 14*x + 4*x^2))/(4 * e^x).
a(n) = (4*n^2 + 10*n + (-1)^n + 3)/4.
(End)
|
|
MATHEMATICA
|
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[x == Min[Abs[w - x], Abs[x - y]], s = s + 1],
{w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
Map[t[#] &, Range[0, 60]] (* A213398 *)
LinearRecurrence[{2, 0, -2, 1}, {1, 4, 10, 17}, 50] (* Harvey P. Dale, Aug 05 2019 *)
|
|
PROG
|
(PARI) first(n) = Vec((1 + 2*x + 2*x^2 - x^3)/((1 - x)^3*(1 + x)) + O(x^n)) \\ Iain Fox, Feb 01 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|