OFFSET
1,2
COMMENTS
Also sum or difference of two coprime cubes. - David A. Corneth, Oct 20 2017
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000 (first 101 terms from Rosalie Fay)
EXAMPLE
19 = 3^3 + (-2)^3, where 3 and -2 are coprime, so 19 is in the sequence.
152 = 5^3 + 3^3, where 5 and 3 are coprime, so 152 is in the sequence.
MAPLE
filter:= proc(n) local s, x, y;
for s in numtheory:-divisors(n) do
x:= s/2 + sqrt(12*n/s-3*s^2)/6;
if not x::integer then next fi;
y:= s - x;
if igcd(x, y) = 1 then return true fi;
od;
false
end proc:
select(filter, [seq(seq(9*i+j, j=[1, 2, 7, 8, 9]), i=0..1000)]); # Robert Israel, Oct 22 2017
MATHEMATICA
smax = 100000; (* upper limit for last term *)
m0 = smax^(1/3) // Ceiling;
f[m_] := f[m] = Module[{c, s, d}, Table[c = CoprimeQ[i^3, j^3]; {s = i^3 + j^3; If[0 < s <= smax && c, s, Nothing], d = j^3 - i^3; If[0 < d <= smax && c, d, Nothing]}, {i, 0, m}, {j, i, m}] // Flatten // Union];
f[m = m0];
f[m += m0];
While[f[m] != f[m - m0], m += m0];
f[m] (* Jean-François Alcover, Jun 28 2023 *)
PROG
(PARI) upto(lim) = {my(res = List([2]), c, i, j); for(i=1, sqrtnint(lim, 3), for(j=0, sqrtnint(lim - i^3, 3), if(gcd(i, j) == 1, listput(res, c)))); for(i=1, sqrtint(lim\3)+1, for(j = 1, i, if(gcd(i, j) == 1, c = i^3 - (i-j)^3; if(c<=lim, listput(res, c), next(2))))); listsort(res, 1); res} \\ David A. Corneth, Oct 20 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Rosalie Fay, Oct 16 2017
STATUS
approved