Euler's theorem is a generalization of Fermat's little theorem dealing with powers of integers modulo positive integers. It arises in applications of elementary number theory, including the theoretical underpinning for the RSA cryptosystem.

Euler's theorem says, if is a positive integer, and let be an integer that is relatively prime to . Then

where is Euler's totient function, which counts the number of positive integers less than that is also relative prime to