Chapter 7 Order of Elements of \(\mathbb{Z}_n\)
Definition 7.0.1.
Let \(n\gt 1\) and \(\gcd(a, n) = 1.\) The order of \(a\) modulo \(n\) is the smallest positive integer \(k\) such that \(a^k\equiv 1\pmod{n}.\)
Example 7.0.2.
Consider the elements in \(\mathbb{Z}_8.\) The only elements with \(\gcd(a, 8) = 1\) are those in \(U_8;\) that is
Now trivially \(1\) has order \(1\text{.}\) Note that \(3^2 = 9\equiv 1\pmod{8}, 5^2 = 25\equiv 1\pmod{8},\) and \(7^2 = 49\equiv 1\pmod{8},\) so \(3,5,7\) all have order \(2\) modulo \(8.\)
Example 7.0.3.
Let \(p\) be a prime. Then \(p-1\) has order \(2\) modulo \(p,\) since
The condition that \(\gcd(a, n) = 1\) is paramount. For if \(\gcd(a, n)\gt 1,\) then the congruence
has no solution so then for every \(k\in\mathbb{N},\)
Theorem 7.0.4.
If \(a\equiv b\pmod{n},\) then \(a\) and \(b\) have the same order modulo \(n.\)
Proof.
If \(a\equiv b\pmod{n},\) then \(a^i \equiv b^i \pmod{n}\) for every \(i\text{.}\) The result follows.
Theorem 7.0.5.
Let \(a\) have order \(k\) modulo \(n.\) Then \(a^h\equiv 1\pmod{n}\) if and only if \(k\vert h;\) in particular, \(k\vert \varphi(n).\)
Proof.
Let \(a\) have order \(k\) modulo \(n.\)
Suppose that \(k\vert h,\) then \(h = kj\) for some \(j.\) Since \(a^k\equiv 1\pmod{n},\) we have
Conversely, let \(h\geq 1\) be such that \(a^h\equiv 1\pmod{n}.\) By the division algorithm, there exist \(q, r\) with \(h = qk + r,\) where \(0\leq r \lt k.\) So
Since \(a^h\equiv 1 \pmod{n}\) and \(a^k\equiv 1 \pmod{n},\) we have that \(a^r\equiv 1 \pmod{n}.\) But \(k\) is the smallest positive integer such that \(a^k\equiv 1 \pmod{n},\) thus \(r = 0,\) and hence \(k\vert h.\)
Example 7.0.6.
Consider \(2\in\mathbb{Z}_{13}.\) We know from the above theorem that \(2\) has order dividing \(\varphi(13) = 12;\) so the possible orders of \(2\) modulo \(13,\) are \(1,2,3,4,6,\) and \(12.\) Now
so \(2\) has order \(12\) modulo \(13.\)
Theorem 7.0.7.
If \(a\) has order \(k\) modulo \(n,\) then \(a^i\equiv a^j \pmod{n}\) if and only if \(i\equiv j \pmod{k}.\)
Proof.
Let \(a\) have order \(k\) modulo \(n.\) If \(a^i\equiv a^j \pmod{n},\) then \(a^{i-j}\equiv 1\pmod{n},\) so that by theorem \(k\vert i-j\) and so \(i\equiv j \pmod{k}.\)
If \(i\equiv j \pmod{k},\) then \(i = j + qk\) for some \(q.\) So
since \(a^k\equiv 1 \pmod{n}.\)
Corollary 7.0.8.
If \(a\) has order \(k\) modulo \(n,\) then the integers \(a, a^2, a^3,..., a^k\) are incongruent modulo \(n.\)
Proof.
If \(a^j\equiv a^i \pmod{n},\) for \(1\leq i\lt j\leq k,\) then we know by the previous theorem that \(i\equiv j \pmod{k},\) which is impossible under the conditions on \(i\) and \(j.\)
The order of an element, and of powers of an element are related in the following way.
Theorem 7.0.9.
If \(a\) has order \(k\) modulo \(n\) and \(h\gt 0,\) then \(a^h\) has order \(\dfrac{k}{\gcd(h,k)}\) modulo \(n.\)
Proof.
Let \(d = \gcd(h, k).\) Then we may write \(h = h_1d\) and \(k = k_1d,\) with \(\gcd(h_1, k_1) = 1.\) Now
If we assume that \(a^h\) has order \(r\) modulo \(n,\) then we know that \(r\vert k_1.\) On the other hand, because \(a\) has order \(k\) modulo \(n,\)
gives \(k\vert hr,\) so \(k_1d\vert h_1dr\) so \(k_1\vert h_1r.\) But \(\gcd(k_1, h_1) = 1,\) so \(k_1\vert r\) by Euclid's Lemma. Thus \(r = k_1,\) and
Corollary 7.0.10.
Let \(a\) have order \(k\) modulo \(n.\) Then \(a^h\) also has order \(k\) if and only if \(\gcd(h, k) = 1.\)