Fermat's little theorem states that
if $n$ is a prime number then $a^n \equiv a \pmod n$.
if $a$ and $n$ are coprime integers then $a^m \equiv a \pmod n$.
, where $m=\phi(n)+1$ for Euler's theorem and $m=\lambda(n)+1$ for Carmichael's theorem.
That theorems are pretty amazing and simplify modular calculations a lot.
But what if $a$ and $n$ aren't coprimes? Are there some generalisations to previous theorems for arbitrary $a$ and $n$, or for $a$ and $n$ with even more relaxed requirements?