Assume that . Verify that divides and if and only if divides both and .
The World of Algorithms · Question 12 of 15
Assume that m n . Verify that d divides m and n if and only if d divides both n and m n .
Divide by : let be the quotient and the remainder, so
(This is the same as subtracting from repeatedly, times.)
If divides and : write and for natural numbers , . Then
so divides (when this still holds, since ). And divides already. So divides both and .
If divides and : write and for whole numbers , . Then
so divides . And divides already. So divides both and .
In terms of tiles: if blocks of size tile and , then removing copies of from leaves , which is also tiled; and putting copies of back onto gives , which is tiled.
Check with numbers: , , , so . The common divisors of 60 and 16 are 1, 2, 4, and the common divisors of 16 and 12 are also 1, 2, 4. The two sets of common divisors are the same, so . This is exactly why the improved Euclid algorithm may replace by .
