Read · 2 min
Euler's totient function for a positive integer is defined as the number of relatively prime numbers to that are less than . This is commonly denoted as . One important and useful property of this function is that it is multiplicative, meaning that if and are relatively prime, then .
However, this is not the only important thing about Euler's totient function; it also has a formula: If where are primes, then
In order to prove this statement, we can use two methods, PIE (Principle of Inclusion and Exclusion) or simple algebra and number theory. I'm going to show the latter; however, we will first prove a simple fact:
If , then . This is very simple to prove. If is the only prime factor of , then the numbers that are not relatively prime with (not including since is relatively prime to every number) are Clearly, there are numbers less than or equal to that are not relatively prime to . Hence, the total number of relatively prime numbers less than or equal to is
Now time for the real proof. Let where are prime. Because the totient function is multiplicative, we can express Using what we just proved in the above paragraph, we can substitute and so on. Substituting these in and rearranging the terms, we get and since , we arrive at which is exactly what we want. Although we now know a formula, sometimes directly using the property that is multiplicative is faster when computing .
However, what is this function used for? One theorem it is used in is Euler's Theorem. Although I won't prove it (see Asif E Elahi's explanation on totient functions for a proof), it says that for any positive integer and that are relatively prime, This is quite useful and we can quickly verify Fermat's Little Theorem, which states that for any where is prime and is a positive integer, Plugging and into Euler's theorem (which is legal since and are relatively prime), we get and since (this is easy to notice), we get exactly what Fermat's Little Theorem says.