Tip: You can press Enter after typing your number.
What This Euler Totient Calculator Does
This calculator computes Euler’s totient function, written as φ(n), for any positive integer you provide. The totient function tells you how many integers from 1 to n are relatively prime to n (that is, they share no common factors with n other than 1).
In addition to the final value, the tool also shows:
- The prime factorization of your input
- The product formula used to compute φ(n)
- Step-by-step simplification
- A list of coprime numbers for small values of n
Euler’s Totient Function: Quick Definition
For a positive integer n, Euler’s totient function is:
Example: for n = 9, the numbers coprime to 9 are 1, 2, 4, 5, 7, and 8, so φ(9) = 6.
How the Formula Works
If the distinct prime factors of n are p1, p2, ..., pr, then:
This is equivalent to removing, proportionally, all numbers divisible by each prime factor of n. It is fast and exact when we know the prime factorization.
Special Cases You Should Know
- φ(1) = 1
- If p is prime, φ(p) = p - 1
- If n = pk, then φ(n) = pk - pk-1
- If gcd(a, b) = 1, then φ(ab) = φ(a)φ(b) (multiplicative property)
Worked Examples
Example 1: n = 36
Prime factorization: 36 = 22 × 32
Example 2: n = 49
Prime factorization: 49 = 72
Example 3: n = 101 (prime)
Why Euler’s Totient Function Matters
Euler’s totient function appears in many areas of number theory and cryptography:
- RSA encryption: security and key generation depend on totients of large semiprimes.
- Modular arithmetic: Euler’s theorem uses φ(n) to simplify large powers modulo n.
- Reduced fractions: counts fractions in simplest form with denominator n.
- Group theory: gives the size of the multiplicative group modulo n.
Using This Calculator Effectively
- Enter a positive integer n.
- Click Calculate φ(n).
- Read the result, factorization, and the formula steps.
- For small n, inspect the explicit coprime list to build intuition.
FAQ
Is φ(n) always smaller than n?
For n > 1, yes. The only case where φ(n) equals n is not possible for n > 1. For n = 1, φ(1) = 1.
Can two different numbers have the same totient value?
Yes. For example, φ(15) = 8 and φ(16) = 8.
Is this useful for cryptography classes?
Absolutely. This tool helps verify hand calculations and understand why RSA uses products of primes.