# Solve Quadratic diophantine equation in two unknowns.

Determine all $m,n \in \mathbb{Z}^+$ such that $m^2+1$ is a prime number and $10((m^2)+1)=n^2+1.$ Please provide complete explanation with solution. I have made an excel sheet with all the prime numbers from $2$ to $200$ as $= m^2+1;$ and I have calculated $m$ and $n$ as per the conditions given. This is basically as trial and error method. I tried Lagrange's algorithm, but I am not able to understand the algorithm completely. I believe this is a quadratic diophantine equation in two variables?

As $m^2 + 1$ is a prime number it has to be odd ( 2 doesn't satisfy given conditions ), assume the prime number to be of the form of $4k + 1$ (m is even and therefore a multiple of 4) then use the second condition to obtain that $n^2 = 40k + 9$ now n can be 7,13, 27 etc. And you can get corresponding values m by evaluating value of k.