= Solution
The discriminant is
$$
11^2-4\cdot31=-3.
$$
The <discriminant criterion for a quadratic congruence modulo an odd prime> therefore says that, for $p\ne3$, a solution exists exactly when
$$
\left(\frac{-3}{p}\right)=1.
$$
The <quadratic character of minus three> gives
$$
\left(\frac{-3}{p}\right)=\left(\frac p3\right),
$$
which equals $1$ precisely for $p\equiv1\pmod3$. When $p=3$, the polynomial is
$$
X^2+2X+1=(X+1)^2,
$$
so it also has a solution. Hence
$$
\boxed{p\equiv0\text{ or }1\pmod3}.
$$
Back to article page