OFFSET
0,3
COMMENTS
For a guide to related sequences, see A211795.
LINKS
Giovanni Resta, Table of n, a(n) for n = 0..1000
FORMULA
a(n) + A212099(n) = n^4.
MAPLE
f:= proc(n) local x, y, z, r, t;
r:= 0:
for x from 1 to n do
for y from x to n do
for z from y to n do
t:= min(n, floor((x^3 + y^3 + z^3)^(1/3)));
if x = z then r:= r+t
elif x=y or y=z then r:= r+3*t
else r:= r+6*t
fi
od od od;
r
end proc:
map(f, [$0..40]); # Robert Israel, May 08 2017
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[w^3 <= x^3 + y^3 + z^3, s = s + 1],
{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
Map[t[#] &, Range[0, 40]] (* A212098 *)
(* Peter J. C. Moses, Apr 13 2012 *)
PROG
(PARI) A212098(n)={my(s=0, c=[6, 3, 1]); forvec(v=vector(4, i, if(i>1, [1, n], [-n, -1])), sum(i=1, 4, v[i]^3)>=0&s+=c[1+(v[2]==v[3])+(v[3]==v[4])], 1); s} /* not very efficient */ \\ M. F. Hasler, May 20 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, May 03 2012
STATUS
approved