Euclidean algorithm: GCD by successive divisions
A systematic method to find the GCD of two integers. Successive divisions, stop when the remainder hits 0.
The principle
doesnβt change if we replace by the remainder of divided by .
Repeat until the remainder is 0. The last nonzero remainder is the GCD.
Step-by-step
Example: .
| Step | Division | Quotient | Remainder |
|---|---|---|---|
| 1 | 252 = 105 Γ 2 + 42 | 2 | 42 |
| 2 | 105 = 42 Γ 2 + 21 | 2 | 21 |
| 3 | 42 = 21 Γ 2 + 0 | 2 | 0 |
.
Another example
:
- 1071 = 462 Γ 2 + 147
- 462 = 147 Γ 3 + 21
- 147 = 21 Γ 7 + 0
GCD = 21.
Why it works
Each step strictly reduces the numbers. The algorithm terminates. GCD is preserved at each step (Euclidβs lemma).
Applications
- Simplify a fraction: divide top and bottom by their GCD.
- Solve Diophantine equation : solvable iff .
- Cryptography: extended Euclid appears in RSA.
Common mistakes
- Stopping too early: continue until remainder is 0.
- Wrong remainder: GCD is the LAST NONZERO remainder.
- Confusing remainder and quotient.
GCD(48, 18) by Euclidean algorithm?
Mini-quiz
Question 1 / 3GCD(48, 18) via Euclid?
