OFFSET
0,2
COMMENTS
For a guide to related sequences, see A212959.
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,-1,2,-4,2,-1,2,-1).
FORMULA
a(n) + A213391(n) = (n+1)^3.
a(n) = 2*a(n-1) - a(n-2) + 2*a(n-3) - 4*a(n-4) + 2*a(n-5) - a(n-6) + 2*a(n-7) - a(n-8).
G.f.: -(-1 - 5*x - x^6 - 12*x^2 - 16*x^3 - 8*x^4 - 6*x^5 + x^7) / ((x^2 + x + 1)^2*(x-1)^4).
From Ayoub Saber Rguez, Feb 01 2022: (Start)
a(n) = (8*n^3 + 27*n^2 + 21*n + 6*n*(((n+1) mod 3) mod 2) + 7 + 2*((2*n+1) mod 3))/9. (End)
From Jon E. Schoenfield, Feb 02 2022: (Start)
a(n) = (8*n^3 + 27*n^2 + 27*n + 9)/9 if n == 0 (mod 3);
= (8*n^3 + 27*n^2 + 21*n + 7)/9 if n == 1 (mod 3);
= (8*n^3 + 27*n^2 + 21*n + 11)/9 if n == 2 (mod 3).
(End)
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[2*Max[w, x, y] >= 3*Min[w, x, y], s = s + 1],
{w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]];
m = Map[t[#] &, Range[0, 45]] (* A213391 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 11 2012
STATUS
approved