Skip to content
Number Theory Guide

Number Theory Level 9: GCD (small, <= 30). Euclidean algorithm.

1. First Euclid step

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

Replace the larger number with its remainder.

24 = 18 x 1 + 6.

2. Repeat with remainder

2. Repeat with remainder
First Euclid step

Continue until the smaller number divides exactly.

18 = 6 x 3.

3. Read GCD

3. Read GCD
First Euclid step
Repeat with remainder

The last nonzero divisor is the GCD.

GCD = 6.