# General rule to say that $(\mathbb{Z}/n \mathbb{Z})^{\times}$ is cyclic [duplicate]

Definition: $$(\mathbb{Z}/n \mathbb{Z})^{\times} = \{\bar{a} \in \mathbb{Z}/n \mathbb{Z}: \gcd(a, n) = 1\}$$.

I know that $$(\mathbb{Z}/9 \mathbb{Z})^{\times}$$ and $$(\mathbb{Z}/6 \mathbb{Z}))^{\times}$$ are cyclic because $$\langle\bar{5}\rangle = (\mathbb{Z}/9 \mathbb{Z})^{\times}$$ and $$\langle\bar{2}\rangle = (\mathbb{Z}/6 \mathbb{Z})^{\times}$$, but $$(\mathbb{Z}/8 \mathbb{Z})^{\times}$$ is not cyclic. Is there a general rule to say if $$(\mathbb{Z}/n \mathbb{Z})^{\times}$$ is cyclic?

• Sep 27 '21 at 23:01
• Use \times instead of X and \langle and \rangle instead of < and >. Sep 27 '21 at 23:03
• This question has been many times before: 1, 2, for instance. Please search before asking a new question. Sep 28 '21 at 0:36

Yes: $$(\mathbb Z/n\mathbb Z)^\times$$ is cyclic if and only if $$n$$ is either an odd-prime power, or $$2p^n$$ with odd prime $$p$$.
One direction of the proof is relatively easy, since $$\mathbb Z/p^mq^n\mathbb Z\approx \mathbb Z/p^m\mathbb Z \oplus \mathbb Z/q^n\mathbb Z$$... making it hard for the multiplicative group to be cyclic.
The prime-power case is slightly subtler, and the factor-of-$$2$$ aspect also.
EDIT: and, as @lhf reminded me, for $$m=1,2,4$$! :)
• Also, $n=1,2,4$.