If $N$ is any semi-prime composite number, then define: $t = \lceil{\sqrt{N}}\rceil $, and $kr^2 = t^2 - N$, where $k$ is the square-free part, and $r^2$ is the square part.
Then the following simultaneous equations will sometimes (maybe even often) hold true:
$$km^2 \pm 2tm + r^2 = ( n \pm r)^2$$ $$kn^2 \pm 2krn + t^2 = ( km \pm t)^2$$
For example, when $N = 1357$, then: $$t = \lceil{\sqrt{1357}}\rceil = 37 $$
$$kr^2 = 37^2 - 1357 = 12,$$ in which case $k = 3$, and $r = 2.$
The equations are satisfied by $m = 1$ and $n = 7$ when the $\pm$ signs are positive, and by $m = 30$ and $n = 24$ when the $\pm$ signs are negative.
The question is, what is the best (by which is meant most powerful/efficient) method to find these values of $m$ and $n$?