Two families of groups come straight out of arithmetic mod n. They will be our most-used examples, because every computation in them is quick and exact.
The group $\mathbb{Z}_{n}$. The set $\{0, 1, \dots, n - 1\}$ under addition mod $n$ is an abelian group of order $n$: the identity is $0$ and the inverse of $a$ is $n - a$ (and $-0 = 0$). Associativity comes from addition of integers.
The group $U(n)$. The set $$U(n) = \{a : 1 \le a \lt n,\ \gcd(a, n) = 1\}$$ under multiplication mod $n$ is an abelian group. Its order is Euler's $\varphi(n)$. For example $U(12) = \{1, 5, 7, 11\}$ and $U(7) = \{1, 2, 3, 4, 5, 6\}$.
Why it works
Worked example: List a group of units
- Keep the numbers below $12$ with no factor $2$ or $3$: $1, 5, 7, 11$.
- $5^{2} = 25 \equiv 1$, $7^{2} = 49 \equiv 1$, $11^{2} = 121 \equiv 1$, and $5 \cdot 7 = 35 \equiv 11$, $5 \cdot 11 = 55 \equiv 7$, $7 \cdot 11 = 77 \equiv 5$.
- Every element is its own inverse.
Answer: $U(12) = \{1, 5, 7, 11\}$, with $x^{2} = 1$ for every $x$.
Worked example: An inverse in $U(20)$
- $7 \cdot 3 = 21 = 20 + 1$, so $7^{-1} = 3$.
- Multiply $7x = 9$ on the left by $3$: $x = 3 \cdot 9 = 27 \equiv 7$.
- Check: $7 \cdot 7 = 49 = 40 + 9 \equiv 9$.
Answer: $7^{-1} = 3$ and $x = 7$.
Worked example: Inverses in $\mathbb{Z}_{n}$
- $4 + 5 = 9 \equiv 0$, so $-4 = 5$.
- $x = 2 + (-4) = 2 + 5 = 7$. Check: $4 + 7 = 11 \equiv 2$.
Answer: $-4 = 5$ and $x = 7$.
Common mistake
Key idea