A magistrate by profession, Fermat was passionate about mathematics—especially arithmetic—and always had many friends who were equally passionate about mathematics. It was in a letter to one of them, Bernard Frenicle de Bessy—a mathematician, astronomer and mechanic, as well as a specialist in number theory and combinatorics—that, on October 18, 1640, he first revealed the statement that would later become known as Fermat's little theorem. The result has since found applications right up to the present day.
A wealth of explanations -------------------------
"Every prime number invariably divides one of the powers minus 1 in any progression whatsoever, and the exponent of that power divides the given number minus 1; and once the first power satisfying the question has been found, all those whose exponents are multiples of the exponent of the first also satisfy the question." Such was the statement Fermat wrote to his friend (see box)…

An exegesis of Fermat's text.