Alternatively, it is the the number of integers \(k\) in the range \(1 \leq k \leq n\) for which \(\gcd(n,k)=1\).
Example
Take \(n = 9\). The numbers \(1,2,4,5,7\) and \(8\) are relatively prime to \(9\) while \(3,6\) and \(9\) are not. Therefore \(\phi(9) = 6\).
\(\phi(p)\) when \(p\) is prime
Observe that when when \(p\) is prime, then \(1\) and \(p\) are the only divisors of \(p\). Therefore \(\phi(p) = 2\) for any prime \(p\). What about prime powers? Suppose \(p\) is prime. What is \(\phi(p^k)\)? We know that any multiple of \(p\) is not coprime to \(p^k\). The multiples of \(p\) are
We have exactly \(p^{k-1}\) numbers that are not coprime to \(p^k\). Hence
\(\phi(p)\) is Multiplicative
Proof
Let
Observe that by definition of the group of units above, \(|\mathbb{Z}_{n}^*| = \phi(n)\). Now, the goal of this proof is to find a bijection such that
If we show that \(f\) is a bijection, then this implies that
which is what we want to show. Then, first we need to show that \(f\) is well-defined. This mean no matter what we choose as a representative of a residue class \([k]_{mn}\) or \([l]_{mn}\), then \(f\) will give us back the same element in the co-domain of \(f\). So suppose that we have
Then we want to show that
But if \(k \equiv l \pmod{mn}\), then \(mn \mid k - l\). This implies that \(m \mid k - l\) and \(n \mid k - l\). That is
Thus, \(k \equiv l \pmod{m}\) and \(k \equiv l \pmod{n}\) which means that
Next, we need that \(f(k)\) is inside the co-domain. Since \(k \in \mathbb{Z}_{nm}^*\), then we know that \(\gcd(k,mn) = 1\). But this also implies that \(\gcd(k,m)=\gcd(k,n)=1\). Why? Suppose not, then let \(\gcd(k,m)=s\). But this means that \(s\) is common factor of \(k\) and \(m\) so \(\gcd(k,mn)\) is at least \(s\) and that’s not possible. Therefore, \(k \in \mathbb{Z}_{m}^*\) and \(k \in \mathbb{Z}_{n}^*\).
Next, we want to show that \(f\) is \(1-1\). So let \(a, b \in \mathbb{Z}_{nm}^*\). Then, we know that \(\gcd(a,mn) = 1\) and \(\gcd(b, mn) = 1\). Now, suppose \(f(a) = f(b)\). We will show that \(a = b\). Since \(f(a) = f(b)\), then
But this just means that
Since by assumption \(\gcd(m,n) = 1\), then the Chinese Remainder Theorem guarantees that the pair of congruences above has a unique solution modulo \(mn\). That is
Hence, \(a\) and \(b\) are in the same residue class modulo \(\mathbb{Z}_{mn}^*\) so \(f\) is injective.
Next we want to show that \(f\) is surjective. So let \((a,b) \in \mathbb{Z}_{m}^* \times \mathbb{Z}_{n}^*\). We want to show that there is a \(k \in \mathbb{Z}_{mn}^*\) such that \(f(k) = (a,b)\). That is
or
But this has a solution modulo \(mn\) by CRT since \(\gcd(m,n)=1\). Then we know that \(k \in \mathbb{Z}_{mn}\). But we still need to show that \(k \in \mathbb{Z}_{mn}^*\). That is, \(\gcd(k, mn) = 1\). Observe that since \(\gcd(a, m) = 1\) and since \(k \equiv a \bmod{m}\), then we must also have that \(\gcd(k,m) = 1\). Similarly, since \(\gcd(b,n) = 1\) and since \(k \equiv b \pmod{n}\), then \(\gcd(k,n)=1\). Finally, since \(\gcd(k,m) = 1\) and since \(\gcd(k,n) = 1\), then we must have that \(\gcd(k,mn) = 1\). Therefore, \(f\) is surjective.
References
- Wikipedia
- Number Theory by George E. Andrews
- Math310 Class Notes by Matthias Beck