Units and the Totient Function
If is invertible (that is, if exists), then we say is a unit. The set of units of is denoted by , or .
We know is a unit if and only if and are coprime. So the size of is precisely the number of integers in that are coprime to .
We write for the number of elements of . The function is called the Euler totient function. Actually, it turns out to be convenient to have , so we prefer to define as the number of integers in coprime to . (This agrees with our original definition except when .)
Examples: since among only and are coprime to , and thus are the only units in .
Let be a prime. Then every nonzero element is coprime to (and hence a unit) thus we have .
How about powers of primes? If is a prime, then the only numbers not coprime to are the multiples of , and there are of these. Hence
Now let be coprime, and let . Let and (we reduce modulo and ). Then by the Chinese Remainder Theorem, is a unit if and only if and are. Thus .
Looking at the size of these sets gives this fact: for coprime, we have
(Thus is multiplicative.)
Putting this together with the previous statement for prime , we get that for any integer (where we have factorized into primes) we have
Often this formula is rewritten as