Code tool

Euler Totient Calculator

Enter a positive integer n to calculate Euler’s totient, list its distinct prime factors, and verify the divisor count relationship.

In-browser processingNo account requiredPrivacy details ↗

A QUICK WALKTHROUGH

How to use this tool

  1. Enter a positive integer n with at most 18 decimal digits.
  2. Choose Calculate.
  3. Read φ(n), distinct prime factors, and verification values.

Definition and domain

φ(n) counts integers k with 1≤k≤n and gcd(k,n)=1. This tool accepts 1≤n≤10¹⁸ as an exact integer. JavaScript BigInt is used for the arithmetic; decimal input only, no fractions or signs.

Verification

The result is computed from the distinct prime factors p of n: φ(n)=n∏(1−1/p). The page also reports the factorization and verifies that the listed factors divide n and that the result is an integer. It does not enumerate all coprime values.

GOOD TO KNOW

Common questions

What is φ(1)?

φ(1)=1 because 1 is coprime to itself.

Are large decimals exact?

Yes, within the 18-digit input limit, using BigInt rather than floating point.

Does the tool list every coprime integer?

No. It returns the count and factorization.