login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A230314
Numbers that are simultaneously the sum of two nonnegative squares and the sum of two nonnegative cubes.
2
0, 1, 2, 8, 9, 16, 64, 65, 72, 125, 128, 250, 370, 468, 512, 520, 576, 637, 729, 730, 793, 1000, 1024, 1125, 1241, 1332, 1458, 1853, 2000, 2197, 2205, 2745, 2960, 3528, 3744, 3925, 4096, 4097, 4160, 4394, 4608, 4706, 4825, 4913, 4941, 5096, 5256, 5832, 5840
OFFSET
1,3
LINKS
EXAMPLE
72 is in the sequence because 6^2 + 6^2 = 4^3 + 2^3 = 72.
73 is not in the sequence, because, although it can be expressed as the sum of two squares (8^2 + 3^2), it can't be expressed as the sum of two cubes.
MAPLE
s_sq0:=proc(n) local i, f; f:=false:
for i from 0 while 2*i^2<=n do
if type(sqrt(n-i^2), nonnegint) then f:=true:break fi od;
f end;
s_cb0:=proc(n) local i, f; f:=false:
for i from 0 while 2*i^3<=n do
if type(surd(n-i^3, 3), nonnegint) then f:=true:break fi od;
f end;
for n from 0 do if s_sq0(n) and s_cb0(n)then print(n) fi od:
MATHEMATICA
n2 = 80; n3 = Ceiling[n2^(2/3)]; t2 = Flatten[Table[a^2 + b^2, {a, 0, n2}, {b, a, n2}]]; t3 = Flatten[Table[a^3 + b^3, {a, 0, n3}, {b, a, n3}]]; Intersection[Union[Select[t2, # <= n2^2 &]], Union[Select[t3, # <= n3^3 &]]] (* T. D. Noe, Oct 18 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Letsko, Oct 15 2013
STATUS
approved