<s>[INST] 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!
 [/INST] 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$.
</s>