Find every $n$: $n^2 + 340 = m^2$

69 Views Asked by At

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.

2

There are 2 best solutions below

0
On BEST ANSWER

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.

0
On

The only shortcut is to notice both factors need to be even, so you must put one $2$ in each factor. That reduces the problem to the factorisation of $85$. There are just two solutions because it's semiprime.