Fermat's Theorem
Congruent Modulo
If p is prime and a is a positive integer not divisible by p then:
a(p-1) ≡ 1 mod p is equivalent to ap ≡ a mod p
Let's find out the mod of a divisor with a large exponent. However, first let's use an exponent that isn't extremely large and then afterwards use a large one.
(617) mod(13)
[(612)
* (65)] mod(13)
[(612)
mod(13)] * [(65 mod(13)]
1 *
(65) mod(13) = 2
This example can be done on Calc.exe that comes with the MS Windows operating system. First, you can confirm this by doing 617 mod(13) and the answer will be 2. However, using Fermat's theorem you can obtain the exponent of 12 from 13 - 1 resulting in 612 * 65 = 617. So, according the Fermat's theorem a(p - 1) mod p = 1, we have (612) mod(13) = 1, which leaves something easily calculable 65 mod(13) = 2. Let's now look at a very large exponent:
(52003) mod(7)
[(51998)
* (55)] mod(7)
[(51998)
mod(7)] * [(55) mod(7)]
1 *
(55) mod(7) = 3
The only difference between this problem and the one above is that 1998 is a multiple of p - 1, hence 6 * 333 = 1998. Now what happens when the dividend is very large (or larger than the exponent)? The answer lies within the Chinese Remainder Theorem.
Fermat's Last Theorem.
Since we're talking about Fermat, it is suffice to talk about his famous last theorem. Mathematicians have struggled with finding a solution to Fermat's last theorem, which came about in 1637. Fermat claimed that xn + yn = zn does not have a solution in positive integers x, y, and z for n > 2. However, no one has been able to prove or disprove this. However, interestingly enough, by 1936 Alonzo Church along with Alan Turing was able to show that Fermat's last theorem was not effectively calculable thus was not decidable.
Links
http://www.avernus.org.uk/encrypt.php?article=fermat
http://www.math.okstate.edu/~wrightd/crypt/lecnotes/node19.html
http://www.mbay.net/~cgd/flt/flt08.htm
http://www.aryankindred.com/sniffy/fermat.htm
http://www.public.iastate.edu/~kchoi/time.htm
http://www.bath.ac.uk/~ma0drje/www.Fermat/Fermats%20Theorem.html
http://www.sasquatch.com/~kory/fermats_enigma.html
http://www.cs.utsa.edu/~wagner/laws/AFermat.html