Bhaskara's Lemma

Lemma
As long as $k \ne 0$:


 * $\displaystyle N x^2 + k = y^2 \implies N \left({\frac{mx + y}{k}}\right)^2 + \frac{m^2 - N}{k} = \left({\frac{my + Nx}{k}}\right)^2$

for any integer $m$.

Proof
The implication goes the other way if $m^2 - N \ne 0$.