Riemann Console dot org

An open research record on the Riemann Hypothesis.

NAV READY · TYPE SHORTCUT · ENTER EXECUTES

Euler's totient function

Category
STANDARD MATHEMATICS
Definition
The function φ(n) that counts the integers from 1 to n that are coprime to n; equivalently, it counts the residue classes modulo n that are coprime to n.
Math Level
GENERAL
Index Excerpt
Euler's totient function; Euler totient; totient; phi function; φ(n); phi(n); reduced residue classes

Start with modulus 10\.

Its possible residue classes can be represented by

0,1,2,3,4,5,6,7,8,9.0,1,2,3,4,5,6,7,8,9.

Which representatives are coprime to 10?

Any even number shares the factor 2 with 10, while 0 and 5 share a factor greater than 1 with 10\. That leaves

1,3,7,9.1,3,7,9.

There are four surviving classes.

Now try modulus 6\. Its representatives are 0, 1, 2, 3, 4 and 5\. Only 1 and 5 are coprime to 6, so there are two.

This counting problem occurs so often that mathematics gives it a function of its own: \\Euler's totient function\\.

It is written using the Greek letter phi, φ\varphi.

The value φ(n)\varphi(n) counts the integers from 1 through nn that are coprime to nn. Equivalently — and more naturally for modular arithmetic — it counts the residue classes modulo nn that are coprime to nn.

Thus

φ(10)=4\varphi(10)=4

and

φ(6)=2.\varphi(6)=2.

(There are several standard ways to choose representatives for residue classes. Using 0,1,…,n−10,1,\ldots,n-1 or using 1,2,…,n1,2,\ldots,n gives the same totient count. What matters is the modular classes being counted, not which representative we write down.)

The totient becomes particularly useful when we organise prime numbers into modular lanes.

Modulo 6, only two of the six classes are coprime to the modulus:

φ(6)=2.\varphi(6)=2.

Apart from the exceptional primes 2 and 3, larger primes must live in those two classes.

Modulo 30,

30=2×3×5,30=2\times3\times5,

and eight of its thirty residue classes are coprime to 30:

φ(30)=8.\varphi(30)=8.

Modulo 210,

210=2×3×5×7,210=2\times3\times5\times7,

and

φ(210)=48.\varphi(210)=48.

This is why turn modulus 210 creates such a striking structure in the Prime Spring. Of the 210 residue classes, 162 share at least one factor with 210\. The remaining 48 survive the divisibility tests imposed by 2, 3, 5 and 7\.

Again, surviving is not the same as being prime. The totient counts classes that are \\coprime to the modulus\\, not classes containing only prime numbers.

Once the counting idea is established, Euler's totient can be calculated directly from the distinct prime factors of nn. If the distinct primes dividing nn are denoted by pp, then

φ(n)=n∏p∣n(1−1p).\varphi(n)=n\prod_{p\mid n}\left(1-\frac1p\right).

(The product symbol ∏\prod means “multiply together”. Here we take one factor (1−1/p)\left(1-1/p\right) for each distinct prime pp dividing nn. Each factor accounts for the fraction of candidates removed by divisibility by that prime.)

For 30, the distinct prime divisors are 2, 3 and 5, so

φ(30)=30(1−12)(1−13)(1−15)=8.\varphi(30)=30\left(1-\frac12\right)\left(1-\frac13\right)\left(1-\frac15\right)=8.

This formula makes the sieve-like structure especially clear. Divisibility by 2 removes one fraction of the classes, divisibility by 3 removes another and divisibility by 5 removes another, with overlaps accounted for by the product.

Euler's totient function therefore measures more than a bare number of lanes. It tells us how much of a modular system remains after classes sharing factors with the modulus have been excluded.

That is why φ(q)\varphi(q) appears naturally in the study of primes in arithmetic progressions. Dirichlet's theorem identifies the residue classes coprime to qq as precisely the classes in which primes occur infinitely often.

A deeper result — the Prime Number Theorem for arithmetic progressions — says that, for fixed qq, the primes become asymptotically equally distributed among those φ(q)\varphi(q) coprime classes, even though substantial fluctuations can remain at finite scales.

(“Asymptotically” means that this equal sharing is a statement about the long-run behaviour as we look farther and farther out among the integers. It does not say that every finite Prime Spring view contains exactly the same number of primes in every surviving lane.)

The function is named after Leonhard Euler, whose work on primes, products and infinite series helped create much of the mathematical setting from which later analytic number theory developed.

See also: coprime, greatest common divisor, residue class, modular arithmetic, prime number, Euler product, distribution of primes, Who was Leonhard Euler?, Prime Spring.

Related glossary terms

  1. [..]CoprimeGLOSSARY · STANDARD MATHEMATICS
  2. [..]Distribution of primesGLOSSARY · RIEMANN HYPOTHESIS
  3. [..]Euler productGLOSSARY · RIEMANN HYPOTHESIS
  4. [..]Greatest common divisorGLOSSARY · STANDARD MATHEMATICS
  5. [..]Modular arithmeticGLOSSARY · STANDARD MATHEMATICS
  6. [..]Prime numberGLOSSARY · RIEMANN HYPOTHESIS
  7. [..]Residue classGLOSSARY · STANDARD MATHEMATICS

Read this term in context

  1. [..]CoprimeARTICLE · ART-RC-0121
  2. [..]Greatest common divisorARTICLE · ART-RC-0122