How to find all $m,n$ such that $mn|m^2+n^2+1$? How to find all positive integers $m,n$ such that $m|n^2+1$ and $n|m^2+1$ ?
My work:- Let $n^2+1=mk , m^2+1=ng$ , then $mkg=gn^2+g=m^2n+n+g$ , hence 
$m|n+g$ i.e. $m|n+\dfrac{m^2+1}n$ i.e. $\dfrac{n^2+m^2+1}{mn}$ is an integer i.e. $mn|m^2+n^2+1$ . Now conversely
assume $mn|m^2+n^2+1$ , then $m|m^2+n^2+1$ and $n|m^2+n^2+1$ i.e. $m|n^2+1$ and $n|m^2+1$
So the question equivalently asks to positive integers $m,n$ such that $mn|m^2+n^2+1$

Write a formula and although it is possible to draw some more.
Solutions of the equation: $\frac{X^2+aX+Y^2+bY+c}{XY}=j$
If a root. $t=\sqrt{(b+a)^2+4c(j-2)}$
Then using the equation Pell:  $p^2-(j^2-4)s^2=1$
Solutions can be written:
$X=\frac{(b+a\pm{t})}{2(j-2)}p^2+(t\mp{(b-a)})ps-\frac{(b(3j-2)+a(6-j)\mp{(j+2)t})}{2}s^2$
$Y=\frac{(b+a\pm{t})}{2(j-2)}p^2+(-t\mp{(b-a)})ps-\frac{(b(6-j)+a(3j-2)\mp{(j+2)t})}{2}s^2$
Please note that the number $p,s$ Can be any characters.
