Dietzfelbinger M. Primality testing in polynomial time ... - tiera.ru
Dietzfelbinger M. Primality testing in polynomial time ... - tiera.ru
Dietzfelbinger M. Primality testing in polynomial time ... - tiera.ru
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
3.2 The Euclidean Algorithm 27<br />
Proposition 3.1.13. For <strong>in</strong>tegers n and m the follow<strong>in</strong>g are equivalent:<br />
(i) n and m are relatively prime, and<br />
(ii) there are <strong>in</strong>tegers x and y so that 1=nx + my.<br />
Proof. (i) ⇒ (ii) is just Proposition 3.1.11 for 1 = gcd(n, m). For the<br />
direction (ii) ⇒ (i), note that if 1 = nx + my, thenn and m cannot be both<br />
0, and every common divisor of n and m also divides 1, hence gcd(n, m) =1.<br />
⊓⊔<br />
For example, for n =20andm =33wehave1=33· (−3) + 20 · 5=<br />
33 · 17 + 20 · (−28). More generally, if nx + my = 1, then clearly n(x + um)+<br />
m(y − un) = 1 for arbitrary u ∈ Z.<br />
We note two consequences of Proposition 3.1.13.<br />
Corollary 3.1.14. For all <strong>in</strong>tegers n, m, andk we have: If n and k are<br />
relatively prime, then gcd(n, mk) =gcd(n, m).<br />
Proof. S<strong>in</strong>ce n and k are relatively prime, we can write 1 = nx + ky for<br />
suitable <strong>in</strong>tegers x, y. This implies m = n(mx) +(mk)y, from which it is<br />
immediate that every common divisor of n and mk also divides m. Thus,<br />
D(n) ∩ D(m) =D(n) ∩ D(mk), which implies the claim. ⊓⊔<br />
Proposition 3.1.15. If n and m are relatively prime <strong>in</strong>tegers, and n and m<br />
both divide k, thennm divides k.<br />
Proof. Assume k = ns and k = mt, for <strong>in</strong>tegers s, t. By Proposition 3.1.13<br />
we may write 1 = nx + my for <strong>in</strong>tegers x and y. Then<br />
k = k · nx + k · my = mt · nx + ns · my =(tx + sy) · nm,<br />
which proves the claim. ⊓⊔<br />
Cont<strong>in</strong>u<strong>in</strong>g the example just mentioned, let us take the number 7920,<br />
which equals 20 · 396 and 33 · 240. Us<strong>in</strong>g the argument from the previous<br />
proof, we see that 7920 = (396 · (−3) + 240 · 5) · (20 · 33) = 12 · (20 · 33).<br />
3.2 The Euclidean Algorithm<br />
The Euclidean Algorithm is a cornerstone <strong>in</strong> the area of number-theoretic algorithms.<br />
It provides an extremely efficient method for calculat<strong>in</strong>g the greatest<br />
common divisor of two natural numbers. An extended version even calculates<br />
a representation of the greatest common divisor of n and m as a<br />
l<strong>in</strong>ear comb<strong>in</strong>ation of n and m (see Proposition 3.1.11). The algorithm is<br />
based on the repeated application of the <strong>ru</strong>le noted as Proposition 3.1.10. We<br />
start with the classical Euclidean Algorithm, formulated <strong>in</strong> the simplest way.<br />
(There are other formulations, notably ones that use recursion.)