What’s happening here?
A common divisor of a and b also divides a − qb for any integer q. Replacing a by its remainder therefore preserves the common divisors while making the numbers smaller. Repeating this process leads to the greatest common divisor.
The Euclidean algorithm preserves the common divisors by replacing (a, b) with (b, a mod b).
A worked example.
- 1
48 = 18 × 2 + 12.
- 2
18 = 12 × 1 + 6.
- 3
12 = 6 × 2 + 0. The last nonzero divisor is 6.
A common wrong turn.
The final remainder is zero; the gcd is the divisor from that last division, not zero.
Why this works.
If a=bq+r, a number divides both a and b exactly when it divides both b and r. This is why replacing a pair by the divisor and remainder preserves the gcd. Repeating gives the Euclidean algorithm and ends at the last nonzero remainder.
Check it. Apply it. Explain it.
Three questions, with hints and worked feedback. Your score counts your first submitted answer. Practice only · scores stay in this session and do not enter your account history.
Greatest common divisor
Videos and further reading
Greatest common factor
www.khanacademy.org · New tabGreatest common divisor
en.wikipedia.org · New tabThese resources open in a new tab on the publisher’s website.
Finished reading?Stored in this browser; separate from practice grades.