Greatest Common Divisors
The greatest common divisor is the largest integer dividing both and . From prime factorizations, take each prime to the SMALLER of its two exponents: and give . Numbers with are coprime.
A common divisor can use each prime no more often than both numbers allow — that is the minimum exponent — and by unique factorization it can use no other primes. Taking everything allowed builds the largest one, and every other common divisor is a sub-product of it. So "greatest" means more than "largest": every common divisor divides the gcd. Factoring is quick for small numbers and hopeless for large ones; the next section finds the gcd without factoring at all.
A floor measuring cm by cm is to be covered with equal square tiles, without cutting any. How large can the tiles be? A side works exactly when whole tiles fill both edges, that is, when and . So the largest is . With and , the minimum exponents give . The floor takes tiles of cm.
What values can take for positive integers ? Any common divisor of and divides their difference , so the gcd is one of . All four occur: , , , . The same difference trick shows that consecutive integers are always coprime.
Taking the LARGER exponents. For and that gives — the lcm, not the gcd — and a gcd larger than both numbers is an immediate red flag. Common divisors are limited by the number that has fewer of each prime.
Find .
Show the answerHide the answer
Take each prime to its smaller exponent: . ( and each appear in only one number, so their minimum exponent is .)
The Euclidean Algorithm
Since , dividing repeatedly and keeping remainders reaches as the last nonzero remainder. It takes at most about (number of digits) steps — far faster than factoring.
The key fact where holds because any common divisor of and divides , and any common divisor of and divides . The two pairs have the same common divisors, so the same greatest one. Geometrically, each step cuts the largest possible squares off an rectangle; the last square to fit exactly is the largest square that tiles the whole rectangle.
Divide, then divide the divisor by the remainder: ; ; . The pairs , , all have the same gcd, and the last one is obviously . So — three divisions, no factoring.
Show for every integer . Subtract to shrink, exactly as the algorithm does: . Each step replaces the larger expression by its difference with the smaller, which keeps the gcd, until a constant is reached.
Find . Divide: , so the gcd equals . And is a multiple of , so the gcd is . The exponents ran through Euclid's algorithm themselves: , and in general .
Reading off the wrong number. In , , the answer is the last NONZERO remainder, — not the final , and not a quotient like . A quick check catches it: the answer must divide both original numbers.
Compute and write it as .
Show the answerHide the answer
; ; . . Backwards: . Check: .
Bézout's Identity
For integers not both zero there exist integers with . In particular and are coprime exactly when is solvable. The numbers of the form are precisely the multiples of .
Running the Euclidean algorithm backwards produces and : each remainder is a combination of the two numbers before it, so substituting upward expresses the last remainder in terms of and . Every combination is a multiple of the gcd (the gcd divides both terms), and since the gcd itself is a combination, so is every multiple of it. This identity is the hinge of the course: it gives modular inverses, Euclid's lemma, and hence unique factorization.
From and : start from the last useful line, , then replace using the line above it, : . Check: .
With a -litre jug, a -litre jug and a tap, can you measure exactly litre? Bézout says yes, because , and it tells you how: . Fill the -litre jug, pour from it into the -litre jug twice (emptying the small jug in between), and litre is left. Any whole number of litres up to can be reached the same way.
Which integers can be written as with integers? Every such number is a multiple of , since divides both terms. Conversely is itself of this form, so every multiple is too. The reachable totals are exactly the multiples of ; for example is not reachable.
Assuming the coefficients are unique. , but also : adding changes without changing the total. There are infinitely many pairs, a fact the Diophantine topic turns into a formula.
Write as .
Show the answerHide the answer
Euclid: , , , , , , , . Substituting back up the chain gives , so , . Check: .
LCM and the Product Formula
The least common multiple is the smallest positive integer divisible by both. For positive : . In terms of prime exponents, the gcd takes the minimum exponent of each prime and the lcm the maximum.
For each prime the two exponents are some and , and : whatever the gcd does not take, the lcm does. Multiplying over all primes gives . In the Venn picture of prime factors, the overlap multiplies to the gcd and the whole picture to the lcm, while and together count the overlap twice.
Find . With the gcd already known, . Check by factoring: and ; the maximum exponents give .
Three bells ring every , and minutes, and all ring together at noon. When do they next ring together? The minutes that work are the common multiples of , , ; the first is their lcm. From , , , the maximum exponents give minutes: at p.m.
How many pairs have and ? Write , with . Then , so with coprime factors: each of the three primes goes wholly to or to . That is ordered splits, unordered: .
Applying product to THREE numbers. It is false in general: . With three numbers the minimum and maximum exponents no longer account for the middle one.
Two numbers have and , and one of them is . Find the other.
Show the answerHide the answer
By the product formula the other is . Check: and — it is one of the four pairs found above.
Why It Works
If , then a number dividing and divides , and a number dividing and divides . So and have exactly the same common divisors and the same gcd. The remainders strictly decrease and stay non-negative, so the process ends with a pair , whose gcd is . Chaining the equalities, , the last nonzero remainder.
Let be the smallest positive number of the form (well-ordering again). Divide by : with . Then is also a combination, and it is smaller than , so it cannot be positive: and . Likewise . And any common divisor of and divides . So is a common divisor that every common divisor divides — it is , written as a combination.