If $ab \mid c(c^2-c+1)$ and $c^2+1 \mid a+b$ then prove that $\{a, b\}=\{c, c^2-c+1 \}$ If $ab \mid c(c^2-c+1)$ and $c^2+1 \mid a+b$ then prove that $\{a, b\}=\{c, c^2-c+1 \}$ (equal sets), where $a$, $b$, and $c$ are positive integers.
This is math contest problem (I don't know the source). I was struggling to solve this, but I cannot find a way to make it easier. Can you help me?
All I did was like this:
$$a+b=d(c^2+1)=d(c^2-c+1+c) \\ c(a+b)=dc(c^2-c+1)+dc^2 \\ c(a+b)=deab+dc^2=d(eab+c^2)$$
I suppose this is a quadratic in $c$ and determine its discriminant. But it doesn't make the problem any easier!
 A: HINT.-For some positive integers $m,n$ we have
$$\begin{cases}a+b=m(c^2+1)\\abn=c(c^2-c+1)\end{cases}\Rightarrow c^2-\frac{a+b}{m}c+abn=0$$
If $m$ and $n$ are equal to $1$ then $c$ is root of the equation $X^2-(a+b)X+ab=0$ from which clearly $c\in\{a,b\}$. It easily follows that $a$ or $b$ is equal to $c^2-c+1$.
If both $m$ and $n$ is greater than $1$ then $c$ is root of $X^2+\dfrac{a+b}{m}X+abn=0$ where the sum of the two roots shrinks while the product is enlarged. This is not possible for positive integers.
I leave for the O.P. the case just one of the $m,n$ is equal to $1$
Finally the proof is clear (it has been done already above) because necessarily the positive integers $m$ and $n$ are equal to $1$.
A: Suppose we have:
$m^2k^2(c^2+1)^2-4mc(c^2-c+1)=t^2$
$(m^2k^2(c^2+1)^2-t)(m^2k^2(c^2+1)^2+t)=4mc(c^2-c+1)$
We may have a system of equations as follows:
$m^2k^2(c^2+1)^2-t=4mc$
$m^2k^2(c^2+1)^2+t=c^2-c+1$
Summing two equations we get:
$2m^2k^2(c^2+1)^2=4mc+c^2-c+1$
$k^2=\frac{2mc+(c^2-c+1)/2}{2m^2(c^2+1)^2}$
Now problem reduces to : what is condition for $2mc+(c^2-c+1)/2$ to be a perfect square.The discriminant of quadratic relation $2mc+(c^2-c+1)/2≥0$ will give a range of value for m, which is finally the condition for initial relation to be a perfect square.
