06.01.2015 Views

Cryptology - Unofficial St. Mary's College of California Web Site

Cryptology - Unofficial St. Mary's College of California Web Site

Cryptology - Unofficial St. Mary's College of California Web Site

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

12.1. FERMAT’S THEOREM 233<br />

Example: Since 13 is prime and doesn’t divide 5, we have (5 12 )%13 = 1.<br />

Similarly, 37 and 101 are primes, and they don’t divide 52 and 133, respectively,<br />

so (52 36 )%37 = 1, and (133 100 )%101 = 1.<br />

⋄<br />

This is a beautiful, deep and powerful theorem. The beauty lies in its simplicity:<br />

Choose any prime number and any other number that is not a multiple<br />

<strong>of</strong> that prime. Then, the second number, when raised to the prime minus first<br />

power, will be one less than a multiple <strong>of</strong> the prime. In other words, the remainder<br />

upon division is always 1. No special conditions, no separate cases, just a<br />

1.<br />

OK, there is one condition: that p doesn’t divide the number. But if p<br />

does divide a, then a ≡ 0 (mod p) so a p−1 ≡ 0 (mod p). Thus, we perfectly<br />

understand a p−1 %p for all a’s: If a is a multiple <strong>of</strong> p then the answer is 0,<br />

otherwise it is 1.<br />

Since 1 ∗ a ≡ a (mod p) we may multiply a p−1 ≡ 1 by a to see that a p ≡ a<br />

(mod p) when a is not a multiple <strong>of</strong> p. And, since both sides <strong>of</strong> this equivalence<br />

are 0 when a is a multiple <strong>of</strong> p we have the following corollary:<br />

Corollary 1 If p is a prime number and a is any integer, then a p ≡ a (mod p).<br />

The depth <strong>of</strong> this theorem is what it tells us about arithmetic. One might<br />

think that raising integers to powers leads to somewhat arbitrary results. But<br />

Fermat’s Theorem says otherwise: raising to powers modulo a prime number<br />

produces a definite structure. 3<br />

The power <strong>of</strong> the theorem lies our application <strong>of</strong> it. Suppose we wish to<br />

compute 33 125 %41. Since 41 does not divide 33, by Fermat’s Theorem we<br />

know that 33 40 ≡ 1 (mod 41). So ( 33 40) 2<br />

≡ 1 2 ≡ 1 (mod 41) and, likewise,<br />

( ) 33<br />

40 3<br />

≡ 1 3 ≡ 1 (mod 41). Because 125 = 3 ∗ 40 + 5, we then have<br />

33 125 = 33 3∗40+5 = 33 3∗40 · 33 5 = ( 33 40) 3<br />

· 33 5 ≡ 1 3 · 33 5 ≡ 33 5 (mod 41).<br />

So 33 125 is the same as 33 5 modulo 41. Because 33 5 %41 = 32 is small enough to<br />

compute on a calculator, we conclude that 33 125 %41 = 32. Fermat’s Theorem<br />

has turned the seemingly impossible 33 125 (mod 41) into a calculation that is<br />

easy.<br />

Example: Compute 20 236 %59.<br />

Since 59 − 1 = 58 and 236 = 4 ∗ 58 + 4, we have 20 236 = 20 4∗58+4 =<br />

20 4∗58 · 20 4 = ( 20 58) 4<br />

· 20 4 ≡ 1 4 · 20 4 ≡ 20 4 ≡ 51 (mod 59). ⋄<br />

3 In fact, it can be said that Fermat’s Little Theorem is the first important result in the<br />

subject <strong>of</strong> Abstract Algebra, a subject that, along with Analysis, constitutes most <strong>of</strong> modern<br />

mathematics.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!