<s>[INST] If $x$ and $y$ are positive integers, and $p$ is a prime, find all triples ($x$, $y$, $p$) such that $x^5 + x^4 + 1 = p^y$ If $x$ and $y$ are positive integers, and $p$ is a prime, find all triples ($x$, $y$, $p$) such that $x^5 + x^4 + 1 = p^y$. (Titu Andreescu)
My attempt:
I factorised the LHS to get $(x^3 - x +1)(x^2 + x + 1)$ = $p^y$, and then I tried to solve the 2 equations $(x^3 - x + 1) = p^m$ and $(x^2 + x + 1) = p^n$ where $m + n = y$ and they are integers, but I could not get anywhere. I also took the difference between $(x^3 - x + 1)$ and $(x^2 + x + 1)$, which was $x(x-2)(x+1)$, and I know this is divisible by $p$, but this didnt work as well. Am I going in the right direction with my first step (the factorisation), or must I try something different?
Please give some hints, but not the solution. (I want to solve it, not let others tell me the answer) Thanks a lot.
 [/INST] Note that $x^5 + x^4 + 1 = (x^3 - x + 1)(x^2 + x + 1)$, and 
$$x^3 - x + 1 \geq x^2 + x + 1 \iff x^3 - x^2 - 2x \geq 0 \iff x(x^2-x-2) \geq 0 \iff x \geq 2.$$ 
Hence, for $x \geq 2$, we know if $x^3 - x + 1 = p^m$ and $x^2 + x + 1 = p^n$, then $x^2 + x + 1 \mid x^3 - x + 1$. We have
$$\begin{aligned}
x^2 + x + 1 &\mid x^3 - x + 1\\
x^2 + x + 1 &\mid x^3 + x^2 + x\\
\implies x^2 + x + 1 &\mid x^2 + 2x - 1\\
\implies x^2 + x + 1 &\mid x - 2\\
\end{aligned}$$
If $x = 2$, then this is trivially true. Else, $x > 2$, so $x^2 + x + 1 \leq x - 2 \implies x^2 + 3 \leq 0$, which is a contradiction. Therefore, $x = 1, 2$ only, of which we check to find both work: $(x, y, p) = (1, 1, 3), (2, 2, 7)$.
</s>