EulerPhi

Euler's totient function (SymPy, WMA)
This function counts positive integers up to n that are relatively prime to n.
It is typically used in cryptography and in many applications in elementary number theory.


EulerPhi[n]

returns the Euler totient function .

Compute the Euler totient function:

EulerPhi of a negative integer is same as its positive counterpart:

Large arguments are computed quickly:

EulerPhi threads over lists:

Above, we get consecutive even numbers when the input is prime.

Compare the results above with:

Divisors
FactorInteger