$mn | m^2+n^2+m \implies$ $(n-1)$ is a square Let $m;n \in \mathbb{Z^+}$ such that $mn | m^2+n^2+m$

Prove that $(n-1)$ is a square number. 

P/s : I don't have any ideas about this problems :(
Thanks :)

Consider the equation $kmn = m^2+n^2+m$ for fixed $k$. Suppose this equation has solutions in $(m,n)$ in positive integers, and take the solution with $m+n$ minimized. We distinguish two cases.


*

*Suppose $m \geq n$. Note that $m$ satisfies the quadratic equation
$$ X^2 - (kn-1)X+n^2 = 0$$
which also has $X=\frac{n^2}{m}$ as a solution. It follows that $(\frac{n^2}{m},n)$ is also a solution to the original equation, whence $m+n \leq \frac{n^2}{m} + n$ implying $m=n$. 

*Suppose $n \geq m$. Note that $n$ satisfies the quadratic equation
$$ Y^2 - kmY + m^2+m = 0$$
which also has $Y=\frac{m^2+m}{n}$ as a solution. It follows that $(\frac{m^2+m}{n},m)$ is also a solution to the original equation, whence $m+n \leq \frac{m^2+m}{n} + m$ or $n^2 \leq m^2+m$. Since $n \geq m$ this entails $n=m$ (for $m \leq n-1$ we have $m^2 +m \leq (n-1)^2 + (n-1) = n^2 - n < n^2$).


In both cases we find $m=n$. Since the only solution with $m=n$ is $m=n=1$ for $k=3$, we conclude that $k=3$ is the only possibility.
Now we have $3mn = m^2+n^2+m$ or $m(n-1)=(m-n)^2$. Since $m \mid n^2$, $m$ is coprime to $n-1$ so both $m$ and $n-1$ are squares.
This technique is known as Vieta jumping.
