In RSA clock arithmetics is used, and as Fermat's little theorem says, a^p mod p = a. The exponentiation is cyclical, a^x = a^(1 + x mod p) (mod 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? And why? *This question is related to cryptography because I ask it in the context of learning RSA.*