%I #8 Feb 04 2024 18:34:33
%S 30,179,538,1077,1526,1255,-846,-6487,8183,2002,-12219,22461,5480,
%T 16789,-27072,-12,-68113,7666,-35474,124726,20955,36343,106424,-86567,
%U -165349,-8568,175360,100781,185468,-68663,-228351,427329,-384,-407276,-18323,-388286,125586,369093,294425,-892706
%N 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.
%C We must impose y < n to exclude the trivial solution x = 1, y = n, a(n) = -1.
%C There is no admissible pair (x, y) for n = 1, whence a(1) is undefined.
%C 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?
%e For n = 2, the only admissible pair is (x, y) = (1, 1), which yields a(2) = n^5 - x^5 - y^5 = 30.
%e 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.
%e 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.
%o (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
%Y Cf. A135998 (equivalent for 3rd powers), A308834 (4th powers).
%K sign
%O 2,1
%A _M. F. Hasler_, Feb 03 2024