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.
Example.
Input:
Output:
12 |
In other words the set of integers less than 21 and coprime with 21, {2,4,5,7,8,10,11,13,15,16,17,19}, has 12 elements.
The little Fermat theorem states:
Euler introduced his phi function to generalize the little Fermat theorem:
Example.
Input:
(see section Section 6.34.10)
Output:
1 |