Skill stop · How is this move done?

Greatest Common Divisor and Least Common Multiple

In the Chinese book: 最大公因数与最小公倍数

Keep cutting the biggest square off a rectangle. The last side is the gcd.

📖 §1.3 of 《整除、同余与不定方程》M20 The Extremal Principle line

Before this stop, visit:Primes and Composites (Concept)

WorkbenchPress “Cut off the biggest square” and keep cutting until the rectangle is covered. How is the side of the last, smallest square related to 51 and 21?

Loading figure…

What this move does

The largest of the divisors that integers and have in common is their greatest common divisor, written . The smallest of their common positive multiples is their least common multiple, written . When we say and are coprime.

Once the numbers get big, listing divisors one by one is too slow. The Euclidean algorithm relies on just one fact:

Any number that divides both and also divides , and any number that divides both and also divides . The two pairs have exactly the same common divisors, so of course they have the same greatest one.

  1. Divide the bigger number by the smaller one and write .
  2. Take (divisor, remainder) as the new pair and divide again. The numbers keep shrinking, so this must stop.
  3. Stop when the remainder is : the divisor on that line is .

The rectangle on the workbench does the same thing: cut off squares of side , which leaves a smaller rectangle, and cut again.

Predict first

A rectangular floor is to be covered exactly with identical square tiles whose side is a whole number. What is the largest possible side of a tile?

Choose an answer first; then you can see the result.

Work through one

Example: find (51, 21) and write it as a combination of 51 and 21

Step 1 / 5
Loading figure…
  1. Set up the rectangle

    Length , width . A “ruler” that measures both the length and the width exactly is a common divisor of the two.

That last step was no accident. It works for any two numbers:

Bézout's identity For any integers and , not both zero, there are integers and such that . In particular, and are coprime there are integers and with .

This immediately repairs the broken statement from the previous stop:

If and , then .

Take and multiply both sides by : . Both terms on the right are divisible by , so .

The least common multiple

Every time the rectangle is covered, the workbench also reports . It is tied to by a fixed relation:

So you don't need a separate method for the lcm: find with the Euclidean algorithm, then divide by it. Why this relation holds is something the “exponent bars” at the next stop show at a glance.

When it fails

Break it

Counterexample lab: remove one condition

Conclusion: if and , then

, . Cut all the way down: the gcd is , so the lcm is just . So any number that is a multiple of both and must be a multiple of .

Loading figure…

Practice

Exercise 1Basic

Use the Euclidean algorithm to find .

Exercise 2Basic

Find .

Exercise 3Advanced

Find the smallest positive integer for which there is an integer with .

Exercise 4Challenge

Prove that for every positive integer , the fraction is in lowest terms.

Mistake Museum · Exhibits from this stop

Before you leave, look at the traps other people fell into here.See every exhibit in the museum →

Exhibit

Both numbers divide n, so their product divides n

The wrong step: and , so .
What went wrong? Think first, then open

Diagnosis and share the factor : they “overlap”. only has to hold the least common multiple of and , which is , not .

The right step: and only give . When we have , and only then .

“Check whether they are coprime before combining two divisibilities”

Exhibit

Taking the final remainder 0 as the gcd

The wrong step: , , , so .
What went wrong? Think first, then open

Diagnosis A remainder of only says “it divides exactly, you can stop”. The answer is the divisor that divides exactly, which is the last nonzero remainder.

The right step: The last line is . The divisor there is , so .

“The answer is the last nonzero remainder”