The totient function, \(\phi(n)\), is defined as the number of positive integers up to \(n\) which are relatively prime (or co-prime) to \(n\).
More conretely, suppose we have the finite sequence, \(S\), ranging from \(1\) to \(n\) where \(n = 9\), written as \(\{ 1, 2, \dots, 8, 9 \}\).
For each element in \(S\), generically \(s_i\) such that \(i \subset \mathbb{N}\) is the sequence index, we take the greatest common divisor of \(n\) and \(s_i\). Resuls yielding \(\gcd(n, s_i) = 1\) are retained and the sum is the result of Euler's Totient function.
Regarding to \(n=9\), it is trivial to see that \(1\), \(2\), \(4\), \(5\), \(7\), amd \(8\) are all co-prime to \(9\), therefore,
\[ \phi(9) = 6 \,.\]While some of these may seem quite obvious, they are worth mentioning.
If \(p\) is a prime number, then \(\phi(p) = p - 1\). This should be easy to see as a prime number is only divisible by \(1\) and itself, therefore, the \(\gcd(p, k) = 1\) where \(p\) is prime and \(k\) is any constant.
\(\phi(n)\) is a multiplicative function meaning that it satisifies the form,
For example, \(\phi(6) = 2\) because \(1\) and \(5\) are both relatively prime to \(6\). Since \(2 \vert 6\) and \(3 \vert 6\), we can write \(\phi(6)\) as \(\phi(2 \cdot 3)\).
Leveraging the property we referenced above, since \(2\) and \(3\) are both prime, \(\phi(2) = 1\) and \(\phi(3) = 2\), resulting in \(\phi(6) = 1 \dot 2 = 2\).