Positive integers $a$ and $b$ are such that $ab+1$ is a factor of $a^2+b^2$. Prove that $\frac{a^2+b^2}{ab+1}$ is a perfect square.
Alternative proof that $(a^2+b^2)/(ab+1)$ is a square when it's an integer