$p^2-p+1=P^3$ prove how many $p$, $P$ pairs are there Determine  with a proof all prime numbers $p$ such that $p^2-p+1$ is a cube of a prime number.
$19^2-19+1=7^3$
But is it the only $p$?
How should I prove it?

We will use here: If $a$ and $b$ are positive integers then $$\boxed{a\mid b\implies a\leq b}$$
Rename $q=P$. We can assume that $p\geq 23$ and so $q\geq 8$. We have $$ p(p-1) = (q-1)(q^2+q+1)$$ 


*

*If $p\mid q-1$ then $q^2+q+1\mid p-1$. So $p\leq q-1$ and $q^2+q+1\leq p-1$ so we have $$q^2+q+1\leq q-2\implies q^2+3\leq 0$$
which is impossible.

*If $p\mid q^2+q+1 $ then $q-1\mid p-1$. Let $r=q-1$ then we have: $p\mid r^2+3r+3$ and $r\mid p-1$ (so $\color{red}{r\leq p-1}$) then $$pr\mid r^2p+3pr+3p-r^2-3r-3$$ and thus $$pr\mid r^2+3r+3-3p$$
Case 1: $r^2+3r+3>3p$ then $$pr\leq r^2+3r+3-3p \implies p\leq r+{3\over r+3}< r+1\leq p$$
A contradiction.
Case 2: $r^2+3r+3<3p$ then $$pr\leq 3p-r^2-3r-3 < 3p \implies r<3$$
A contradiction.
Case 3: $r^2+3r+3=3p =q^2+q+1$ then $$p-1 = 3q-3 = 3r$$ and thus we have $$r^2+3r+3 = 9r+3\implies r=6 \implies q=7$$
A contradiction, since $q>7$.
So the only solution is $P=7$ and $p=19$. 

Notice that we didn't use $P$ is prime.
