All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Sum of two squares (Posted on 2023-03-14) Difficulty: 3 of 5
19451945 is a sum of 2 distinct squares.
Find ALL qualifying pairs (x,y).

To avoid duplicity assume x>y>0.

No Solution Yet Submitted by Ady TZIDON    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Solution | Comment 1 of 4
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
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (11)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information