# Euler's totient function (euler_phi)

Euler's totient: how many whole numbers up to n are coprime to n.

## How to write it

### euler_phi(n)

**n**

A positive whole number. Takes a whole number.

## Examples

- $\displaystyle \varphi(36) = 12$

  `euler_phi(36)`

  In the solver, `euler_phi(36)` gives `12`.

  [Open in the solver](https://hilberon.com/?q=euler_phi%2836%29)

## Related functions

- [euler_e](https://hilberon.com/library/euler_e)

  The n-th Euler number.
- [extended_gcd](https://hilberon.com/library/extended_gcd)

  Greatest common divisor of two whole numbers with the multipliers that give it.
- [factor_integer](https://hilberon.com/library/factor_integer)

  Prime factorization of a whole number, as a list of prime and exponent pairs.
- [divisors](https://hilberon.com/library/divisors)

  The positive divisors of a whole number, in increasing order.
- [fibonacci](https://hilberon.com/library/fibonacci)

  The n-th Fibonacci number, with F(1) = F(2) = 1.
- [divisor_sum](https://hilberon.com/library/divisor_sum)

  Sum of the positive divisors of a whole number.

---
Source: https://hilberon.com/library/euler_phi
