In RSA clock arithmetics is used, and as Fermat's little theorem says, a^p mod p = a$a^p \bmod p = a$. The exponentiation is cyclical, a^x = a^(x mod p-1) (mod p)$a^x = a^{x \bmod p-1} \bmod p$, the same sequence of numbers is repeated in each cycle. Is there in a similar way a cycle for all modular exponentiation, or, only for some cases like prime modulo?