Find all primes $p>2$ for which $x^2+x+1$ is irreducible in $\mathbb{F}_p[x]$ [duplicate]

Find all primes $p>2$ for which $x^2+x+1$ is irreducible in $\mathbb{F}_p[x]$

Attempt. Since $x^2+x+1$ is of degree 2, it is reducible iff it has a root in $\mathbb{F}_p$. It has a root in $\mathbb{F}_p$ iff $x^3-1=(x-1)(x^2+x+1)$ has a root other than 1. The latter has a root other than $1$ iff $\mathbb{F}_p$ has elements of order $3$, which happens iff $3\mid |\mathbb{F}_p^{\times}|=p-1$, which happens iff $p\equiv 1\bmod 3$. So $x^2+x+1$ is irreducible iff $p\not \equiv 1\bmod3 $.

I am getting a different answer than my professor, who has $p\equiv 1\bmod 3$. If I am incorrect, were am I going wrong?

Update. Now I am unsure about my own reasoning. What if $1$ is a root of $x^2+x+1$? I don't know why I am considering roots of $x^2+x+1$ other than $1$ when $1$ can be a root.


Solution 1:

This seems correct. For example, when p = 7, we have $x^2 + x + 1 = (x - 2)(x+3)$, so that the answer definitely can't be p is congruent to 1 mod 3.

Solution 2:

We can write $x^2+x+1=4^*((2x+1)^2+3)$, where $4^*$ is multiplicative inverse of $4$ modulo $p$. Now, the last expression can be made equal to 0 iff $-3$ is quadratic residue mod $p$, which you can use quadratic reciprocity to see that it happens iff $p\equiv 1\mod 6$.

Solution 3:

By the way, there is a general result which says that for $p \nmid n$ the cyclotomic polynomial $\Phi_n$ is irreducible over $\mathbb{F}_p$ if and only if $[p]$ generates $(\mathbb{Z}/n)^{\times}$. Here, $n=3$, and the only non-generator of $(\mathbb{Z}/3)^{\times}$ is $[1]$. Hence, $\Phi_3=X^2+X+1$ is irreducible over $\mathbb{F}_p$ if and only if $p \not\equiv 1 \bmod 3$.