Find every $n$: $n^2 + 340 = m^2$ Let $n$, $m \in N$.
The problem asks to find every natural number $ n $ such that:
$ n^2 + 340 = m^2 $
I tried to solve the equation like this:
$ n^2 - m^2 = 340 $
$ (n + m)(n - m) = 2^2 * 5 * 17 $
I listed all possible pairs of dividers of 340:
$(1, 340), (2, 170), (4, 85), (5, 68), (10, 34), (20, 17)$
I set up six linear systems; only two gave me integers.
$$
\left\{ 
\begin{array}{c}
m+n=170 \\
m-n=2   \\
\end{array}
\right. 
$$
$m = 86, n = 84$
$$
\left\{ 
\begin{array}{c}
m+n=34 \\ 
m-n=10 \\ 
\end{array}
\right. 
$$
$m = 22, n = 12$
I posted this problem because I don't have the solution. Did I make any mistake? Could the problem be solved in a quicker way?
Thanks.

I think the way you did it is the best way.
A worse way would be that if we let $m = n + k$ then $n^2 + 2nk + k^2 = m^2$ so $2nk + k^2 = 340$.  Clearly $k$ is even so if $k=2k'$ then $nk' + k'^2 = 85$.  And $k'(n+k') = 85$ so for $k' =1....\sqrt{85};k|85=5*17$ or in other words for $k'=1, 5$  we get $n=84,12$  and $k=2,10$ so $(m,n) = (86,84)$ or $(22, 10)$.
Hmm... I guess that wasn't that much worse.  In essence it was basically the same thing.
Still I prefer your way which would have been for first choice.
