The following image is the necklace proof of Fermat's little theorem taken from https://artofproblemsolving.com/wiki/index.php/Fermat%27s_Little_Theorem#Proof_3_.28Combinatorics.29
My understanding of this proof is is that there is no need for p to be a prime number. And that for all p, where p is any positive integer, the proof given below should hold. Where am I being wrong ?
P.S: Fermat's little theorem states that if p is a prime number, then for any integer a, the number (a^p − a) is an integer multiple of p.
