Determine all prime numbers $p$ for which there exists a unique $a$ in $\{1, \ldots, p\}$ such that $a^{3}-3 a+1$ is divisible by $p$.

---

The translation maintains the original formatting and structure of the source text.
Let $p$ satisfy the statement, and $a$ be the unique solution of $a^{3}-3 a+1 \equiv 0(\bmod p)$. Note that $a \neq 0$, so by setting $b \equiv \frac{1}{a}(\bmod p), b^{3}-3 b^{2}+1 \equiv 0$ thus $(b-1)^{3}-3 b+2 \equiv 0$ thus $(b-1)^{3}-3(b-1)-$ $1 \equiv 0$. In particular, $-(b-1)$ is also a root modulo $p$ of $X^{3}-3 X+1$, so $a \equiv-(b-1)$, thus $a^{2} \equiv-(a b-a) \equiv a-1$ thus $a^{2}-a+1 \equiv 0(\bmod p)$. Now, $a^{3}-3 a+1=\left(a^{2}-a+1\right)(a+1)-3 a$, so modulo $p, 3 a \equiv 0(\bmod p)$. Clearly, $a$ cannot be zero modulo $p$, so $p=3$.

Conversely, if $p=3$, there is a unique solution to $a^{3}+1 \equiv 0(\bmod 3): a \equiv 2$. Thus $p=3$ is the only prime number that fits.