next up previous
Next: Euler's Theorem Up: Contents Previous: Prime factorization

Euler's phi function tex2html_wrap_inline120

The mathematician Leonhard Euler defined the function tex2html_wrap_inline120 by the rule tex2html_wrap_inline120 = the number of mod x standard names that are relatively prime to x.

In this class, we use two formulas for tex2html_wrap_inline120 .

If m is a prime number then tex2html_wrap_inline134 . This formula holds because every number from 0 to m-1 is relatively prime to m except 0.

If m is the product of two distinct primes p and q then

displaymath146

This formula holds because every number from 0 to m-1 is relatively prime to m except the following numbers.

displaymath152

and

displaymath154

There are q-1 in the first list and p-1 in the second list, for a total of (q-1)+(p-1), except that 0 appeared in both list, so the real total is (q-1)+(p-1)-1. Thus the number of numbers from 0 to m-1 that are relatively prime is the total number of numbers from 0 to m-1, namely m, minus the number that are not relatively prime, namely (q-1)+(p-1)-1. Replacing m by pq, we get

displaymath176

Note that tex2html_wrap_inline178 , which is the same as pq-((q-1)+(p-1)-1). Thus tex2html_wrap_inline182 .

When p and q are small numbers, tex2html_wrap_inline188 is noticeably smaller than pq. For example, tex2html_wrap_inline192 is tex2html_wrap_inline194 , which is 2. Another example: tex2html_wrap_inline196 . However, when p and q get really big, pq is enormous, so the difference between pq and pq-((q-1)+(p-1)-1) is really not so significant. For example, say p=9871 and q=9533. Then pq=94100243 and tex2html_wrap_inline214 . If you picked a random number between 0 and pq-1, it would most likely be relatively prime to pq.



Lisa Eckstein
Mon Oct 21 22:46:13 EDT 1996