GCD and LCM
The greatest common divisor and the lowest common multiple of two numbers. Learn the divisibility rules, the listing method, the Euclidean algorithm, and the formula tying GCD to LCM.
Before you start
This topic builds on earlier ideas. Before you start, it's worth working through the lessons below — they'll make everything click:
- DivisionDivision is the inverse of multiplication — divide the dividend by the divisor to get the quotient. Learn the names, the link to multiplication, division with a remainder and why you must never divide by zero.
- FractionsA fraction writes part of a whole as a numerator and a denominator. Learn equivalent fractions, adding and multiplying fractions, and reducing to lowest terms.
All formulas
Divisibility
a divides b when b is a multiple of a
Greatest common divisor
the largest number dividing both
Lowest common multiple
the smallest positive number both divide
The identity tying GCD to LCM
know one and you can compute the other
Euclidean algorithm
repeat until the remainder is zero
We say that divides (written ) when is a multiple of :
Before hunting for common divisors it pays to know the divisibility rules — they spot a divisor without any dividing:
- by 2 — when the last digit is even,
- by 3 — when the digit sum is divisible by 3,
- by 4 — when the number formed by the last two digits is divisible by 4,
- by 5 — when the last digit is 0 or 5,
- by 9 — when the digit sum is divisible by 9,
- by 10 — when the last digit is 0.
Greatest common divisor
The GCD of two numbers is the largest number dividing both:
The simplest method is to list the divisors of both numbers and take the largest they share:
When the numbers share no divisor beyond one — they are coprime. That happens for and , for instance, even though neither of them is prime.
The Euclidean algorithm
Listing divisors gets unwieldy for larger numbers. A relation known for over two thousand years is far quicker:
Replace the pair by "the smaller number and the remainder" until the remainder hits zero. The last non-zero number is the GCD.
Lowest common multiple
The LCM is the smallest positive number divisible by both:
Multiples of : ; multiples of : — the first shared one is , so .
Nothing has to be listed, though, because the GCD and the LCM are tied together:
Why it matters
Both ideas come back with fractions: the GCD of the numerator and the denominator reduces a fraction to lowest terms, and the LCM of the denominators is the lowest common denominator when adding. Outside maths the LCM answers questions like "how often do both buses leave at the same time", and the GCD "how large can equal square tiles be to cover a rectangle without cutting".
Practice
Work through a set of exercises — they get harder as you go. At the end you'll see your score and the mistakes worth reviewing.
Common mistakes
- Swapping the GCD and the LCM — the GCD is no larger than either number, the LCM no smaller; a result the other way round signals a slip.
- Taking the product as the LCM — is a common multiple, but the lowest one only when the numbers are coprime.
- Stopping the Euclidean algorithm one step too late — the GCD is the last non-zero remainder, not the zero that ends the procedure.
- Assuming two composite numbers cannot be coprime — and are both composite, yet .
Formula card
Topic: GCD and LCM
Divisibility
a divides b when b is a multiple of a
Greatest common divisor
the largest number dividing both
Lowest common multiple
the smallest positive number both divide
The identity tying GCD to LCM
know one and you can compute the other
Euclidean algorithm
repeat until the remainder is zero
