OFFSET
2,2
COMMENTS
Broughan calls this eta(n) and proves that it exists for all n.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 2..1000
Kevin A. Broughan, Characterizing the Sum of Two Cubes, J. Integer Seqs., Vol. 6, 2003.
FORMULA
a(n) <= 2n^2 + 6, a(a(n)) <= n.
EXAMPLE
4 is not the sum of two nonnegative cubes. 8 = 0^3 + 2^3, but 0 and 2 are not coprime. The least multiple of 4 that can be so represented is 28 = 1^3 + 3^3, so a(4) = 28/4.
PROG
(PARI) sumOfTwoCubes(n)=my(k1=ceil((n-1/2)^(1/3)), k2=floor((4*n+1/2)^(1/3)), L); fordiv(n, d, if(d>=k1 && d<=k2 && denominator(L=(d^2-n/d)/3)==1 && issquare(d^2-4*L), return(1))); 0
sumOfTwoRPCubes(n)=if(sumOfTwoCubes(n), if(vecmax(factor(n)[, 2])<3, 1, for(x=ceil((n\2)^(1/3)), (n+.5)^(1/3), if(gcd(n, x)==1&&ispower(n-x^3, 3), return(1))); 0), 0)
a(n)=forstep(k=n, 2*n*(n^2+3), n, if(sumOfTwoRPCubes(k), return(k/n)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Charles R Greathouse IV, Jun 12 2012
STATUS
approved