Topics

where is a prime and isn’t divisible by . Above is a special case of euler’s theorem for modular arithmetic

If  is divisible by , then  is still true while  is false. It follows that the first is always true for any  and being prime, but the second only in the case where .

This is because, to obtain second, we need to multiply the modular multiplicative inverse to both sides of the congruence, and this inverse exists iff a and p are co-prime.