---
tag: 0GXNHEHQNA
kind: statement
role: proposition
name: Units of Z/nZ are the residues coprime to n
msc: [11A07, 20K01]
uses: [08FHNR8Z5D, 0F8X8ZRQ53]
sources:
  - url: https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n
    locator: Group axioms
---

## Statement

Let $n \geq 1$ and $a$ be integers.
The residue class $[a]$ is a unit of the ring $\mathbb{Z}/n\mathbb{Z}$ if and only if $\gcd(a, n) = 1$.

## Remarks

If $\gcd(a, n) = 1$, then Bézout's lemma gives integers $x$ and $y$ with $a x + n y = 1$. So $[a][x] = [1]$.
If $[a][x] = [1]$, then $a x - 1$ is a multiple of $n$, so each common divisor of $a$ and $n$ divides $1$.
The condition does not depend on the representative, because $a \equiv b \pmod{n}$ implies $\gcd(a, n) = \gcd(b, n)$.
For $n = 12$, the units are $[1]$, $[5]$, $[7]$ and $[11]$.

## Explanations

### L1 human

A residue has a multiplicative inverse modulo $n$ exactly when it has no common factor with $n$.
Bézout's lemma gives the inverse.
So the [[group of units of Z/nZ|0F8X8ZRQ53]] is the set of residues coprime to $n$.
