4. (2003 29th Russian Mathematical Olympiad) Find all prime numbers $p$ such that $p^{x}=y^{3}+1$ holds. Here $x$, $y$ are positive integers.
4. Since $p^{x}=(y+1)\left(y^{2}-y+1\right), y>0$. Therefore, $y+1 \geqslant 2$.

Let $y+1=p^{t}\left(t \in \mathbf{Z}^{+}, 1 \leqslant t \leqslant x\right)$, then $y=p^{t}-1$. Thus, $y^{2}-y+1=p^{x-t}$.
Substituting $y=p^{t}-1$ yields:
$$
\left(p^{t}-1\right)^{2}-\left(p^{t}-1\right)+1=p^{x-t} \Rightarrow p^{2 t}-3 p^{t}+3=p^{x-t} .
$$

Hence,
$$
p^{x-t}\left(p^{3 t-x}-1\right)=3\left(p^{t}-1\right) \text {. }
$$
(1) When $p=2$, $p^{3 t-x}-1, p^{t}-1$ are odd numbers, so $p^{x-t}$ is odd, thus
$$
x=t, y^{2}-y+1=1 \text {. }
$$

Therefore, $y=1, p=2, x=1$.
(2) When $p \neq 2$, $p$ is an odd number, then $p^{3 t-x}-1, p^{t}-1$ are even numbers, $p^{x-t}$ is odd, thus $3 \mid p^{x^{-t}}$ or $3 \mid\left(p^{3 t x}-1\right)$.
When $3 \mid p^{r-t}$, $p=3, x=t+1$ then $y^{2}-y+1=3$,
$$
\Rightarrow y=2, x=2 \text {. }
$$

When $3 \mid\left(p^{3 t-x}-1\right)$, we have $p^{x-t} \mid\left(p^{t}-1\right) \Rightarrow x=t$. From (1), we get: $y=1, p=2$ which is a contradiction.
In summary, there are two solutions: $y=1, p=2, x=1$. And $y=2, p=3, x=2$.