Euler's totient function

The first thousand values of φ(n). The points on the top line represent φ(p) when p is a prime number, which is p − 1.[1]

In number theory, Euler's totient function counts the positive integers up to a given integer n that are relatively prime to n. 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 k in the range 1 ≤ kn for which the greatest common divisor gcd(n, k) is equal to 1.[2][3] The integers k of this form are sometimes referred to as totatives of n.

For example, the totatives of n = 9 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 gcd(9, 3) = gcd(9, 6) = 3 and gcd(9, 9) = 9. Therefore, φ(9) = 6. As another example, φ(1) = 1 since for n = 1 the only integer in the range from 1 to n is 1 itself, and gcd(1, 1) = 1.

Euler's totient function is a multiplicative function, meaning that if two numbers m and n are relatively prime, then φ(mn) = φ(m)φ(n).[4][5] This function gives the order of the multiplicative group of integers modulo n (the group of units of the ring ).[6] It is also used for defining the RSA encryption system.

  1. ^ "Euler's totient function". Khan Academy. Retrieved 2016-02-26.
  2. ^ Long (1972, p. 85)
  3. ^ Pettofrezzo & Byrkit (1970, p. 72)
  4. ^ Long (1972, p. 162)
  5. ^ Pettofrezzo & Byrkit (1970, p. 80)
  6. ^ See Euler's theorem.