A213496 Number of (w,x,y) with all terms in {0,...,n} and x != max(|w-x|,|x-y|).
0, 4, 13, 41, 82, 158, 255, 403, 580, 824, 1105, 1469, 1878, 2386, 2947, 3623, 4360, 5228, 6165, 7249, 8410, 9734, 11143, 12731, 14412, 16288, 18265, 20453, 22750, 25274, 27915, 30799, 33808, 37076, 40477, 44153, 47970, 52078, 56335
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
Programs
-
Mathematica
t = Compile[{{n, _Integer}}, Module[{s = 0}, (Do[If[x != Max[Abs[w - x], Abs[x - y]], s = s + 1], {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]]; m = Map[t[#] &, Range[0, 60]] (* A213496 *)
Formula
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6).
G.f.: (4*x + 5*x^2 + 11*x^3 + 3*x^4 + x^5)/((1 - x)^4 (1 + x)^2).
From Ayoub Saber Rguez, Nov 20 2021: (Start)
a(n) = (n+1)^3 - A213399(n).
a(n) = (2*n^3 + 2*n^2 + 3*n + 1 - (2+n+1)*((n+1) mod 2))/2. (End)
Comments