10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

180 Chapter 4 PRIMALITY PROVING<br />

Let M(p) be the number of modular multiplications (with integers not<br />

exceeding p) needed to prove p prime using Theorem 4.1.8 to traverse the<br />

Lucastreeforp, and using binary addition chains for the exponentiations<br />

(see Algorithm 2.1.5).<br />

For example, consider p = 1279:<br />

3 1278/2 ≡−1 (mod 1279), 3 1278/6 ≡ 775 (mod 1279),<br />

2 2/2 ≡−1(mod3),<br />

3 1278/142 ≡ 498 (mod 1279),<br />

7 70/2 ≡−1 (mod 71), 7 70/10 ≡ 14 (mod 71),<br />

2 4/2 ≡−1(mod5),<br />

7 70/14 ≡ 51 (mod 71),<br />

3 6/2 ≡−1(mod7), 3 6/6 ≡ 3(mod7),<br />

2 2/2 ≡−1(mod3).<br />

If we use the binary addition chain for each exponentiation, we have the<br />

following number of modular multiplications:<br />

1278/2 : 16<br />

1278/6 : 11<br />

1278/142 : 4<br />

2/2 : 0<br />

70/2 : 7<br />

70/10 : 4<br />

70/14 : 3<br />

4/2 : 1<br />

6/2 : 2<br />

6/6 : 0<br />

2/2 : 0.<br />

Thus, using binary addition chains we have 48 modular multiplications, so<br />

M(1279) = 48.<br />

The following result is essentially due to [Pratt 1975]:<br />

Theorem 4.1.9. For every odd prime p, M(p) < 2lg 2 p.<br />

Proof. Let N(p) be the number of (not necessarily distinct) odd primes in<br />

the Lucas tree for p. We first show that N(p) < lg p. Thisistrueforp =3.<br />

Suppose it is true for every odd prime less than p. Ifp − 1isapowerof2,<br />

then N(p) =1< lg p. Ifp − 1 has the odd prime factors q1,...,qk, then, by<br />

the induction hypothesis,<br />

k<br />

k<br />

<br />

p − 1<br />

N(p) =1+ N(qi) < 1+ lg qi =1+lg(q1 ···qk) ≤ 1+lg < lg p.<br />

2<br />

i=1<br />

i=1

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

Saved successfully!

Ooh no, something went wrong!