In simple (sic) terms, it says that if we have two numbers a and p, where p is a prime number and not a factor of a, then amultiplied by itself p-1 times and then divided by p, will always leave a remainder of 1. In mathematical terms, this is written: ap-1 = 1. For example, if a = 7 and p = 3, then 72 ÷ 3 should leave a remainder of 1, and 49 ÷ 3 does in fact leave a remainder of 1.
Fermat identified a subset of numbers, now known as Fermat numbers, which are of the form of one less than 2 to the power of a power of 2, or, written mathematically, 22n + 1. The first five such numbers are: 21 + 3 = 3; 22 + 1 = 5; 24 + 1 = 17; 28 + 1 = 257; and 216 + 1 = 65,537. Interestingly, these are all prime numbers (and are known as Fermat primes), but all the higher Fermat numbers which have been painstakingly identified over the years are NOT prime numbers, which just goes to to show the value of inductive proof in