Each of x and y is a positive integer.
Determine the minimum value of x+y such that:
x3 + 100 = y2
What are the next two smallest values of x+y in consonance with the given conditions?
If there were no requirement for x to be positive, then an additional solution would be:
0^3 = 0
10^2 = 100
-------------
5^3 = 125
15^2 = 225
20^3 = 8000
90^2 = 8100
24^3 = 13824
118^2 = 13924
2660^3 = 18821096000
137190^2 = 18821096100
no further solutions for x up to 100,000,000
------------------
def issquare(n):
""" Input an integer, Returns True iff it is a perfect square. """
if round(n**0.5)**2 == n:
return True
else:
return False
for x in range(1,100000):
y = (x**3 + 100)
if issquare(y):
print(x,int(y**.5), x**3, y)
|
Posted by Larry
on 2023-07-13 06:48:39 |