A135998 Smallest error in trying to solve n^3 = x^3 + y^3. That is, for each n, find positive integers x <= y < n such that | n^3 - x^3 - y^3 | is minimal and let a(n) := n^3 - x^3 - y^3.
6, 11, 10, -3, 27, 2, 44, 1, -24, -12, -1, -43, 16, -81, -8, -28, 8, 19, -29, 54, 56, 71, -8, 64, 69, 27, 72, -46, -133, 47, -64, 161, -8, 79, -27, -99, -57, -263, -133, 8, 254, -62, -155, 109, -15, -56, -64, 2, 259, 107, -17, 269, 216, -78, -20, 316, 164, -28, -27, 333, 181, 47, -70, 6, 704, 63, -64, 253, 343, -389, -216
Offset: 2
Keywords
Examples
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)
Links
- Daniel Bernstein, Representations using three cubes.
Crossrefs
Cf. A308834 (equivalent for 4th powers).
Programs
-
Mathematica
a[n_] := SortBy[n^3-Flatten[Table[x^3+y^3, {x, n-1}, {y, x}]], Abs][[1]]; Table[a[n], {n, 2, 72}] (* Jean-François Alcover, Jul 05 2019, after Giovanni Resta in A308834 *)
-
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
Comments