Two runners, and the answer most people give
Aisha and Ben run laps of a track. Aisha takes 4 minutes for each lap. Ben takes 6 minutes. They start together at the starting line. When will they next pass the starting line at the same moment?
Most people multiply: , so 24 minutes. It is a reasonable guess. At 24 minutes, Aisha has run 6 laps and Ben has run 4, so both are at the line. But they meet earlier than that. At 12 minutes, Aisha has run 3 laps and Ben has run 2. They are already together.
Here is a second question that looks different. A rectangle is 36 cm long and 24 cm wide. You want to cover it with equal squares, with no gaps and no cutting. What is the biggest square you can use?
The first question asks for the smallest number that both 4 and 6 go into. The second asks for the biggest number that goes into both 24 and 36. One looks forwards along the multiples. The other looks backwards along the factors. This lecture gives both answers their names, a method that never needs guessing, and the reason why multiplying the two numbers sometimes gives the wrong answer.
Common multiples and common factors
In the lecture on factors and multiples, two lights flashed every 6 seconds and every 8 seconds. They flashed together after 24 seconds. That lecture found 24 by writing out both lists of multiples and looking for the first number in both. It promised a name for that number, and a faster way to find it. Here they are.
Do the same for the runners. Aisha is at the line at the multiples of 4, and Ben at the multiples of 6.
The numbers in both lists, 12, 24, 36, …, are the common multiples of 4 and 6. "Common" means "shared". The list never ends, so there is no biggest one. But there is always a smallest one, and here it is 12.
Now the rectangle. A square fits along the 24 cm side only if its side is a factor of 24. It fits along the 36 cm side only if its side is a factor of 36. So list both sets of factors.
The numbers in both lists, 1, 2, 3, 4, 6 and 12, are the common factors of 24 and 36. This list always ends, because a factor is never bigger than its number. So there is always a biggest one, and here it is 12. Squares of side 12 cm fit exactly: 2 rows of 3.
The highest common factor (HCF) of two whole numbers is the biggest number that is a factor of both.
The lowest common multiple (LCM) of two whole numbers is the smallest number that is a multiple of both.
So the HCF of 24 and 36 is 12, and the LCM of 4 and 6 is 12. The 24 seconds of the flashing lights was the LCM of 6 and 8. Some books say "greatest common divisor" (GCD) or "greatest common factor" instead of HCF, and "least common multiple" instead of LCM. They mean exactly the same.
There is a quiet extra fact inside those lists. The common factors of 24 and 36 are 1, 2, 3, 4, 6 and 12, which are exactly the factors of 12. The common multiples of 4 and 6 are 12, 24, 36, …, which are exactly the multiples of 12. So the HCF holds every common factor inside it, and the LCM is the first step of every common multiple.
Why listing is not enough
Listing works for small numbers. Now try the HCF and LCM of 126 and 180. Listing all their factors takes a while. Listing multiples takes much longer: the LCM turns out to be 1260, which is the tenth multiple of 126. For bigger numbers, listing becomes hopeless. We need a method that looks inside the numbers.
The last lecture gave the tool. Every whole number greater than 1 is built from primes, in only one way. Worked Example 3 there showed that every factor of a number is made from some of that number's own primes. That idea, that factors share primes, is the key to both HCF and LCM.
Write 24 and 36 as products of primes.
The HCF. A common factor must be built from primes that 24 has, and also from primes that 36 has. Look at the 2s. 24 has three 2s, but 36 has only two. A common factor can use at most two 2s, because a factor of 36 cannot contain three 2s. Now the 3s. 24 has one 3, and 36 has two. So a common factor can use at most one 3. The biggest common factor takes everything it is allowed:
The LCM. Now turn the question round. A common multiple of 24 and 36 must contain all of 24's primes, so it needs at least three 2s and one 3. It must also contain all of 36's primes, so it needs at least two 2s and two 3s. To satisfy both, it needs three 2s and two 3s. The smallest common multiple takes exactly that, and nothing extra:
This is the hard part of the lecture, so read it once more slowly. For the HCF, each prime appears as many times as the number with fewer copies allows. For the LCM, each prime appears as many times as the number with more copies needs. That is it. That is the whole idea.
Write each number as a product of primes.
HCF: take every prime the two numbers share, each one the smaller number of times it appears.
LCM: take every prime that appears in either number, each one the larger number of times it appears.
A picture: the Venn diagram
A Venn diagram shows this sorting at a glance. Draw two overlapping circles, one for each number. Put the primes the numbers share in the middle. Put the extra primes that only one number has on its own side. For 24 and 36, the middle holds 2, 2 and 3. One extra 2 belongs only to 24, and one extra 3 belongs only to 36.
Now the two answers can be read straight off the picture. The HCF is the product of the middle. The LCM is the product of everything in the diagram, with each prime counted once in the place where it sits. Try it with your own numbers.
Choose two numbers from 2 to 200. Their primes are sorted into the diagram: shared primes in the middle, extra primes on each side. Watch how the HCF and LCM are read from it, and look at what happens when nothing is shared.
First number:
Second number:
The Venn diagram for 24 and 36 sorts their primes into three places.
| Numbers | Shared (middle) | HCF | LCM |
|---|---|---|---|
| 24 and 36 | 2, 2, 3 | 12 | 72 |
| 4 and 6 | 2 | 2 | 12 |
| 126 and 180 | 2, 3, 3 | 18 | 1260 |
| 8 and 15 | nothing | 1 | 120 |
What should you have seen? The last line of readouts is always true: the two numbers multiplied together equal the HCF multiplied by the LCM. The diagram shows why. Multiplying the two numbers uses each circle in full, so the middle is counted twice. The HCF is the middle once, and the LCM is everything once. Together they also count the middle twice.
So when does multiplying the two numbers give the LCM? And why did fail for the runners?
Show the answer
Multiplying gives the LCM only when the middle is empty, so the HCF is 1. That happened with 8 and 15: and share nothing, so their LCM is . Two numbers with HCF 1 are called co-prime.
4 and 6 share a 2. Multiplying uses that 2 twice, so 24 is a common multiple, but not the lowest. Remove the extra 2, and you get .
Bigger numbers, written short
With index form, the rule becomes "smaller power for the HCF, larger power for the LCM". The last lecture's Try it found these two factorisations:
Go prime by prime. For 2: the powers are 2 and . For 3: both have . For 5: only 180 has it. For 7: only 126 has it.
The HCF leaves out 5 and 7, because a prime that only one number has cannot be in a common factor. The LCM keeps them, because a common multiple must contain every prime of both numbers. Check with the product: , and .
The most common slip in this method is in the LCM. Find it in the working below.
One line of this working is wrong. Tap the line you think is wrong.
A student found the HCF and LCM of 12 and 18. One line is wrong.
- Line 1. . Correct.
- Line 2. . Correct.
- Line 3. They share one 2 and one 3, so HCF . Correct.
- Line 4. LCM = all the primes from both lists . Wrong. The shared 2 and 3 are counted twice. The LCM is .
- Line 5. Check: and , so the LCM is 216. The divisions are correct, but they only show that 216 is a common multiple, not the lowest.
Worked examples
Aisha's lap takes 4 minutes and Ben's takes 6. When are they next together at the start?
They are together at a common multiple of 4 and 6, and the first time is the LCM.
The 2s: 4 has two, 6 has one, so take two. The 3s: take one.
They meet after 12 minutes, when Aisha has run 3 laps and Ben has run 2.
Check: and , both exact. Also HCF , and .
One ribbon is 60 cm long and another is 48 cm long. You want to cut both into pieces of the same length, with nothing left over. What is the longest possible piece, and how many pieces do you get?
The piece length must divide into 60 exactly and into 48 exactly, so it is a common factor. The longest piece is the HCF.
Shared primes, smaller power: and 3. The 5 is not shared.
So each piece is 12 cm long. The 60 cm ribbon gives pieces, and the 48 cm ribbon gives pieces, 9 pieces in all.
Check: 5 and 4 share no factor except 1. If they shared one, say 2, you could make the pieces twice as long. So 12 really is the longest.
(a) Simplify . (b) Work out .
(a) Divide the top and the bottom by the biggest number that goes into both, which is their HCF. and , so the HCF is .
(b) To add, both fractions need the same denominator, which must be a common multiple of 12 and 18. The smallest is the LCM, 36 (found in the spot-the-error above).
Check: in (a), 2 and 3 share no factor, so cannot be simplified further. In (b), and , and 29 is prime, so is already in its simplest form. The lectures on fractions use both ideas all the time.
Find the smallest number that 1, 2, 3, 4 and 5 all divide into exactly.
The rule works for any count of numbers: take every prime that appears, each the largest number of times it appears in any one of them. The numbers are , , , and . The largest power of 2 is , and 3 and 5 each appear once.
This is the number from the end of the lecture on factors and multiples. Theon of Alexandria suggested that the Babylonians chose 60 for exactly this reason. Add 6 to the list, and the answer is still 60, because needs nothing new.
Check: , and . Any smaller common multiple would have to leave out a 2, the 3 or the 5, and then 4, 3 or 5 would not divide into it.
is a common multiple of 4 and 6, but the LCM is 12. Multiplying works only when the HCF is 1. Otherwise, divide the product by the HCF: .
For 24 and 36, a student takes the larger power of 2 for the HCF and writes . But 24 does not divide into 36. HCF: smaller power, because it must fit inside both. LCM: larger power, because it must contain both.
The HCF can never be bigger than the smaller number, and the LCM can never be smaller than the bigger number. If you find an HCF of 36 for 24 and 36, or an LCM of 18 for 12 and 18, something has been swapped. This quick check catches most mix-ups between the two words.
Work each one on paper first. Open a hint only when you are stuck.
-
Find the HCF and the LCM of 18 and 30 in two ways: first by listing, then by primes. Check that HCF × LCM = 18 × 30.
Hint 1
For the HCF, list the factors of each number. For the LCM, list the multiples of 30 and stop at the first one that 18 divides into.
Hint 2
and .
Full answer
Listing: the factors of 18 are 1, 2, 3, 6, 9, 18, and the factors of 30 are 1, 2, 3, 5, 6, 10, 15, 30. The common factors are 1, 2, 3 and 6, so the HCF is 6. The multiples of 30 are 30, 60, 90, … . 18 does not divide 30 or 60, but . So the LCM is 90.
Primes: shared, smaller power: 2 and 3, so HCF . Everything, larger power: .
Check: and .
-
Two numbers are and . Find their HCF and LCM. Leave the answers in prime form, then work out their values.
Hint 1
Go prime by prime: 2, 3, 5, 7. Which primes do both have?
Hint 2
For 2, the powers are and . The HCF takes ; the LCM takes .
Full answer
Shared primes are 2 and 3. HCF .
LCM .
Check: and . , and .
-
A florist has 72 roses and 90 lilies. She makes identical bunches, each with the same mix of flowers, and uses every flower. What is the largest number of bunches she can make? What is in each bunch?
Hint 1
The number of bunches must divide into 72 exactly and into 90 exactly.
Hint 2
and .
Full answer
The largest number of bunches is the HCF of 72 and 90: .
Each bunch has roses and lilies.
Check: and . Also 4 and 5 share no factor except 1, so no larger number of bunches is possible.
-
(a) Two numbers have HCF 6 and LCM 72. One of them is 18. Find the other. (b) Can two numbers have HCF 4 and LCM 30? Explain.
Hint 1
Use the fact from the explorer: the two numbers multiplied together equal HCF × LCM.
Hint 2
For (b), think about whether the HCF must be a factor of the LCM.
Full answer
(a) , so the other number is . Check: and . HCF and LCM .
(b) No. The HCF divides into both numbers, and both numbers divide into the LCM. So the HCF must divide into the LCM. But remainder 2. In the Venn diagram, the HCF is the middle, and the middle is always part of the LCM.
The prime method needs the prime factorisations. The last lecture showed that for very large numbers, finding them can be hopelessly slow. Yet a computer can find the HCF of two numbers with hundreds of digits in a tiny fraction of a second. How?
The answer is in Euclid's Elements, written around 300 BCE (Book VII, Proposition 2), and the method may be older still. Any number that divides into two numbers also divides into their difference. So the HCF of 126 and 84 is the same as the HCF of 84 and . Then 42 divides into 84 exactly, so the HCF is 42. No primes were needed. In the rectangle picture, you cut the biggest possible square off the end, again and again, until the squares fit exactly. This is the Euclidean algorithm. It is one of the oldest methods in mathematics that is still in everyday use. A longer form of it is used to build the RSA keys of the last lecture, so this 2300-year-old idea helps to protect online payments today.
- The HCF of two numbers is the biggest number that divides into both, and the LCM is the smallest number that both divide into.
- Every common factor is a factor of the HCF, and every common multiple is a multiple of the LCM.
- From prime factorisations, the HCF takes the shared primes with the smaller power, and the LCM takes every prime with the larger power.
- The two numbers multiplied together equal the HCF multiplied by the LCM, so multiplying gives the LCM only when the HCF is 1.
- A sharing or cutting question asks for an HCF, and a "when together again" question asks for an LCM.