15-03-2023

Problem: Find all the units in

  1. $\mathbb{Z} _7$;
  2. $\mathbb{Z} _8$;
  3. $\mathbb{Z} _9$;
  4. $\mathbb{Z} _{10}$.

Solution: We recall that an element $a\in \mathbb{Z} _n$ is called a unit if the equation $ax=1$ has a solution in $\mathbb{Z} _n$. We have the following important result.

Let $a$ and $n$ be integers with $n>1$. Then $\bar{a}$ is a unit in $\mathbb{Z} _n$ if and only if $\gcd(a,n)=1$ in $\mathbb{Z} $. Thus, for a prime $p$ every nonzero element is a unit.


  1. $\mathbb{Z} _7$. Since $7$ is a prime number, so all nonzero elements will be unit. Let us denote the set of all units in $\mathbb{Z} _n$ by $\mathcal{U}_n$, then \[ \mathcal{U}_7 = \left\{ \bar{1}, \bar{2} ,\bar{3} ,\bar{4} ,\bar{5} ,\bar{6} \right\} . \]

  2. $\mathbb{Z} _8$. The units will be \[ \mathcal{U} _8 = \left\{ \bar{1} ,\bar{3} ,\bar{5} ,\bar{7} \right\}. \]

  3. $\mathbb{Z} _9$. The units will be \[ \mathcal{U} _9 = \left\{ \bar{1} ,\bar{2} ,\bar{4} ,\bar{5} ,\bar{7} ,\bar{8} \right\}. \]

  4. $\mathbb{Z} _{10}$. The units will be \[ \mathcal{U} _{10} = \left\{ \bar{1} ,\bar{3} ,\bar{7} ,\bar{9} \right\} . \]
Note that the number of units in $\mathbb{Z}_n$ will be the cardinality of the set \[ \mathcal{U}_n = \left\{\bar{a}: \gcd(a,n) = 1\right\}. \] The cardinality of the above set is given by the Euler's totient function. Therefore, the number of units in $\mathbb{Z}_n$ will be $\phi(n)$.