%I #22 Apr 08 2020 08:44:50
%S 2,1,2,13,1,3,7,1,2,1,3,15,1,6,11,11,1,1,2,1,2,2,7,3,1,1,3,5,1,2,7,1,
%T 2,1,2,5,1,4,3,1,1,2,2,7,1,2,7,3,5,1,2,1,1,2,11,21,5,1,3,5,1,3,3,3,1,
%U 2,2,1,4,2,3
%N Least positive integer x such that n + x^7 = y^2 + z^2 for some positive integers y and z, or 0 if no such x exists.
%C The general conjecture in A266277 implies that for each odd prime p and any integer m there are positive integers x, y and z such that m + x^p = y^2 + z^2.
%C For k = 4,6,8,... and any integer m == 6 (mod 8), there are no integers x, y and z with m + x^k = y^2 + z^2 since m + x^k with x an integer is congruent to 6 or 7 modulo 8.
%C As 2j+1 = (j+1)^2 - j^2, if m - z^k is odd with |m - z^k| > 1 then m + x^2 = y^2 + z^k for some positive integers x and y.
%H Zhi-Wei Sun and Chai Wah Wu, <a href="/A266314/b266314.txt">Table of n, a(n) for n = 0..10000</a> n = 0..2000 from Zhi-Wei Sun
%H Zhi-Wei Sun, <a href="http://maths.nju.edu.cn/~zwsun/179b.pdf">New conjectures on representations of integers (I)</a>, Nanjing Univ. J. Math. Biquarterly 34 (2017), no.2, 97-120. (Cf. Section 5.)
%e a(2) = 2 since 2 + 2^7 = 3^2 + 11^2.
%e a(3) = 13 since 3 + 13^7 = 554^2 + 7902^2.
%e a(5) = 3 since 5 + 3^7 = 16^2 + 44^2.
%e a(6) = 7 since 6 + 7^7 = 30^2 + 907^2.
%e a(462) = 71 since 462 + 71^7 = 456497^2 + 2981062^2.
%t SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
%t Do[x=1;Label[bb];Do[If[SQ[n+x^7-y^2],Print[n," ",x];Goto[aa]],{y,1,Sqrt[(n+x^7)/2]}];x=x+1;Goto[bb];Label[aa];Continue,{n,1,70}]
%t (* second program: *)
%t xmax = 100; r[n_, x_] := Reduce[y>0 && z>0 && n+x^7 == y^2+z^2, {y, z}, Integers]; a[n_] := For[x=1, x <= xmax, x++, If[r[n, x] =!= False, Return[x]]] /. Null -> 0; Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Dec 27 2015 *)
%Y Cf. A000290, A001015, A266152, A266153, A266230, A266231, A266277.
%K nonn
%O 0,1
%A _Zhi-Wei Sun_, Dec 27 2015