Toolstia / Euler totient calculator
Euler totient calculator
Euler totient phi(n) counts the numbers from 1 to n that share no factor with n. Enter a whole number up to a quadrillion and get phi(n), its prime factors, the number of divisors and the sum of divisors.
The totient phi(n) counts the numbers from 1 to n that have no common factor with n. It is found from the prime factors: for each prime p, multiply by (1 - 1/p). It is used in RSA encryption and in Euler theorem. Numbers up to 10^15 work.
How it works
- Enter a whole number.
- Read phi(n) and the prime factors.
- Check the divisor count and sum.
How it is found
Factor n into primes. For each prime p, multiply by (1 minus 1/p). For a prime p, phi(p) is p minus 1.
Divisors
The number of divisors multiplies (exponent plus 1) for each prime. The sum of divisors multiplies 1 plus p plus up to p to the exponent.
RSA
In RSA, the totient of the product of two primes is used to find the private key.
Limits
Numbers up to 10^15 are supported. Larger numbers take too long to factor in a browser.
Questions
Is my number sent anywhere?
Everything happens in your browser, and nothing you enter is sent anywhere.
What is phi(1)?
It is 1, because 1 shares no factor with itself other than 1.
How do I know a number is prime?
If phi(n) equals n minus 1, then n is prime. The tool also shows this directly.