Skip to content

Euler's totient function

The arithmetic function counting residue classes modulo a positive integer that are coprime to it.

Version
v2 · 2026-09-19 · History
Domain-specific #
4438
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomain
Number Theory → Mathematics

Core Idea

For positive n, phi of n counts integers from one through n with greatest common divisor one with n, equivalently the order of the multiplicative unit group modulo n. Prime factorization removes multiples of each distinct prime divisor by inclusion–exclusion, yielding n times the product of one minus one over p and multiplicativity on coprime arguments. The abstraction is therefore identified by a declared carrier, a transformation or constraint over that carrier, and an invariant that tells an analyst whether the named structure is genuinely present.

How would you explain it like I'm…

The No-Sharing Count

Pick a number, like 6, and look at 1, 2, 3, 4, 5, 6. Cross out every number that can be split into equal groups in the same way 6 can, by 2s or by 3s. Only 1 and 5 are left, so the answer for 6 is 2. Euler's totient function is that count of leftover numbers.

Counting No-Sharing Numbers

Euler's totient function, written φ(n), counts how many numbers from 1 to n have no common factor with n except 1. For example, φ(10) = 4, because only 1, 3, 7 and 9 share no factor with 10. There is a shortcut that uses the prime numbers that divide n. For each of those primes, you remove the numbers that are multiples of it. If n is a prime, φ(n) = n − 1, since every smaller number shares no factor with it.

Coprime Counting Function

For a positive integer n, Euler's totient φ(n) is the number of integers k with 1 ≤ k ≤ n and gcd(k, n) = 1. Equivalently, it counts the remainders mod n that have a multiplicative inverse. If the distinct primes dividing n are p₁, …, p_r, inclusion–exclusion gives φ(n) = n·(1 − 1/p₁)(1 − 1/p₂)…(1 − 1/p_r). For example, φ(12) = 12·(1/2)·(2/3) = 4, counting 1, 5, 7, and 11. The function is multiplicative: φ(ab) = φ(a)φ(b) when a and b are coprime. That condition matters, since φ(4) = 2 but φ(2)·φ(2) = 1.

 

Euler's totient function φ is defined for positive integers n as the number of k with 1 ≤ k ≤ n and gcd(k, n) = 1. Equivalently, φ(n) is the order of the unit group (ℤ/nℤ)×, the residues mod n that have multiplicative inverses. Inclusion–exclusion over the distinct prime divisors p of n removes their multiples and gives φ(n) = n∏_{p|n}(1 − 1/p). It follows that φ is multiplicative on coprime arguments: φ(mn) = φ(m)φ(n) when gcd(m, n) = 1. This multiplicativity does not extend to arbitrary products; for example, φ(4) ≠ φ(2)². To use the function correctly, you must fix the domain of positive n, the coprimality convention (so that φ(1) = 1), and which residues are counted. The unit-group view is what links φ to modular arithmetic.

Scope of Application

Euler's totient function belongs to number theory and is useful where the analyst can specify the typed number theory carrier, including its objects, relations, parameters, conventions, evidence, boundary cases, and comparison targets, then evaluate the positive integer n, coprimality convention, counted residue representatives, equivalent unit group, prime-factor formula and multiplicativity conditions are explicit. The scope is broad within that domain but bounded by the need for the positive integer n, coprimality convention, counted residue representatives, equivalent unit group, prime-factor formula and multiplicativity conditions are explicit. The entry records a descriptive analytical identity; practical use requires the governing domain's evidence, standards, and safety obligations.

Clarity

The abstraction clarifies a crowded vocabulary by making the positive integer n, coprimality convention, counted residue representatives, equivalent unit group, prime-factor formula and multiplicativity conditions are explicit the center of the account. A claim should name the carrier, the governing operation or relation, the applicable assumptions, and the recognition test. A bare label is insufficient because the name Euler's totient function can be used for a formal identity, an implementation, or a neighboring result unless carrier and convention are stated.

Manages Complexity

Without the abstraction, an analyst must reason directly over many local details: the carrier roles, admissibility assumptions, competing conventions, derived invariants, boundary cases, and proof or validation obligations specific to Euler's totient function. Euler's totient function compresses them into the roles in the structural signature. That compression permits comparison across instances without erasing the variables that determine validity. It also exposes which details may be varied safely and which are constitutive.

Abstract Reasoning

  1. Identify the carrier. State what the elements, states, objects, or observations are: the typed number theory carrier, including its objects, relations, parameters, conventions, evidence, boundary cases, and comparison targets. Reject examples whose alleged carrier belongs to a different problem.
  2. Lock the constitutive rule. Express the positive integer n, coprimality convention, counted residue representatives, equivalent unit group, prime-factor formula and multiplicativity conditions are explicit independently of one notation or implementation.

Knowledge Transfer

Knowledge transfers strongly among subfields of number theory because they reuse the typed number theory carrier, including its objects, relations, parameters, conventions, evidence, boundary cases, and comparison targets, Prime factorization removes multiples of each distinct prime divisor by inclusion–exclusion, yielding n times the product of one minus one over p and multiplicativity on coprime arguments., and type the carrier, state every parameter and convention in the definition, test that the positive integer n, coprimality convention, counted residue representatives, equivalent unit group, prime-factor formula and multiplicativity conditions are explicit, compare the nearest accepted identity, and report counterexamples, uncertainty, and limiting cases.

Relationships to Other Abstractions

Local relationship map for Euler's totient functionParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Euler's totientfunctionDOMAINPrime abstraction: Cardinality — is a kind ofCardinalityPRIMEDomain-specific abstraction: Perfect Totient Number — presupposesPerfectTotient NumberDOMAIN

Current abstraction Euler's totient function Domain-specific

Parents (1) — outgoing typed relations

  • Euler's totient function is a kind of Cardinality Prime

    It remains its own entry because its identity is fixed by the positive integer n, coprimality convention, counted residue representatives, equivalent unit group, prime-factor formula and multiplicativity conditions.

Children (1) — abstractions linked here by typed relations

  • Perfect Totient Number Domain-specific presupposes Euler's totient function

    Perfect-totient membership requires Euler's totient to generate every post-start value; the function can exist without this number class.

Hierarchy paths (5) — routes to 3 parentless roots

Neighborhood in Abstraction Space

Euler's totient function sits in a crowded region of the domain-specific corpus (1st percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.

Family — Integer Classifications & Arithmetic Functions (45 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-25