4. Find the prime $p \geqslant 5$ for which 3 is a quadratic residue.

将上面的文本翻译成英文，请保留源文本的换行和格式，直接输出翻译结果。 

Note: The note above should not be included in the final translation, as it is a meta-instruction. Here is the final translation:

4. Find the prime $p \geqslant 5$ for which 3 is a quadratic residue.
4 . Solution: We have
$$\left(\frac{3}{p}\right)=(-1)^{\frac{p-1}{2}}\left(\frac{p}{3}\right)$$

It is easy to see that
$$(-1)^{\frac{p-1}{2}}=\left\{\begin{aligned}
1, & \text { when } p \equiv 1(\bmod 4), \\
-1, & \text { when } p \equiv 3(\bmod 4),
\end{aligned}\right.$$

and on the other hand,
$$\left(\frac{p}{3}\right)=\left\{\begin{aligned}
1, & \text { when } p \equiv 1(\bmod 3), \\
-1, & \text { when } p \equiv 2(\bmod 3).
\end{aligned}\right.$$

From $\left\{\begin{array}{l}p \equiv 1(\bmod 4) \\ p \equiv 1(\bmod 3)\end{array} \quad\right.$ we get $p \equiv 1(\bmod 12)$,
$$\left\{\begin{array}{l}
p \equiv-1(\bmod 4) \\
p \equiv-1(\bmod 3)
\end{array} \quad \text { we get } p \equiv-1(\bmod 12),\right. \text { thus }$$

we obtain
$$\left(\frac{3}{p}\right)=\left\{\begin{array}{r}
1, \text { when } p \equiv \pm 1(\bmod 12), \\
-1, \text { when } p \equiv \pm 5(\bmod 12).
\end{array}\right.$$