# Find all positive integers $L$, $M$, $N$ such that $L^2 + M^2 = \sqrt{ N^2 +21}$

Sorry, this is very much 'can you do my homework' but I have a little competition at work that requires me to solve (and prove) the following.

Find all positive integers $L$, $M$, $N$ such that $L^2 + M^2 = \sqrt{ N^2 +21}$.

The answers I have are $L=1$, $M=2$, $N=2$ and $L=2$, $M=1$, $N=2$ (by iterating over all values of L, M, and N from 1 to 100 in Ruby). I think it's pretty unlikely there are any higher answers but proving it is beyond me. Can anyone point me in the right direction?

Hi DJ, don't dob me in!

-
Let $(L^2 + M^2) = A$. Then you have $A^2 = N^2 + 21$ i.e. $(A+N)(A-N) = 21 = 21 \times 1= 7 \times 3$. Now work out the different possibilities with the constraint that you are dealing with positive integers. Move your mouse over the gray area to find the solution.
The first one i.e. $21 \times 1$, gives us $A = 11$ and $N = 10$, while the second one i.e. $7 \times 3$ gives us $A = 5$ and $N = 2$. $A = 11$ cannot be expressed as sum of two squares since it is $3 \bmod 4$. $A=5$ implies that $L^2 + M^2 = 5$ which gives us $(L,M) = (2,1)$ or $(L,M) = (1,2)$. Hence, $(2,1,2)$ and $(1,2,2)$ are the only solutions.