OFFSET
0,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
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 + 7*x^2 + 9*x^3 + 3*x^4 + x^5)/((-1 + x)^4*(1 + x)^2).
a(n) = (2*n*(4*n^2+5*n+5) - (2*n+1)*(-1)^n + 1)/8.
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[w != Max[Abs[w - x], Abs[x - y], Abs[y - w]], s = s + 1], {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
m = Map[t[#] &, Range[0, 60]] (* A213498 *)
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {0, 4, 15, 43, 88, 164}, 50] (* Harvey P. Dale, Mar 27 2020 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 14 2012
STATUS
approved