Skip to content
Number Theory Guide

Number Theory Level 15: GCD mastery (<= 500). Euclidean algorithm.

1. First Euclid step

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

Replace the larger number with its remainder.

420 = 315 + 105.

2. Repeat with remainder

2. Repeat with remainder
First Euclid step

Continue until the smaller number divides exactly.

315 = 105 x 3.

3. Read GCD

3. Read GCD
First Euclid step
Repeat with remainder

The last nonzero divisor is the GCD.

GCD = 105.