Make delicious recipes!

Double Squares Problem

Problem: Given a number N, find all pairs of numbers such that N2 = X2 + Y2

Solution: Its easy to see that neither X nor Y can be greater than N

To find all pairs, we can use the following code:

Like us on Facebook to remain in touch
with the latest in technology and tutorials!

Got a thought to share or found a
bug in the code?
We'd love to hear from you:

Email: (Your email is not shared with anybody)

Facebook comments:

Site Owner: Sachin Goyal