Skip to content
Number Theory Guide

Number Theory Level 10: GCD (<= 50). Euclidean algorithm.

1. First Euclid step

1. First Euclid step
Replace the pair with divisor and remainder.

Replace the larger number with its remainder.

42 = 30 + 12.

2. Repeat with remainder

2. Repeat with remainder
First Euclid step

Continue with the new pair.

30 = 12 x 2 + 6.

3. Reach exact division

3. Reach exact division
First Euclid step
Repeat with remainder

Stop when the remainder is zero.

12 = 6 x 2.

4. Read GCD

4. Read GCD
First Euclid step
Repeat with remainder
Reach exact division

The last nonzero divisor is the GCD.

GCD = 6.