

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


































TopicsTopics
Primes and composites: definitions and theoremsPrimes and composites: definitions and theorems
Greatest common divisor (GCD): definitionGreatest common divisor (GCD): definition
Extended Euclidean algorithmExtended Euclidean algorithm
Bézout’s theorem about GCDsBézout’s theorem about GCDs
Extended Euclidean algorithmExtended Euclidean algorithm
Extended Euclidean algorithmExtended Euclidean algorithm
a = q ∗ b + r 35 = 1 ∗ 27 + 8 27 = 3 ∗ 8 + 3 8 = 2 ∗ 3 + 2 3 = 1 ∗ 2 + 1
GCD( a , b ) GCD( b , a mod b ) r = a mod b GCD(35, 27) = GCD(27, 35 mod 27) = GCD(27, 8) = GCD(8, 27 mod 8) = GCD(8, 3) = GCD(3, 8 mod 3) = GCD(3, 2) = GCD(2, 3 mod 2) = GCD(2, 1) = GCD(1, 2 mod 1) = GCD(1, 0)
GCD(35, 27) = 35 s + 27 t.
Extended Euclidean algorithmExtended Euclidean algorithm
r = a − q ∗ b 8 = 35 − 1 ∗ 27 3 = 27 − 3 ∗ 8 2 = 8 − 2 ∗ 3 1 = 3 − 1 ∗ 2
GCD(35, 27) = 35 s + 27 t.
Extended Euclidean algorithmExtended Euclidean algorithm
r = a − q ∗ b 8 = 35 − 1 ∗ 27 3 = 27 − 3 ∗ 8 2 = 8 − 2 ∗ 3 1 = 3 − 1 ∗ 2
GCD(35, 27) = 35 s + 27 t.
ri = ri − 2 − qi ∗ ri − 1 r 0 = a = 35 r 1 = b = 27 r 2 = r 0 − q 2 ∗ r 1 = 8 r 3 = r 1 − q 3 ∗ r 2 = 3 r 4 = r 2 − q 4 ∗ r 3 = 2 r 5 = r 3 − q 5 ∗ r 4 = 1
Extended Euclidean algorithmExtended Euclidean algorithm
r = a − q ∗ b 8 = 35 − 1 ∗ 27 3 = 27 − 3 ∗ 8 2 = 8 − 2 ∗ 3 1 = 3 − 1 ∗ 2
1 = 3 − 1 ∗ 2 r 5 =^ r 3 −^ q 5 ∗^ r 4. = 3 − 1 ∗ (8 − 2 ∗ 3) Plug in^ r 4 =^ r 2 −^ q 4 ∗^ r 3.
GCD(35, 27) = 35 s + 27 t.
ri = ri − 2 − qi ∗ ri − 1 r 0 = a = 35 r 1 = b = 27 r 2 = r 0 − q 2 ∗ r 1 = 8 r 3 = r 1 − q 3 ∗ r 2 = 3 r 4 = r 2 − q 4 ∗ r 3 = 2 r 5 = r 3 − q 5 ∗ r 4 = 1
Extended Euclidean algorithmExtended Euclidean algorithm
r = a − q ∗ b 8 = 35 − 1 ∗ 27 3 = 27 − 3 ∗ 8 2 = 8 − 2 ∗ 3 1 = 3 − 1 ∗ 2
1 = 3 − 1 ∗ 2 r 5 =^ r 3 −^ q 5 ∗^ r 4. = 3 − 1 ∗ (8 − 2 ∗ 3) Plug in^ r 4 =^ r 2 −^ q 4 ∗^ r 3. = ( − 1) ∗ 8 + 3 ∗ 3 Combine^ r 2 ,^ r 3 terms.
GCD(35, 27) = 35 s + 27 t.
ri = ri − 2 − qi ∗ ri − 1 r 0 = a = 35 r 1 = b = 27 r 2 = r 0 − q 2 ∗ r 1 = 8 r 3 = r 1 − q 3 ∗ r 2 = 3 r 4 = r 2 − q 4 ∗ r 3 = 2 r 5 = r 3 − q 5 ∗ r 4 = 1
Extended Euclidean algorithmExtended Euclidean algorithm
r = a − q ∗ b 8 = 35 − 1 ∗ 27 3 = 27 − 3 ∗ 8 2 = 8 − 2 ∗ 3 1 = 3 − 1 ∗ 2
1 = 3 − 1 ∗ 2 r 5 =^ r 3 −^ q 5 ∗^ r 4. = 3 − 1 ∗ (8 − 2 ∗ 3) Plug in^ r 4 =^ r 2 −^ q 4 ∗^ r 3. = ( − 1) ∗ 8 + 3 ∗ 3 Combine^ r 2 ,^ r 3 terms. = ( − 1) ∗ 8 + 3 ∗ (27 − 3 ∗ 8) Plug in^ r 3 =^ r 1 −^ q 3 ∗^ r 2. = 3 ∗ 27 + ( − 10) ∗ 8 Combine^ r 1 ,^ r 2 terms.
GCD(35, 27) = 35 s + 27 t.
ri = ri − 2 − qi ∗ ri − 1 r 0 = a = 35 r 1 = b = 27 r 2 = r 0 − q 2 ∗ r 1 = 8 r 3 = r 1 − q 3 ∗ r 2 = 3 r 4 = r 2 − q 4 ∗ r 3 = 2 r 5 = r 3 − q 5 ∗ r 4 = 1
Extended Euclidean algorithmExtended Euclidean algorithm
r = a − q ∗ b 8 = 35 − 1 ∗ 27 3 = 27 − 3 ∗ 8 2 = 8 − 2 ∗ 3 1 = 3 − 1 ∗ 2
1 = 3 − 1 ∗ 2 r 5 =^ r 3 −^ q 5 ∗^ r 4. = 3 − 1 ∗ (8 − 2 ∗ 3) Plug in^ r 4 =^ r 2 −^ q 4 ∗^ r 3. = ( − 1) ∗ 8 + 3 ∗ 3 Combine^ r 2 ,^ r 3 terms. = ( − 1) ∗ 8 + 3 ∗ (27 − 3 ∗ 8) Plug in^ r 3 =^ r 1 −^ q 3 ∗^ r 2. = 3 ∗ 27 + ( − 10) ∗ 8 Combine^ r 1 ,^ r 2 terms. = 3 ∗ 27 + ( − 10) ∗ (35 − 1 ∗ 27) Plug in^ r 2 =^ r 0 −^ q 2 ∗^ r 1.
GCD(35, 27) = 35 s + 27 t.
ri = ri − 2 − qi ∗ ri − 1 r 0 = a = 35 r 1 = b = 27 r 2 = r 0 − q 2 ∗ r 1 = 8 r 3 = r 1 − q 3 ∗ r 2 = 3 r 4 = r 2 − q 4 ∗ r 3 = 2 r 5 = r 3 − q 5 ∗ r 4 = 1