Euler's Totient Function and Euler's Theorem

  • counts positive integers ≤ that are coprime to (share no common factors except 1)
  • Euler's Theorem: if , then generalizes Fermat's Little Theorem
  • measures the exponent of periodicity in modular arithmetic—how many multiplications until cycling back to 1
  • For prime factorization : over prime divisors
  • Central to RSA cryptosystem security; transforms number theory from isolated results into coherent predictive theory
  • The multiplicative group modulo has order , linking counting to group structure

Euler's Totient Function and Euler's Theorem

Overview

Euler's Totient Function, denoted , counts how many positive integers up to are relatively prime to —that is, share no common factors with except 1. This seemingly simple counting question turns out to be one of the most fundamental objects in number theory, connecting divisibility, modular arithmetic, prime factorization, and the structure of multiplicative groups. The totient function appears throughout modern mathematics and computer science, from cryptography to abstract algebra, making it essential knowledge for any student of pure or applied mathematics.

The power of the totient function becomes fully apparent through Euler's Theorem, which generalizes Fermat's Little Theorem and provides a deep connection between counting and congruences. Euler's Theorem states that if and are coprime, then . This elegant result reveals that the totient function measures the exponent of periodicity in modular arithmetic—it tells us exactly how far we need to raise numbers before they cycle back to 1 modulo .

Leonhard Euler introduced both the totient function and his theorem in the 1760s, building on Fermat's work from a century earlier. These contributions transformed number theory from a collection of isolated observations into a coherent theory with predictive power. The totient function would later prove central to the RSA cryptosystem, making it one of the rare mathematical concepts that directly protects digital communications worldwide.

The totient function counts coprime residues and simultaneously reveals the multiplicative order structure modulo : every number coprime to returns to 1 after exactly multiplications.

Euler's Totient Function: For a positive integer , the Euler totient function (or Euler phi function) is defined as
That is, counts the number of integers between 1 and (inclusive) that are relatively prime to . Euler's Theorem: If is a positive integer and is an integer with , then

Core Theory

Main Results

Theorem 1 (Multiplicativity of ): If , then . Theorem 2 (Explicit Formula): If is the prime factorization of , then
Theorem 3 (Euler's Theorem): If , then . Theorem 4 (Prime Power Formula): For a prime and positive integer ,
Proof of Theorem 4: Among the integers , exactly those that are multiples of share a common factor with . The multiples of in this range are , of which there are . Therefore,
Proof of Theorem 1: We use the Chinese Remainder Theorem. Since , the map
given by is a ring isomorphism. An element is coprime to if and only if is coprime to both and . Under the isomorphism , the units modulo correspond exactly to pairs where is a unit modulo and is a unit modulo . There are choices for and choices for , giving . Proof of Theorem 2: By Theorem 1, is multiplicative, so
By Theorem 4, . Therefore,
Proof of Theorem 3 (Euler's Theorem): Let be the set of reduced residues modulo . Then . Claim: If and , then . Proof of claim: If , then and . Since , any common divisor of and must also divide . Thus , so .

Now consider the set . By the claim, each element is in . Moreover, if , then since , we can cancel to get . Thus multiplication by gives a bijection .

Let . Then is a permutation of modulo . Therefore,

Let . Since each is coprime to , we have . Therefore, we can cancel from both sides:

□

Common Error: Students often try to apply Euler's Theorem without checking that . For example, because . The coprimality condition is essential—the theorem simply doesn't hold otherwise. Similarly, is not the number of primes less than (that's the prime counting function ). Leonhard Euler (1763) — Introduced the totient function and proved Euler's Theorem in his paper "Theoremata arithmetica nova methodo demonstrata," generalizing Fermat's work and founding modern multiplicative number theory. φ(12) = 4: Reduced Residues Modulo 12 0 1 2 3 4 5 6 7 8 9 10 11 gcd(k,12)=1 gcd(k,12)>1 12 = 2² × 3

Examples and Applications

1

Computing using the explicit formula:

First, find the prime factorization: .

Using Theorem 2:

We can verify using multiplicativity:

Therefore, there are exactly 96 integers between 1 and 360 that share no common factors with 360.

2

Using Euler's Theorem to find :

First, check: ✓

Compute .

By Euler's Theorem, .

Now divide the exponent: .

Therefore,

This technique is fundamental in modular exponentiation algorithms used in cryptography.

Why the coprimality condition is necessary:

Consider , . We have , but .

Computing: , so .

Clearly , so Euler's Theorem fails completely when the coprimality hypothesis is dropped. The issue is that is not a unit in —it's a zero divisor, since . The proof fundamentally relies on being able to cancel common factors, which requires working within the group of units.

Visual mental model: Imagine a clock with hours. The totient counts which hour marks are "reachable by coprime steps"—if you can walk around the clock taking steps of size where , you'll eventually hit exactly different hours.

Euler's Theorem says: if you start at 1 and keep multiplying by any coprime number , after exactly steps you return to 1. The totient measures the "period of multiplication" modulo . For prime , every nonzero element works (), which is why Fermat's Little Theorem is cleaner. For composite , precisely captures which elements participate in this multiplicative cycling.

Historical Development

Leonhard Euler introduced in 1763 in his paper Theoremata arithmetica nova methodo demonstrata, though he didn't use the modern notation (that came later, from Carl Friedrich Gauss's Disquisitiones Arithmeticae in 1801). Euler's motivation was to generalize Fermat's Little Theorem, which Pierre de Fermat had stated (without proof) in 1640 for prime moduli. Fermat claimed that if is prime and is not divisible by , then —precisely Euler's Theorem with and .

Euler recognized that the quantity in Fermat's theorem represented the count of nonzero residues modulo , and he generalized this counting to arbitrary moduli. His proof used the permutation argument we presented above, showing deep insight into the group structure of units modulo , though the language of group theory wouldn't be developed for another century.

The explicit product formula for also appears in Euler's work. Gauss later systematized this theory, proved the multiplicativity rigorously using what we now recognize as the Chinese Remainder Theorem, and established the totient function as a central tool in algebraic number theory. The 20th century saw take on new importance in cryptography, particularly in the RSA algorithm (1977), where the security relies on the difficulty of computing without knowing the prime factorization of .

Connections to Other Areas

Connection to Cyclotomic Polynomials and Galois Theory: The totient function equals the degree of the -th cyclotomic polynomial , which is the minimal polynomial of primitive -th roots of unity. Specifically, has degree . This connects elementary number theory to Galois theory: the Galois group of over (where is a primitive -th root of unity) is isomorphic to , the multiplicative group of units modulo , which has order . This bridge between counting coprime integers and field extensions is one of the deepest in mathematics.

What You Need First

What This Opens Up

See Also

Fermat's Little Theorem · Chinese Remainder Theorem · Multiplicative Group of Integers Modulo n · Carmichael Function · Cyclotomic Polynomial · RSA Algorithm

Before this

  • Modular Arithmetic — Euler's Theorem is a statement about congruences, requiring fluency with modular notation and arithmetic operations in $\mathbb{Z}/n\mathbb{Z}$.
  • Greatest Common Divisor — The definition of $\phi(n)$ fundamentally depends on the gcd, and the coprimality condition $\gcd(a,n)=1$ is essential for Euler's Theorem.
  • Prime Factorization — The explicit formula for $\phi(n)$ requires expressing $n$ as a product of prime powers, making [[the Fundamental Theorem of Arithmetic]] indispensable.

Where this leads

  • RSA Cryptography — The RSA algorithm's security and correctness both depend critically on Euler's Theorem and the difficulty of computing $\phi(n)$ without factoring $n$.
  • Primitive Roots — Understanding which elements have multiplicative order exactly $\phi(n)$ modulo $n$ leads to the theory of primitive roots and [[cyclic groups]].
  • Carmichael's Function — A refinement of $\phi(n)$ called $\lambda(n)$ gives the exponent of the group $(\mathbb{Z}/n\mathbb{Z})^*$, leading to stronger versions of Euler's Theorem and deeper structure theory.