Number System

Euler’s Totient Function

A pupil marks selected positions around a ring.

Euler’s Totient Function definition

Euler’s totient function φ(n) counts the integers from 1 through n that are coprime to n.

In Spanish
función phi de Euler
Topic
Number theory

Euler’s Totient Function in a picture

Euler’s Totient Function diagramFor 8, exactly the odd residues from 1 through 8 are coprime to 8.n = 8Check 1 through 81, 3, 5, 7Each has gcd 1 with 8φ(8) = 4Count those entries
For 8, exactly the odd residues from 1 through 8 are coprime to 8.

How it works

For a prime p, φ(p) = p − 1. For a prime power pᵏ, only multiples of p fail, so φ(pᵏ) = pᵏ − p^(k − 1). For coprime a and b, φ(ab) = φ(a)φ(b). Euler’s theorem gives a^φ(n) ≡ 1 (mod n) when a and n are coprime and n > 1.

Worked examples

Find φ(7).

6, because 7 is prime.

Find φ(9).

9 − 3 = 6.

Find φ(15).

φ(3)φ(5) = 2 × 4 = 8.

Common mistake

Count coprime residues, not merely prime numbers. For example, 9 is coprime to 10 even though 9 is composite.

Quick check

What does φ(n) count?

Show answer

Integers in the stated range that are coprime to n.

What is φ(1) under this definition?

Show answer

1.

When can you multiply φ(a) and φ(b) to get φ(ab) using this rule?

Show answer

When a and b are coprime.

Sources

Flashcard

Euler’s Totient Function

Reveal the definition

Euler’s totient function φ(n) counts the integers from 1 through n that are coprime to n.

Effortless Math. “Euler’s Totient Function.” Math Dictionary.