Solution (source code)

= Solution

A <primitive root> modulo $p$ is an integer $g$ whose residue class generates the <multiplicative group of a finite field> $\mathbb F_p^\times$. Equivalently, its <multiplicative order> modulo $p$ is $p-1$, so
$$
\boxed{\{1,g,g^2,\ldots,g^{p-2}\}=\mathbb F_p^\times.}
$$