login
Number of (w,x,y) with all terms in {0,...,n} and x != max(|w-x|,|x-y|)
2

%I #17 Nov 22 2021 06:07:25

%S 0,4,13,41,82,158,255,403,580,824,1105,1469,1878,2386,2947,3623,4360,

%T 5228,6165,7249,8410,9734,11143,12731,14412,16288,18265,20453,22750,

%U 25274,27915,30799,33808,37076,40477,44153,47970,52078,56335

%N Number of (w,x,y) with all terms in {0,...,n} and x != max(|w-x|,|x-y|)

%C For a guide to related sequences, see A212959.

%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-4,1,2,-1).

%F a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6).

%F G.f.: (4*x + 5*x^2 + 11*x^3 + 3*x^4 + x^5)/((1 - x)^4 (1 + x)^2).

%F From _Ayoub Saber Rguez_, Nov 20 2021: (Start)

%F a(n) = (n+1)^3 - A213399(n).

%F a(n) = (2*n^3 + 2*n^2 + 3*n + 1 - (2+n+1)*((n+1) mod 2))/2. (End)

%t t = Compile[{{n, _Integer}}, Module[{s = 0},

%t (Do[If[x != Max[Abs[w - x], Abs[x - y]], s = s + 1],

%t {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];

%t m = Map[t[#] &, Range[0, 60]] (* A213496 *)

%Y Cf. A212959, A213399.

%K nonn,easy

%O 0,2

%A _Clark Kimberling_, Jun 14 2012