19451945 is a sum of 2 distinct squares.
Find
ALL qualifying pairs (x,y).
To avoid duplicity assume x>y>0.
The square root of 19451945 is a bit over 4410.
The square root of half of 19451945 is a bit over 3118.
To avoid duplicates, we only need to check from 1 to 3118 or from 3118 to 4410.
----
squares = [i*i for i in range(1,4412)]
for i in range(1,3119):
diff = 19451945 - i*i
if diff in squares:
print('({},{}) whose square roots are ({},{})'.format(diff,i*i, int(diff**.5),i))
----
(19386409,65536) whose square roots are (4403,256)
(19333609,118336) whose square roots are (4397,344)
(19114384,337561) whose square roots are (4372,581)
(17884441,1567504) whose square roots are (4229,1252)
(13868176,5583769) whose square roots are (3724,2363)
(13512976,5938969) whose square roots are (3676,2437)
(12524521,6927424) whose square roots are (3539,2632)
(9916201,9535744) whose square roots are (3149,3088)
|
Posted by Larry
on 2023-03-14 11:45:12 |