Fermat's Little Theorem

Fermat's Little Theorem states, if \(p\) is a prime number and \(a\) is an integer, \(a^p\equiv a\) (mod \(p\)). The theorem itself is used and is very helpful when testing numbers to see if they are not prime. It can be easy to see whether a small number is not prime however, with big numbers it can be difficult. One of the most important things to note is that the theorem does not tell whether a number is prime but it does show if a number is not prime. Therefore, the famous theorem also states that if \(p\) does not divide \(a\), then \(a^{p-1}\equiv\) \(1\) (mod \(p\)). 

Although this is known as Fermat's Theorem, surprisingly this was not proven by Fermat. Fermat decided not to prove it because the amount of pages and work it would take to complete it. Euler was the first mathematician to have a proof published in 1749. A picture of the proof is shown below.