Euler's totient function
In number theory, Euler's totient function counts the positive integers up to a given integer that are relatively prime to . It is written using the Greek letter phi as or , and may also be called Euler's phi function. In other words, it is the number of integers in the range for which the greatest common divisor is equal to 1. The integers of this form are sometimes referred to as totatives of .
For example, the totatives of are the six numbers 1, 2, 4, 5, 7 and 8. They are all relatively prime to 9, but the other three numbers in this range, 3, 6, and 9 are not, since and . Therefore, . As another example, since for the only integer in the range from 1 to is 1 itself, and .
Euler's totient function is a multiplicative function, meaning that if two numbers and are relatively prime, then . This function gives the order of the multiplicative group of integers modulo n (the group of units of the ring ). It is also used for defining the RSA encryption system.