%I #21 Aug 05 2019 11:10:22
%S 1,4,10,17,27,38,52,67,85,104,126,149,175,202,232,263,297,332,370,409,
%T 451,494,540,587,637,688,742,797,855,914,976,1039,1105,1172,1242,1313,
%U 1387,1462,1540,1619,1701,1784,1870,1957,2047,2138,2232,2327
%N Number of (w,x,y) with all terms in {0,...,n} and min(|w-x|,|x-y|) = x.
%C For a guide to related sequences, see A212959.
%H Iain Fox, <a href="/A213398/b213398.txt">Table of n, a(n) for n = 0..10000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,0,-2,1).
%F a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
%F G.f.: (1 + 2*x + 2*x^2 - x^3)/((1 - x)^3*(1 + x)).
%F a(n) = (n+1)^2 + floor(n/2). [_Wesley Ivan Hurt_, Jul 15 2013]
%F From _Iain Fox_, Feb 01 2018: (Start)
%F E.g.f.: (1 + e^(2*x) * (3 + 14*x + 4*x^2))/(4 * e^x).
%F a(n) = (4*n^2 + 10*n + (-1)^n + 3)/4.
%F (End)
%t t = Compile[{{n, _Integer}}, Module[{s = 0},
%t (Do[If[x == Min[Abs[w - x], Abs[x - y]], s = s + 1],
%t {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
%t Map[t[#] &, Range[0, 60]] (* A213398 *)
%t LinearRecurrence[{2,0,-2,1},{1,4,10,17},50] (* _Harvey P. Dale_, Aug 05 2019 *)
%o (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
%Y Cf. A212959.
%K nonn,easy
%O 0,2
%A _Clark Kimberling_, Jun 12 2012