I know Fermat's Little Theorem = Fermat-Euler's Totient Theorem when $n$ is prime.
Elementary Number Theory, Jones, p83 writes
if we simply replace p with a composite integer n, then the resulting congruence $ a^{n-1} \equiv 1 \; (mod \, n) $ is not generally true. If gcd(a, n) > 1, then any positive power of a is divisible by d, so it cannot be congruent to 1 mod (n).
Can someone please amplify these 2 sentences? Is there intuition? I tried to prove this -
n composite means $gcd(a,n) > 1$. Dub $gcd(a,n) = g$. By definition of g, $g|a$ and $g|n$.
Thence $g|a \implies g|a^k $ for all $k \ge 1$. Then?
To fill in your 'then': "Then: $g|a^k$, and in particular $g|a^{n-1}$. Also, we have $g|n$ (by definition), so $g$ divides any linear combination of $a^{n-1}$ and $n$. Since $a^{n-1}\pmod n$ is such a linear combination (it's $1\cdot a^{n-1}-b\cdot n$, where $b=\lfloor \frac{a^n-1}{n}\rfloor$), then $g|a^{n-1}\pmod n$."