Skip to content
← All questions

How is Euler's totient function φ(n)φ(n) defined?

Euler's totient function φ(n)\varphi(n) is defined as the number of integers from 1 to nn that are coprime to nn. Two integers are coprime if their greatest common divisor is 1. The function essentially counts how many numbers in the range [1,n][1, n] share no common factors with nn other than 1.

Conditions

  • nn is a positive integer.
  • The counting range is from 1 to nn inclusive.
  • Coprimality is determined by the greatest common divisor being 1.

Reasoning, step by step

  1. Identify the range of integers to check: from 1 to nn.
  2. For each integer aa in this range, calculate the greatest common divisor of aa and nn, denoted as gcd⁡(a,n)\gcd(a, n).
  3. Check if gcd⁡(a,n)=1\gcd(a, n) = 1. If it is, aa is coprime to nn.
  4. Count the total number of integers aa that satisfy this condition.
  5. The resulting count is the value of φ(n)\varphi(n).

Example

For n=6n=6, the integers from 1 to 6 are 1, 2, 3, 4, 5, 6. The greatest common divisors with 6 are: gcd⁡(1,6)=1\gcd(1,6)=1, gcd⁡(2,6)=2\gcd(2,6)=2, gcd⁡(3,6)=3\gcd(3,6)=3, gcd⁡(4,6)=2\gcd(4,6)=2, gcd⁡(5,6)=1\gcd(5,6)=1, gcd⁡(6,6)=6\gcd(6,6)=6. Only 1 and 5 have a greatest common divisor of 1 with 6. Therefore, φ(6)=2\varphi(6) = 2.

Common misconceptions

  • Believing that φ(n)\varphi(n) counts the number of prime factors of nn.
  • Thinking that φ(n)\varphi(n) includes 0 in the counting range (the range is strictly 1 to nn).
  • Confusing coprime with prime; a number can be coprime to nn without being prime itself (e.g., 1 is coprime to 6 but is not prime).

Watch the explanation

Explore next

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.