Euler Totient Calculator

φ(n) = count of coprimes

CalculatorsFreeNo Signup
4.2(535 reviews)
All Tools

Loading tool...

About Euler Totient Calculator

An Euler totient function calculator computing φ(n) = n·Π(1−1/p) for prime p|n. Shows prime factorization, coprime count, and totient properties. Verifies Euler's theorem: aᶲ⁽ⁿ⁾≡1 (mod n). All calculations are client-side. Essential for RSA and number theory.

Euler Totient Calculator Features

  • φ(n)
  • Prime factorization
  • Coprime list
  • Euler theorem
  • Properties
Euler's totient: φ(n) = count of 1≤k≤n with gcd(k,n)=1. Formula: φ(n) = n·Π(1−1/p) over prime divisors p of n. Properties: φ(p)=p−1, φ(pᵏ)=pᵏ−pᵏ⁻¹, multiplicative: φ(mn)=φ(m)φ(n) when gcd(m,n)=1. Euler's theorem: aᶲ⁽ⁿ⁾≡1 (mod n).

How to Use

Enter n:

  • n: Positive integer
  • φ(n): Totient value
  • Factors: Prime factorization

Properties

  • Multiplicative: φ(mn)=φ(m)φ(n) when coprime
  • Σ_{d|n} φ(d) = n
  • φ(p) = p−1 (prime)
  • φ(2ⁿ) = 2ⁿ⁻¹

Applications

  • RSA key generation
  • Primitive roots
  • Multiplicative group structure
  • Counting in cyclic groups

Step-by-Step Instructions

  1. 1Enter n.
  2. 2Get φ(n).
  3. 3View prime factors.
  4. 4See coprime list.
  5. 5Verify Euler's theorem.

Euler Totient Calculator — Frequently Asked Questions

How is φ used in RSA?+

RSA: n=pq, φ(n)=(p−1)(q−1). Choose e coprime to φ(n), find d=e⁻¹ mod φ(n). Public key (n,e), private key d. Encryption: c=mᵉ mod n. Decryption: m=cᵈ mod n. Works because cᵈ = mᵉᵈ = m^(1+kφ(n)) ≡ m (mod n).

What is Euler's theorem?+

If gcd(a,n)=1, then aᶲ⁽ⁿ⁾ ≡ 1 (mod n). Fermat's little theorem is the special case: aᵖ⁻¹ ≡ 1 (mod p) for prime p. This is why RSA decryption works.

How do I compute φ(n) efficiently?+

Factor n = p₁ᵏ¹···pᵣᵏʳ, then φ(n) = n·(1−1/p₁)···(1−1/pᵣ). The bottleneck is factoring. For small n, trial division. For large n, factoring is hard (which is why RSA is secure!).

Share this tool: