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]Compute the Euler totient function:
EulerPhi[9]
EulerPhi
of a negative integer is same as its positive counterpart:
EulerPhi[-11] == EulerPhi[11]
EulerPhi[0]
Large arguments are computed quickly:
EulerPhi[40!]
EulerPhi
threads over lists:
EulerPhi[Range[1, 17, 2]]
Above, we get consecutive even numbers when the input is prime.
Compare the results above with:
EulerPhi[Range[1, 17]]