Example

The number of invertible elements in Z/6Z can be computed with the formula of the theorem.

(6) = 6 - (1) - (2) - (3) = 6 - 1 - 1 - 2 = 2.