Solve $(y^2 + xy)(x^2 - x + 1) = 3x - 1$ over the integers. 
Solve $$(y^2 + xy)(x^2 - x + 1) = 3x - 1$$ over the integers.

There are many solutions to this problem, and perhaps I chose the worst one possible. I hope that someone could come up with a better answer.
This problem is adapted from a recent competition (which is different than all of the "recent competitions" that I have mentioned before.
 A: Write $m=x^2-x+1>0$ then from $m\mid 3x-1$ we have $$ 3x\equiv 1 \pmod m$$ and since $m\mid 9m$ we have also $$9x^2-9x+9\equiv 0\pmod m$$ So $$1-3+9\equiv 0 \pmod m \implies m\mid 7\implies m\in \{1,7\}$$


*

*$x^2-x+1 = 1\implies x\in\{0,1\}$

*$x^2-x+1 = 7\implies x\in\{-2,3\}$
Check every $x$ and you are done.
A: We have that $$(y^2 + xy)(x^2 - x + 1) = 3x - 1 \implies x^2 - x + 1 \mid 3x - 1$$
$$\implies x^2 - x + 1 \le |3x - 1| \iff x \in [-2, 0] \cup [2 - \sqrt 2, 2 + \sqrt 2]$$
However, $x$ is an integer $\implies x \in \{0, \pm 1, \pm 2, 3\}$
We can set up a table for different values of $x$ and $y^2 + xy$.
$$\begin{matrix} x& -2& -1& 0& 1& 2& 3\\ y^2 + xy= \dfrac{3x - 1}{x^2 - x + 1}& -1& -\dfrac{4}{3}& -1& 2& \dfrac{5}{3}& \dfrac{8}{7} \end{matrix}$$
$\implies \left[ \begin{align} x = -2 &\text{ and } y^2 - 2y = -1\\ x = 0 &\text{ and } y^2 = -1\\ x = 1 &\text{ and } y^2 + y = 2 \end{align} \right.$$\implies \left[ \begin{align} x = -2 &\text{ and } (y - 1)^2 = 0\\ x = 1 &\text{ and } (y + 2)(y - 1) = 0\end{align} \right.$
$\implies (x, y) \in \{(-2, 1), (1, -2), (1, 1)\}$.
A: After getting $(x^2-x+1)\mid(3x-1)$, and bounding $-2\leq x\leq 3$ as a result, you should first go back and check the condition $(x^2-x+1)\mid(3x-1)$:


*

*$x=-2$: $x^2-x+1=7$, $3x-1=-7\quad\checkmark$

*$x=-1$: $x^2-x+1=3$ so doesn't divide $3x-1$.

*$x=0,1$: $x^2-x+1=1\quad\checkmark$

*$x=2$: $x^2-x+1=3$, so doesn't divide $3x-1$.

*$x=3$: $x^2-x+1=7$ does not divide $3x-1=8$.


then find $y$.
