Fermat's Little Theorem
Updated
This is an oldie, but a cute little trick to solving Fermat’s Little Theorem that I came across back when I was an undergraduate. This is a well known proof and can be found in Wikipedia1, although I found this proof in an article posted by Fermat’s Library 2.
Theorem (Fermat’s Little Theorem).
If is a prime number and for , then .
Proof.
Let’s say that you want to make as many distinct types of necklaces as you can with (colourless) beads at your disposal, and where you can colour each bead with different colours. Assume also you only want to make multi-coloured necklaces, and that is prime.
What we can initially do is put all of our beads on some open-ended string, which we’ll call a chain, and once we join the ends of our chain, we will get a necklace. On each bead, we can choose from colours, and therefore we can make such chains. If one wishes, one can make a whole chain, and therefore necklace, of one colour, and as there are colours to choose from, we can make distinct monotone chains. Since we only wish to make multi-coloured necklaces, we are left with potential chains, e.g. R-G-G, R-G-B.
Combining the ends of our chains, we now make a necklace. We notice straight away that some necklaces are identical up to a rotation (i.e. cyclic permutation), e.g. the necklace from the chain R-G-B is the same as from the chains G-B-R and B-R-G after a rotation. Since there are beads in each necklace, and is prime, each necklace has identical (up to rotation) necklaces. Therefore, we can make (an integer) distinct necklaces, i.e. , which concludes our proof.