Euler's Totient Calculator

Enter n to find how many numbers up to n are coprime to it.

A whole number from 1 to 10^15.

Try

Result

You enteredn=97n = 97

96\displaystyle 96

Prime factorisation

97\displaystyle 97

Numbers from 1 to n sharing a factor with n

1\displaystyle 1
Show the work
  1. Prime factorisation

    The totient depends only on the distinct primes that divide n=97n = 97, so factor it first.

    97=9797 = 97
  2. Euler's product formula

    Each prime pp dividing nn removes the fraction 1/p1/p of the numbers, those that are multiples of pp, and the primes act independently.

    Using φ(n)=n∏p∣n(1−1p)\varphi(n) = n \prod_{p \mid n} \left(1 - \dfrac{1}{p}\right)

    φ(97)=97(1−197)=97×9697=96\begin{aligned} \varphi(97) &= 97\left(1 - \frac{1}{97}\right) \\ &= 97 \times \frac{96}{97} \\ &= 96 \end{aligned}
  3. Result

    So φ(97)=96\varphi(97) = 96, and for a prime pp this is always p−1p - 1.

Worked examples