%I #31 Nov 09 2025 12:32:09
%S 2,21,13,41,8,73,145,113,201,393,377,1489,793,1097,1657,2161
%N a(n) is the smallest integer w such that the Diophantine equation x^2 + y^3 + z^5 = w^7 where GCD(x,y,z)=1 has exactly n positive integer solutions.
%H Mrexcel, <a href="https://math.stackexchange.com/questions/5097413/efficient-algorithm-for-solving-diophantine-equation-x-2y-3z-5-w-7-w">Efficient algorithm for solving Diophantine equation x^2+y^3+z^5=w^7 with gcd(x,y,z)=1</a>.
%H Chinese BBS, <a href="https://bbs.emath.ac.cn/thread-50064-1-1.html">An efficient algorithm of x^2 + y^3 + z^5 = w^7, GCD(x, y, z) = 1</a>.
%e a(3) = 13 because 13^7 = 7783^2 + 91^3 + 17^5 = 5921^2 + 277^3 + 23^5 = 6484^2 + 58^3 + 29^5 and for no integer smaller than 13 we have 3 solutions.
%t f[w_] := (sol = {}; w7 = w^7;
%t Do[yy = w7 - z^5; Do[xx = yy - y^3; x = Sqrt@xx;
%t If[IntegerQ@x, If[GCD[x, y, z] == 1, AppendTo[sol, {x, y, z}];]],
%t {y, Floor[yy^(1/3)]}], {z, Floor[w7^(1/5)]}]; {Length@sol, w, sol});
%t Do[w=1;Until[f[w][[1]]==n,w++];Print[f[w]],{n,5}]
%o (Python)
%o from itertools import count
%o from math import isqrt, gcd
%o from sympy.ntheory.primetest import is_square
%o def A387127(n):
%o for w in count(1):
%o c = 0
%o w7 = w**7
%o for z in count(1):
%o z5 = w7-z**5
%o if z5<2:
%o break
%o for y in count(1):
%o y3 = z5-y**3
%o if y3<1:
%o break
%o if is_square(y3):
%o x = isqrt(y3)
%o if gcd(x,y,z)==1:
%o c += 1
%o if c>n:
%o break
%o if c == n:
%o return w # _Chai Wah Wu_, Nov 09 2025
%Y Cf. A386373, A386988.
%K nonn,more
%O 1,1
%A _Zhining Yang_, Aug 17 2025
%E a(12), a(14)-a(16) from _Zhao Hui Du_, Sep 22 2025