Skip to main content

Euler Totient Calculator – φ(n) Coprimes

Quick answer

φ(n) counts integers ≤n coprime to n: φ(12)=4 (1,5,7,11), φ(9)=6, φ(p)=p−1.

  • Multiplicative rules and RSA links explained.

Figures are estimates from this calculator’s standard formula — adjust the inputs in the tool below for your exact number.

How the Euler Totient Calculator Works

φ(n) = n·Π(1 − 1/p) over distinct primes p | φ(p) = p−1 | φ(pᵏ) = pᵏ − pᵏ⁻¹

Euler’s totient counts how many integers from 1 to n share no factor with n. For 12 = 2²×3: φ(12) = 12×(1−½)×(1−⅓) = 12×½×⅔ = 4 — the coprimes 1, 5, 7, 11, which the calculator lists. For prime powers, φ(9) = 9−3 = 6 (removing multiples of 3). Primes are maximal: φ(13) = 12 since nothing below shares a factor. The function is multiplicative on coprime factors: φ(10) = φ(2)×φ(5) = 1×4 = 4. The tool factorizes n, applies the product formula with each (1−1/p) shown, lists the coprimes for small n, and displays Euler’s theorem: a^φ(n) ≡ 1 (mod n) for gcd(a,n)=1 — the engine behind RSA, where ed ≡ 1 (mod φ(n)) pairs keys. For n = 1, φ(1) = 1 by convention.

  1. 1

    Enter n

    Any positive integer

  2. 2

    Factorize

    Distinct primes of n are extracted (12 → 2, 3)

  3. 3

    Apply the product formula

    n·Π(1−1/p) with each factor evaluated

  4. 4

    List the coprimes

    Small n show the actual coprime set (1, 5, 7, 11)

Use Cases

RSA Key Generation

Private exponent d solves e·d ≡ 1 (mod φ(n))

Number Theory

Verify multiplicativity: φ(10) = φ(2)·φ(5) = 4

Euler’s Theorem

Powers reduce mod n via exponents mod φ(n)

Tips

  • 1

    φ(p) = p−1 for every prime p

  • 2

    Product formula: φ(12) = 12·(1−½)·(1−⅓) = 4

  • 3

    φ is multiplicative on coprime inputs

Common Mistakes

  • Computing φ(pᵏ) as pᵏ−1 instead of pᵏ−pᵏ⁻¹

  • Using all prime factors with multiplicity — only distinct primes enter the formula

  • Assuming φ is additive: φ(m+n) ≠ φ(m)+φ(n) in general

  • Forgetting φ(1) = 1

FAQs

What is φ(12)?

4 — the coprimes below 12 are 1, 5, 7 and 11.

What is φ(9)?

6, from the prime-power rule 9 − 3: drop the multiples of 3.

Why is φ(p) = p−1?

A prime shares factors with nothing below it, so all p−1 smaller integers qualify: φ(13) = 12.

Is φ multiplicative?

For coprime m, n yes: φ(10) = φ(2)·φ(5) = 1×4 = 4.

Where is φ used in cryptography?

RSA chooses d with e·d ≡ 1 (mod φ(n)), built on Euler’s theorem a^φ(n) ≡ 1.