-1

I know of the method to calculate $g^k$ for every $k < p$ and check if it ever is congruent to $1$.

But can I prove the same property with less work by taking the factors of $(p-1)$ and only raising g to those powers?

For Example: $g = 2$, $p = 7$ we can find $p-1 = 6$ and the factors of 6 are $1,2,3,6$ and can we only check these factors. $2^1 = 2$, $2^2 = 4$, $2^3 = 1$, $2^6 = 1$. Here shows that $2$ is not a primitive root of $7$ since it should have an order = $6$ but has an order = $3$.

BR Pahari
  • 2,694

1 Answers1

2

You can do even better: only consider prime factors of $p-1$.

$g \not\equiv 0$ is a primitive root mod $p$ if for every prime factor $q | p - 1$: $$g^\frac{p-1}{q} \not\equiv 1 \pmod{p}$$

That's because every proper divisor of $p-1$ is also a divisor of $\frac{p-1}{q}$ for some $q$.