Nirmion
Help Find a tool

NUMBER THEORY / COPRIME RESIDUE COUNT

Euler Totient Function Calculator

Count positive integers through n that are coprime to n and expose the prime-factor product.

  • 01 Calculated in this tab
  • 02 Values stay in this browser tab
  • 03 Use boundary

Conversion input

Known value

Filter by unit name, symbol, or code. Your current selections remain available.

Preparing the calculator...

METHOD / WORKED EXAMPLE

Turn prime factors into a coprime count

Euler's totient counts the reduced residue classes modulo n. The product uses each distinct prime once, so the factor list explains exactly how the count was reduced.

WORKED DEFAULT

Check the calculation with the default inputs

For n = 36, the distinct prime factors are 2 and 3. Starting at 36 gives 36 x (1 - 1/2) x (1 - 1/3) = 12, so phi(36) = 12.

  1. Factor the integer36 = 2^2 x 3^2
  2. Keep distinct primesp = 2 and 3
  3. Apply the product36 x 1/2 x 2/3 = 12

READ THE RESULT

Interpret the output in context

The totient is a count, not the list of coprime values. Repeated powers of an existing prime affect n but do not add another distinct product factor.

ASSUMPTIONS AND LIMITS

Know where the model stops

  • n is a positive integer within the stated bound.
  • Coprime means greatest common divisor equal to one.
  • Each distinct prime divisor is applied exactly once.

This deterministic browser calculation is educational number theory; it is not a cryptographic key generator or security review.

COMMON QUESTIONS

Euler Totient Function Calculator FAQs

Does phi(n) count zero as coprime to n?

The standard count here uses positive integers from 1 through n. Zero has gcd(0,n) = n, so it is coprime only in the exceptional modulus-one sense and is not added as a separate residue in this count. For n greater than one, the reduced residue system is commonly represented within 1 through n-1.

Why are repeated prime factors used only once?

Euler's product runs over distinct primes dividing n. Removing multiples of p excludes the share divisible by that prime, while higher powers do not define a new divisibility category. Their effect is already present through the original size of n. For example, 2 and 3 each appear once in the product for 36 despite both being squared.

Can this totient result be used directly for encryption?

It can support number-theory study, but secure cryptography requires carefully generated large primes, protected randomness, vetted libraries, side-channel resistance, parameter standards, and key-management controls. This browser tool is bounded at one billion and exposes factors for transparency. It must not generate or validate production cryptographic keys, moduli, or security guarantees.

Use boundary

Calculation path

Factor n into distinct primes, then apply the multiplicative product by subtracting one p-th of the running count for each distinct prime divisor.

Calculation path

phi(n) = n product over distinct p dividing n of (1 - 1/p).