GCF and LCM
Learning goals
- Find a GCF and an LCM by listing factors or multiples
- Take the lowest power of each shared prime for the GCF
- Collect the highest power of every prime for the LCM
- Explain why lowest serves the GCF and highest serves the LCM
- Apply the product rule for two numbers, and say why three break it
- Read largest equal groups as GCF and coinciding cycles as LCM
Common factors and the GCF
A common factor of two whole numbers is a number that is a factor of both. Take and . Their factors are
The numbers that appear in both lists are and : these are the common factors of and . Every pair of whole numbers shares at least the factor , so the list of common factors is never empty. The largest entry in it is the one we care about most.
The greatest common factor (GCF) of two numbers is the largest number that is a factor of both. For and the common factors are , and the greatest of these is , so
This is the largest number you could divide both and by and still land on whole numbers: and . That is exactly what makes the GCF useful. When you reach fractions in the next chapter, you will divide the top and bottom of a fraction by their GCF. That is what reduces the fraction as far as it will go in a single step.
Common multiples and the LCM
Now flip the question around. A common multiple of two whole numbers is a number that is a multiple of both. List a few multiples of and of :
The numbers in both lists, , are the common multiples of and . Unlike common factors, there are infinitely many of them, because you can always go further out and find more. But there is a smallest one, and that is the one worth naming.
The least common multiple (LCM) of two numbers is the smallest number (other than ) that both numbers divide into evenly. The common multiples of and start , so
This is the soonest the two counting patterns line up: count by fours and by sixes, and is the first place they meet. That is why the LCM is the natural common denominator when you add fractions later: it is the smallest number into which both denominators fit.
The GCF is a factor of the numbers, so it is never bigger than either one. The LCM is a multiple of the numbers, so it is never smaller than either one. For and , the GCF is , at most as big as the smaller number. The LCM is , at least as big as the larger. If a value you have called the GCF comes out larger than the numbers themselves, you have the two swapped. The same is true if an LCM comes out smaller than those numbers.
The listing method
The lists above are the listing method (writing the factors or the multiples out and reading the answer off the lists), and they always work:
- For the GCF, write out the factors of each number, find the ones common to both, and take the largest.
- For the LCM, write out multiples of each number until a value shows up in both lists, and take the first such value.
Listing is reliable and easy to picture, which makes it the right way to meet these ideas. Its drawback shows up with bigger numbers. The factor lists get long, and you might count out a great many multiples before the lists finally meet. For and you would list multiples up to before they coincide. So we want a method that does not depend on the numbers being small, and prime factorization provides exactly that.
Before leaving the listing method, it is worth running it once from start to finish. Write out the factors of each number, then read off the ones that appear in both lists:
The numbers in both lists are , and , so those are the common factors of and . The largest of them is , so . Notice what disqualifies a number like : it divides but not , so it appears in one list and not the other. A factor has to survive both lists to count as a common one.
Check your understanding
Using the listing method, what is ?
List the factors of each and find the largest they share. Factors of : . Factors of : .
The value is the LCM, not the GCF, and and are common factors but not the greatest.
The prime-factorization method
Every whole number greater than has a unique prime factorization. That factorization records exactly how many copies of each prime the number is built from. That bookkeeping is precisely what the GCF and LCM need. Start each number in prime-power form. Take and :
Think of each number as a bag of prime factors. The bag for holds two s and one ; the bag for holds one and two s. With the numbers written this way, both answers come from one simple rule each.
- GCF: for each shared prime, take the lowest power it has in the two numbers. The prime appears as in but only in , so take . The prime appears as in and in , so take . Multiply: . A prime that sits in only one of the numbers is not shared, so it contributes nothing to the GCF.
- LCM: for each prime, take the highest power that appears in either number. For take ; for take . Multiply: .
Both agree with the lists ( from before, and is indeed the first common multiple of and ). The figure below shows why “lowest” and “highest” are the right choices. The figure sets the shared core that sits inside both numbers against the combined pile that contains each number whole.
Why lowest power for the GCF
The rule is not arbitrary. A factor of both numbers can only use prime copies that both numbers actually own, and that limit is what forces “lowest power.”
Press on the bags for and to see the limit bite. A common factor may carry one , since both bags hold one. It may not carry two, because has a single to give. Nothing divides by asking for copies does not have. The s are capped from the other side, where holds only one. Take each shared prime at its cap and you have built , the GCF.
So the GCF is built only from the primes the two numbers truly have in common. Each of those primes is capped at the count in whichever number is poorer in that prime. Take a prime to a higher power than that, and the result would no longer divide the poorer number.
Why highest power for the LCM
The LCM argument is the mirror image. A multiple of both numbers must contain enough copies of each prime to cover each number on its own. That is what forces “highest power.”
Hold and up to that demand. A common multiple has to hold two s, because does and every multiple of carries its factors along. It has to hold two s for the same reason on the side. Two of each satisfies both demands at once, and is what the demands come to.
Side by side, the two rules are easy to remember once you see the reason. The GCF can only keep what both numbers can spare, so it takes the lower power. The LCM must satisfy whichever number is hungrier for a given prime, so it takes the higher power.
Worked example 1 Find the GCF and LCM of and from their prime factorizations
Write each number in prime-power form first:
Go prime by prime. For the prime , the two powers are and . For the prime , they are and .
For the GCF, take the lower power of each:
For the LCM, take the higher power of each:
As a check, divides both and (giving and ), and both and divide (giving and ). So the answers behave exactly as a GCF and an LCM should.
Check your understanding
Given and , what is ?
For the LCM, take the highest power of every prime that appears in either number: (from ), (from ), and (in both).
The value is the GCF, and is the plain product, which is larger than the least common multiple.
GCF and LCM together: the product rule
Look back at and . The GCF was and the LCM was , and
That is not a coincidence of this one pair. For any two positive whole numbers and ,
The reason lives in the prime powers again. Look at the prime in and . There are two of them in and one in . The GCF takes the one and the LCM takes the two, so between them the two answers take all three. Multiplying by takes all three as well.
That happens at every prime, because a prime is offered just two counts, one from each number. The GCF takes the smaller and the LCM takes the larger, so between them they take both. The two counts can also be equal, as the s are in and . Then each answer takes one of the pair, and the tally comes out the same.
The same bookkeeping is easier to see with blocks than with exponents. Split each number into the part it shares with the other and the part it does not. That gives and , with the shared block in the middle. The GCF is that shared block by itself, and the LCM is all three blocks together. So the GCF times the LCM calls on the shared block twice and each outside block once, which is exactly what does.
This gives a handy shortcut. Once you have the GCF, you can get the LCM without listing anything, by dividing the product of the numbers by the GCF:
For and that is , matching what we found the long way.
Worked example 2 Use the product rule to find
First find the GCF. In prime-power form,
The only shared prime is , and the lower power is , so . The prime appears only in , so it is not part of the common factor.
Now apply the product rule instead of listing multiples:
The same answer falls out of the highest-power rule: . Either route works, and the product rule is quickest once the GCF is in hand.
The power rules extend, but the product rule does not
Take , and . Only the prime sits in all three, and the fewest copies any of them holds is one, so . For the LCM, take the most copies of each prime that appears anywhere. That is two s from , one from and one from , giving . Both answers check out, since divides all three numbers and all three divide .
Nothing there was special to three numbers. A common factor has to divide all of them, so at each prime it is capped by whichever number holds the fewest copies. A common multiple has to cover all of them, so at each prime it needs enough for whichever number holds the most. Just more columns to compare.
Worked example 3 Find the GCF and LCM of , and
Write all three in prime-power form:
Now go prime by prime across all three at once. The prime sits in and but not in , since is odd. The prime sits in all three, as , and . The prime sits in and but not in .
For the GCF, keep only the primes every number has, each at its lowest power. That leaves the prime on its own, and the lowest of its three powers is :
The primes and drop out for the same reason an unshared prime drops out with two numbers. The number has no copy of to give, and has no copy of .
For the LCM, take the highest power of every prime that appears anywhere, which is , and :
Check both ends. The GCF divides all three: , , and . And all three divide the LCM: , , and . Every division comes out whole, which is exactly what a GCF and an LCM are for.
The product rule does not extend, and , and show why. Their GCF is and their LCM is , so the two answers multiply to , while .
Watch the prime in those three numbers. The number holds one copy, holds none, and holds two. The GCF takes the fewest, none, and the LCM takes the most, two. The middle count, the single copy inside the number , is taken by neither, and that missing copy is the whole gap: . With two numbers there is no middle count to miss.
The lowest-power and highest-power rules work for any number of numbers, but the product rule works only for two. With three or more, read the GCF and the LCM straight off the prime powers instead, because the shortcut has no three-number version.
Check your understanding
Given , and , what is ?
Keep only the primes that appear in every one of the three, each at its lowest power. The prime is missing from and the prime is missing from and , so only survives, once.
The value is , which quietly ignores . Since is odd it has no to offer, so no may sit in the common factor. The value is the LCM, taken from the highest powers instead. And would be the answer only if the three shared no prime at all, but every one of them contains .
GCF in a word problem: largest equal groups
Word problems hide the GCF and LCM behind everyday situations. The signal for a GCF problem is that you are splitting things into the largest possible equal groups. The same signal appears when you are finding the biggest size that fits evenly into several totals at once.
Worked example 4 Packing into the largest equal boxes
A baker has muffins and cookies. She wants to pack them into identical gift boxes so that every box has the same number of muffins and the same number of cookies. No muffins or cookies may be left over, and she wants the boxes to hold as much as possible. How many boxes can she make?
Each box gets an equal share of the muffins and an equal share of the cookies. So the number of boxes must divide both and . The largest such number is the greatest common factor. In prime-power form,
Take the lower power of each shared prime: for the prime , and for the prime . The prime is only in , so it drops out.
So she can make boxes. Each box holds muffins and cookies. Asking for the largest equal groups is the tell that you want the GCF.
LCM in a word problem: when patterns coincide
The signal for an LCM problem is that two repeating cycles start together and you want to know when they will next line up. The same signal appears when you want the smallest amount that several given sizes can all build up to exactly.
Worked example 5 When do the two bells ring together again?
At a train station, one bell rings every minutes and another rings every minutes. They ring together at . How many minutes until they next ring at the same time?
The first bell rings at minutes (the multiples of ), and the second at minutes (the multiples of ). They coincide at any common multiple, and they next coincide at the smallest one, the least common multiple. In prime-power form,
Take the highest power of each prime: for the prime , and for the prime .
So the bells next ring together after minutes, at . Checking: rings of the first bell and rings of the second, both whole, so really is a moment they share. Asking when repeating events next coincide is the tell that you want the LCM.
Check your understanding
Two runners start together on a track. One finishes a lap every minutes, the other every minutes. After how many minutes do they next cross the start line at the same time?
They meet at the start line at a common multiple of their lap times, and next at the least common multiple. Write and , then take the highest power of each prime.
The value is the GCF, and is the plain product, not the least common multiple.