Euler's totient function (also called the Phi function) counts the number of positive integers less than that are coprime to . That is

We can calculate via this formula

where are the distinct primes dividing