GCF and LCM
Progress can't be saved in this browser, so this lesson's status can't be set.
Watch the video explainer
Learning goals
- Find a GCF and an LCM by listing factors or multiples
- Compute a GCF and an LCM from prime factorizations, taking the lowest or highest prime power
- Explain why lowest serves the GCF and highest serves the LCM
- Apply the product rule for two numbers, and explain why it can fail for three
- Read greatest number of equal groups as GCF and coinciding cycles as LCM
Common factors and the GCF
A common factor of two positive 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 positive 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 positive whole numbers is the largest number that is a factor of both. For and the common factors are , and the greatest of these is , so
Dividing by gives and . So six identical bags can each hold two apples and three oranges, with nothing left over. No larger number divides both totals. In the next chapter, this same common-factor idea helps simplify fractions.
Common multiples and the LCM
Now flip the question around. A common multiple of two positive whole numbers is a number that is a multiple of both. List a few multiples of and of :
The positive numbers shared by the lists start . They keep going without end, so there is no greatest common multiple. The least common multiple (LCM) is the smallest positive common multiple, so
The word “positive” matters: is also a multiple of both numbers, but it is not the LCM. Counting by fours and sixes, is the first positive place the patterns meet. This makes the LCM useful for repeating events and, later, common denominators in fractions.
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 listing method finds the answer by comparing lists:
- GCF: list the factors of each number and choose the largest shared factor.
- LCM: list positive multiples in increasing order and choose the first shared multiple.
For example, the factors of are , and those of are . Their common factors are , so their GCF is . The factor does not qualify: it divides but not .
Listing is useful when the numbers are small. With larger numbers the lists can become long, so after practicing it we will use the prime factors instead.
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.
Listing works the same way for the LCM. Write out multiples of each number and watch for the first value that shows up in both lists.
Check your understanding
Using the listing method, what is ?
List multiples of each number until one appears in both lists. Multiples of : . Multiples of : .
The value is a common multiple of and too, but it is not the first, so it is not the least. The value is , not a multiple of either number at all, and is not even a multiple of .
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, and those counts are what you need for the GCF and LCM. 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.
- 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: .
The GCF agrees with the factor lists, and is the first common multiple of and . The figure separates shared prime copies from the extra copies each number needs.
Why lowest power for the GCF
A common factor can use only the prime copies that both numbers contain.
If the numbers share no prime, their only common factor is . Such numbers are called coprime (or relatively prime). For example, and are coprime, although neither is prime. If one input is , the GCF is too.
Why highest power for the LCM
A common multiple must contain enough prime copies for each number.
Why the LCM takes the highest power of each prime that appears in either number#
Again use and . A common multiple needs three s to contain ‘s factors, one to contain ‘s, and one , which serves both. Taking exactly these copies gives , which both numbers divide.
For any two positive whole numbers, compare their counts of each prime. A common multiple needs at least the larger count to contain either number’s factors. Even a prime present in just one number must be included, at its full count there.
Take exactly those required counts. Both numbers divide the resulting product. Every positive common multiple contains at least these copies, so it is a multiple of this product and cannot be smaller. This proves that the product is the LCM.
If one input is , the LCM is the other number. The GCF takes what both numbers can supply, so it takes the lower count of each prime. The LCM supplies what either number needs, so it takes the higher count.
Check your understanding
Why must contain two copies of ?
The LCM must be divisible by , which requires two copies of .
The single in is not enough to meet 's requirement. Two even inputs do not automatically contribute one copy each: the LCM of and is , which has only one . The LCM takes the higher count, two here, rather than adding or doubling counts.
Check your understanding
Why can contain only one copy of ?
The number has two copies, but has only one. A common factor must divide both, so it cannot contain .
The larger input does not always set the limit: for and , the smaller limits the copies of to one. Repeated primes can belong in a GCF; for example, .
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 ).
Check your understanding
Given and , which pair gives their GCF and LCM?
For the GCF, take the lower count of each shared prime, and .
For the LCM, take every prime at its highest count, including the found only in .
The product is a common multiple but not the least. Taking just misses the shared .
GCF and LCM together: the product rule
Look back at and . The GCF was and the LCM was , and
The same holds for any two positive whole numbers and :
To see why, picture blocks before comparing prime counts. 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 GCF times LCM uses the shared block twice and each outside block once, and so does .
Why the GCF and the LCM of two numbers multiply back to the product#
Use and . For the prime , the counts are three and two: the GCF takes two and the LCM three, totaling all five copies in . For , the counts are zero and one, so the GCF takes none and the LCM one. For , both counts are one, so each answer takes one. Together, the GCF and the LCM use the same prime copies as the two original numbers:
For any prime in any pair of numbers, there are just two counts to compare. The GCF takes the smaller and the LCM the larger, so together they take both counts. If the counts are equal, both answers take that same count. If one count is zero, the GCF takes none and the LCM takes the nonzero count.
Thus GCF times LCM has the same prime copies as the product of the original numbers. The products are equal. If either input is , its GCF with the other is and its LCM is the other number, so the rule holds in that case too.
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 highest-power rule gives the same answer: . If you already know the GCF, the product rule finds the LCM without listing anything.
Check your understanding
Given that , what is using the product rule?
The product rule says .
The value is the plain product , before dividing by the GCF. The value is the GCF you started from, not the LCM. And does not come from applying the rule correctly.
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 .
The same reasoning works however many numbers you start with. 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.
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.
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 accounts for the difference: . With two numbers there is no middle count to miss.
Check your understanding
For , , and , the GCF is and the LCM is . Why is GCF times LCM only , while ?
For the prime , the three counts are : the lowest and highest omit the middle count of one. For , the counts are , again omitting a middle count of one.
GCF times LCM misses one and one . For two inputs there is no third count to omit, which is why the product rule is guaranteed for a pair.
The lowest-power and highest-power rules work for two or more positive whole numbers. The product rule is guaranteed for two inputs, but can fail for three or more. With three or more, read the GCF and the LCM straight off the prime powers instead: this shortcut, , does not carry over to three numbers in the same simple way.
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 keep one copy of .
The value is , which leaves out . Since is odd, it has no factor , so the common factor cannot include . 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: the greatest number of equal groups
Many word problems are GCF or LCM questions about everyday situations. The signal for a GCF problem is that you are splitting things into the greatest possible number of 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 greatest number of 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 to make as many boxes 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 greatest number of equal groups is the tell that you want the GCF.
Check your understanding
A gym coach has jump ropes and cones and wants to set up the greatest possible number of identical stations, using every rope and every cone with none left over. How many stations can she set up?
Splitting into the greatest possible number of identical groups is the GCF signal. Write and , then take the lowest power of each shared prime.
The value is , the number you would want instead if the question asked when two repeating cycles of and next line up. The value is a common factor of and but not the greatest one, and is just one of the two original numbers.
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.
In a mixed problem, identify whether the answer must divide the totals or be a multiple of them.
Check your understanding
A youth group has volunteers and supply kits. It wants to form identical teams, giving every team the same number of volunteers and the same number of kits with none left over, using as many teams as it possibly can. Which computation finds the number of teams?
Splitting into as many identical teams as possible, with nothing left over, is the GCF signal: the number of teams has to divide both totals, and you want the largest number that does.
would answer a when do two repeating cycles of and next coincide question instead. Adding or multiplying the totals answers neither question.