]> Number Theory - Units and the Totient Function

Units and the Totient Function

If y n is invertible (that is, if y 1 exists), then we say y is a unit. The set of units of n is denoted by n *, or n ×.

We know y is a unit if and only if y and n are coprime. So the size of n * is precisely the number of integers in {1 ,...,n1 } that are coprime to n.

We write ϕ(n) for the number of elements of n *. The function ϕ(n) is called the Euler totient function. Actually, it turns out to be convenient to have ϕ(1 )=1 , so we prefer to define ϕ(n) as the number of integers in {1 ,...,n} coprime to n. (This agrees with our original definition except when n=1 .)

Examples: ϕ(6 )=2 since among {1,...,6 } only 1 and 5 are coprime to 6 , and thus are the only units in 6 .

Let p be a prime. Then every nonzero element a p is coprime to p (and hence a unit) thus we have ϕ(p)=p1 .

How about powers of primes? If p is a prime, then the only numbers not coprime to p k are the multiples of p, and there are p k/p=p k1 of these. Hence

ϕ(p k)=p kp k1

Now let m,n be coprime, and let x mn. Let a=x(modm) and b=x(modn) (we reduce x modulo p and q). Then by the Chinese Remainder Theorem, x is a unit if and only if a and b are. Thus pq *= p *× q *.

Looking at the size of these sets gives this fact: for p,q coprime, we have

ϕ(pq)=ϕ(p)ϕ(q).

(Thus ϕ is multiplicative.)

Putting this together with the previous statement ϕ(p k)=p kp k1 for prime p, we get that for any integer n=p 1 k 1 ...p m k m (where we have factorized n into primes) we have

ϕ(n)=(p 1 k 1 p 1 k 1 1 )...(p m k mp m k m1 )

Often this formula is rewritten as

ϕ(n)=n(1 1 p 1 )...(1 1 p m)