The Euler phi function (also called the Euler totient function) finds the number of positive integers less than a given integer and relatively prime. The euler command computes the Euler phi function.
Input:
Output:
12 |
In other words the set of integers less than 21 and coprime with 21, {1,2,4,5,8,10,11,13,16,17,19,20}, has 12 elements.
The little Fermat theorem states:
Euler introduced his phi function to generalize the little Fermat theorem:
Input:
(see Section 5.34.10)
Output:
1 |