# When is $a$ not a cube mod $p$

I would like to know when an integer $a$ is not a cube mod $p$. I already proved that if $p \equiv -1$ mod 3, then any integer is a cube mod $p$, but in the case where $p \equiv 1$ mod 3, I cannot find a good condition.

-
More elementary than cubic reciprocity: $a^{\frac{p-1}3}=1$ if and only if $a$ is a cube, when $p\equiv 1\pmod 3$. –  Thomas Andrews Apr 2 '12 at 15:15

In the case when $p \equiv 1 \pmod 3$, $a$ is a cube mod $p$ if and only if $a^{(p-1)/3} = 1$.
To see this, let $x$ be a primitive root mod $p$. If $a$ is a cube, then $a = x^{3k}$ for some positive integer $k$. Then $a^{(p-1)/3} \equiv x^{k(p-1)} \equiv 1^k \equiv 1 \pmod p$, by Fermat's little theorem. Conversely, if $a = x^{3k+l}$ with $l \in \{1,2\}$, then $a^{(p-1)/3} \equiv x^{(p-1)l/3} x^{k(p-1)} \equiv x^{(p-1)l/3} \not \equiv 1 \pmod p$, since $(p-1)l/3$ is not divisible $p-1$, which is the order of $x$.