OFFSET
2,1
COMMENTS
a(n) is never zero, by Fermat's last theorem for cubes. There are infinitely many n for which a(n) = 1, -1 and 2. It is not known if a(n) is ever 3, besides a(5). By congruence considerations, a(n) is never +-4 mod 9. Presumably a(n) is roughly of order n.
The current definition leaves an abiguity when there is (x,y) and (x',y') that yield the same minimal difference but with opposite sign, e.g., for n = 994 or n = 1700, see examples. The sign of a(n) is currently not well defined in that case. - M. F. Hasler, Feb 03 2024
LINKS
Daniel Bernstein, Representations using three cubes.
EXAMPLE
a(7) = 2 because 7^3 - 5^3 - 6^3 = 2 and this can't be improved,
a(12) = -1 because 12^3 - 9^3 - 10^3 = -1 and this can't be improved.
From M. F. Hasler, Feb 03 2024: (Start)
a(994) = +- 1503 because 994^3 - 718^3 - 849^3 = 1503, 994^3 - 496^3 - 951^3 = -1503, and there is no smaller difference in absolute value.
a(1700) = +- 3375 because 1700^3 - 1070^3 - 1545^3 = 3375, 1700^3 - 719^3 - 1656^3 = -3375, and these are minimal in absolute value. (End)
MATHEMATICA
a[n_] := SortBy[n^3-Flatten[Table[x^3+y^3, {x, n-1}, {y, x}]], Abs][[1]];
PROG
(PARI) A135998(n, p=3) = { my(np=n^p, m=np); for(y=max(sqrtnint(np\2, p), 1), n-1, my(x = sqrtnint(np - y^p, p), dy = np-y^p, d = if(dy-x^p > (x+1)^p-dy && x < n-1, dy-(x+1)^p, dy-x^p)); abs(d) < abs(m) && abs(m=d) < 2 && break); m} \\ M. F. Hasler, Feb 03 2024
CROSSREFS
KEYWORD
sign
AUTHOR
Moshe Shmuel Newman, Mar 03 2008
STATUS
approved