Euler's Totient Function φ(n)
Euler's totient function is equal to the number of positive integers less than or equal to a given number n that are coprime to it.
If two natural numbers are coprime then they share no prime factors
If a is coprime to b then the greatest common factor of a and b is 1 (GCF(a,b) = 1)
Example: p = 7
1, 2, 3, 4, 5 and 6 are coprime to 7
There are 6 positive integers that are less than or equal to 7 and coprime to 7
φ(7) = 6
Example: p = 12
1, 5, 7 and 11 are coprime to 12
There are 4 positive integers that are less than or equal to 12 and coprime to 12.
φ(12) = 4
Example: p = 1
1 is coprime to 1 (GCF(1,1) = 1)
There is one positive integer that is less than or equal to 1 and coprime to 1
φ(1) = 1
Properties of φ(n)
Multiplication rule
If a and b are coprime: φ(ab) = φ(a) × φ(b)
Example: a = 3, b = 4
1 and 2 are coprime to 3. φ(3) = 2
1 and 3 are coprime to 4. φ(4) = 2
φ(12) = φ(3) × φ(4)
φ(12) = 2 × 2 = 4
Sum of values of φ(d) for each divisor of n
Example: n = 12
1, 2, 3, 4, 6 and 12 all divisors of 12
φ(1) = 1, φ(2) = 1, φ(3) = 2 φ(4) = 2, φ(6) = 2, φ(12) = 4
φ(1) + φ(2) + φ(3) + φ(4) + φ(6) + φ(12) = 1 + 1 + 2 + 2 + 2 + 4 = 12
Eulers Theorem
If x and n are coprime then xφ(n) ≡ 1 (mod n)
Example: φ(5) = 4
- 14 = 1 ≡ 1 (mod 5)
- 24 = 16 ≡ 1 (mod 5)
- 34 = 81 ≡ 1 (mod 5)
- 44 = 256 ≡ 1 (mod 5)