cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

Moshe Shmuel Newman, Mar 03 2008

Keywords

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

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)
		

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