purpose
Euler\u2019s Totient Calculator
Compute Euler\u2019s totient \u03C6(n) \u2014 the count of integers coprime to n. Used in RSA cryptography.
Click to show tips
Try an Example
Pick a scenario to see how the calculator works, then adjust the values
Highly Composite Number
Factor 360, a highly composite number with many divisors.
Key values: 360 = 2^3 x 3^2 x 5 · 24 divisors · phi(360) = 96
Large Prime
Check if 7919 is prime (it is -- the 1000th prime number).
Key values: 7919 is prime · 2 divisors · phi(7919) = 7918
GCD and LCM
Compute the GCD and LCM of 84 and 120.
Key values: 84 = 2^2 x 3 x 7 · 120 = 2^3 x 3 x 5 · GCD = 12, LCM = 840
Euler's Totient Function
Euler's totient function counts how many integers in the range [1, n] are coprime to (share no common factor other than 1).
The product runs over all distinct prime factors of . For a prime , (every number from 1 to is coprime to a prime).
RSA Cryptography Connection
Euler's totient is the mathematical backbone of RSA encryption, the most widely used public-key cryptosystem:
- Choose two large primes and
- Compute (the public modulus)
- Compute (the secret)
- Choose public exponent coprime to
- Compute private exponent
Security relies on the difficulty of factoring to recover and , and hence .
Scale of the problem: For , — trivial with small primes. But for 1024-bit primes (each ~300 digits), the factorization is computationally infeasible with current technology.
Euler's Theorem
Euler's theorem generalizes Fermat's little theorem: if , then:
This is the mathematical foundation that makes RSA decryption work: raising to the private exponent reverses the public encryption because .
Frequently Asked Questions
What does Euler's totient function calculate?
Euler's totient function counts how many integers from 1 to are coprime to , meaning they share no common factor other than 1. For example, because the integers 1, 5, 7, and 11 are coprime to 12.
How do I compute phi(n) from the prime factorization?
Use the formula where the product runs over all distinct prime factors of . For example, .
Why is the totient function important in RSA encryption?
RSA encryption relies on where for two large primes. The public and private keys satisfy . Security depends on the fact that computing requires knowing and , and factoring large is computationally infeasible.
What is Euler's theorem?
Euler's theorem states that if , then . This generalizes Fermat's little theorem (where is prime). It is the mathematical foundation that makes RSA decryption work, because raising to the private exponent reverses the public encryption.
What is the totient of a prime number?
For any prime , , because every integer from 1 to is coprime to a prime. More generally, for a prime power , .
Related purpose Variants
Explore more purpose options
More Math Calculators
Explore the category