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.

Showing 1-3 of 3 results.

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

A369855 a(n) is the smallest error in trying to solve n^5 = x^5 + y^5: for each n from 2 on, find positive integers x and y, x <= y < n such that |n^5 - x^5 - y^5| is minimal and let a(n) = n^5 - x^5 - y^5. In case of a tie, choose the solution with smallest y.

Original entry on oeis.org

30, 179, 538, 1077, 1526, 1255, -846, -6487, 8183, 2002, -12219, 22461, 5480, 16789, -27072, -12, -68113, 7666, -35474, 124726, 20955, 36343, 106424, -86567, -165349, -8568, 175360, 100781, 185468, -68663, -228351, 427329, -384, -407276, -18323, -388286, 125586, 369093, 294425, -892706
Offset: 2

Views

Author

M. F. Hasler, Feb 03 2024

Keywords

Comments

We must impose y < n to exclude the trivial solution x = 1, y = n, a(n) = -1.
There is no admissible pair (x, y) for n = 1, whence a(1) is undefined.
What is the first n for which we have two solutions (x, y) that yield the same minimal absolute difference but opposite signs for n^5 - x^5 - y^5?

Examples

			For n = 2, the only admissible pair is (x, y) = (1, 1), which yields a(2) = n^5 - x^5 - y^5 = 30.
Similarly, for n = 3, 4, ..., 9 the minimum is reached for x = y = n - 1, which yields a(n) = n^5 - 2*(n-1)^5 = 179, 538, 1077, 1526, 1255, -846 and -6487, respectively.
For n = 10, the minimum is reached for x = 8, y = 9, which yields a(10) = 10^5 - 8^5 - 9^5 = 8183, smaller in absolute value than 10^5 - 2*9^5 = -18098.
		

Crossrefs

Cf. A135998 (equivalent for 3rd powers), A308834 (4th powers).

Programs

  • PARI
    A369855(n, p=5) = { 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

A369862 a(n) is the smallest error in trying to solve n^2 = x^2 + y^2: given n >= 2, find positive integers x <= y < n such that |n^2 - x^2 - y^2| is minimal and let a(n) = n^2 - x^2 - y^2. In case of a tie, choose the value with the smallest y.

Original entry on oeis.org

2, 1, -2, 0, 2, -1, -1, 1, 0, -4, -1, 0, 2, 0, -4, 0, -1, 1, 0, -1, -1, -1, -2, 0, 0, -1, -1, 0, 0, -1, -1, 1, 0, 0, -4, 0, -1, 0, 0, 0, -1, -1, -1, 0, -1, -1, -1, -3, 0, 0, 0, 0, -4, 0, 3, -1, 0, -4, 0, 0, -1, -1, -1, 0, 4, -1, 0, -4, 0, -3, -1, 0, 0, 0, -1, -1, 0, -4, 0, 1, 0, -1, -2, 0, -1, 0, -1, 0, 0, 0, -1, -1, 3, 0, -1, 0, -1, 1
Offset: 2

Views

Author

M. F. Hasler, Feb 03 2024

Keywords

Comments

We impose y < n to exclude the trivial solution x = 1, y = n, a(n) = -1.
Then there is no admissible pair (x, y) for n = 1, whence a(1) is undefined.

Examples

			For n = 2, the largest possible x = y = 1 give the minimal n^2 - x^2 - y^2 = 4 - 2 * 1^2 = 2 = a(2).
Similarly, for n = 3 and n = 4, the largest possible x = y = n - 1 give the minimal a(n) = n^2 - 2*(n-1)^2, a(3) = 9 - 2*4 = 1 and a(4) = 16 - 2*9 = -2.
For n = 5 which is a hypotenuse number (<=> has a prime factor of the form 4k+1), we have a(5) = 5^2 - 3^2 - 4^2 = 0.
		

Crossrefs

Cf. A135998 (equivalent for 3rd powers), A308834 (4th powers), A369855 (5th powers).
Cf. A009003.

Programs

  • PARI
    A369862(n, p=2) = { 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) && !(m=d) && break); m} \\ Not optimized: one could immediately return 0 when a solution of x^2 + y^2 = n^2 is known to exist, and similarly with n^2 +- k for small k.

Formula

a(n) = 0 for Hypotenuse numbers, n in A009003.
Showing 1-3 of 3 results.