Lifting a primitive root to odd prime powers (source code)

= Lifting a primitive root to odd prime powers

Let $p$ be an odd prime and let $b$ be primitive modulo $p$. Then $b$ is primitive modulo every $p^m$ if and only if it is primitive modulo $p^2$. In that case
$$
\operatorname{ord}_{p^m}(b)=p^{m-1}(p-1).
$$