Prime Factorization
Progress can't be saved in this browser, so this lesson's status can't be set.
Watch the video explainer
Learning goals
- Build a factor tree until every leaf is prime
- Divide repeatedly by the smallest prime that fits, using the divisibility rules to move fast
- Collect repeated primes into prime-power form
- Explain why the starting split never changes the final list of primes
What a prime factorization is
A prime factorization of a whole number greater than is a way of writing it as a product of prime numbers only. For example,
Every factor on the right is prime. A composite number such as splits into several primes; an already-prime number such as is its own prime factorization. Stop only when every factor is prime, not merely when you have found a factor pair.
A list of factors is something different. The factors of are . Its prime factorization is : it tells you which primes to multiply, including repeated copies. So the factor list gives the divisors, and the prime factorization gives a multiplication recipe.
Every number breaks down into primes
Every whole number greater than can be written as a product of primes. For , begin with , then split both composite pieces:
Each split replaces a composite with smaller factors greater than . They cannot shrink forever, since none drops below . Splitting can stop only when no piece can split further, so every piece left is prime.
We still need to ask whether different starting splits can produce different prime lists.
The factor-tree method
A factor tree records each split as two branches. If the number is already prime, its factorization is complete. Otherwise, write it at the top and split it into two factors greater than whose product is that number. Split each composite factor again; stop and circle each prime. The primes at the ends of the branches are the leaves. Multiply those leaves to recover the starting number.
Take . One natural split is . Neither nor is prime, so each splits again: and . Now every leaf is prime, so we are finished.
Reading the leaves from left to right gives
It does not matter which factor you write first or which branch you split first. As long as you keep going until every leaf is prime, the leaves you collect are the prime factorization.
Now try building one yourself. Start as , and split each branch until every leaf is prime.
Check your understanding
Finish the factor tree for , starting from . What are the prime leaves?
Split each branch: and . Together that is four s and one .
The other choices stop too early: never splits at all, and the other two leave a composite factor ( or ) unsplit.
Repeated multiplication in exponent form
Repeated primes can be written more compactly. The factorization of has two s and two s. Write as . The small raised number is the exponent: it counts the copies being multiplied. So means , not .
Using this, the factorization of becomes
This is prime-power form: write each distinct prime once, with an exponent counting its copies. List the primes from smallest to largest. A single copy needs no written exponent. You can expand a power to check the count whenever needed.
Check your understanding
Which of these is the prime factorization of in prime-power form?
Split until every factor is prime. One path is .
The other choices stop too early: , , and are all still composite, so those are not prime factorizations.
Repeated division by primes
Repeated division by primes records the same factors in a single column. Divide by the smallest prime that fits, then do the same to the quotient. When the quotient reaches , stop. The divisors you used multiply to the original number.
Run this on . The smallest prime dividing it is , and you keep dividing by as long as the result stays even:
Now is odd, so is finished. The smallest prime that divides is :
Finally is prime and divides itself: . We have reached , so we stop. The divisors, in the order we used them, were , so
The divisibility rules from earlier in this chapter make each step quick. They tell you at a glance whether , , or divides the current number, so you rarely have to guess.
The prime factorization also gives you factor pairs. Regroup the primes of into two groups and you get a factor pair for free: , so . Finding that pair by guessing would take longer than reading it off the factorization. The next lesson uses this same idea to find the greatest common factor and least common multiple of two numbers.
Worked example 1 Find the prime factorization of
Use repeated division, always dividing by the smallest prime that fits.
The number is even, so start with :
Now is odd, so is done. Its digit sum is , a multiple of , so divide by :
The quotient is prime, so the last step is . Collecting the divisors and grouping the repeats,
A prime that appears only once, like the and the here, is written with no exponent (an exponent of is understood). As a check, multiply the factorization back out: , the number we started with.
The Fundamental Theorem of Arithmetic
We saw that could be started as . But you could just as well start it as , or as . Do those other starting splits change the final answer?
Both trees end with two s and two s. Their order changes, but their numbers and counts agree. This is true for every whole number greater than :
The Fundamental Theorem of Arithmetic says that each such number has exactly one prime factorization, apart from order. Any correct tree that finishes at primes must reach that same list.
Why is the answer always the same? The reason is a special fact about primes: if a prime divides a product of two numbers, it must divide at least one of them. Take and : the shows up in the . This is true of every prime. A composite number need not behave this way: divides , but divides neither nor .
Because of this fact, every prime in one list has to match a prime in the other, so neither list can hold anything the other is missing.
Check your understanding
Maria splits as , and Jon splits it as . Whose final list of prime factors is correct?
Finish each split down to primes. Maria: . Jon: .
By the Fundamental Theorem of Arithmetic the starting split cannot change the answer, so both reach the same factorization.
Check your understanding
Why must different completed factor trees for give the same primes, , , and ?
The number is divisible by the prime . Thus any product of primes equal to must include a prime divisible by . That prime can only be itself.
After matching and removing that , both products equal . Matching the remaining primes in the same way explains why the starting split cannot change the completed list.
Equal products can have different composite factors: . These also give different starting pairs. Splitting preserves the product, not the number of factors: both trees finish with three prime leaves.
Larger numbers, same method
Bigger numbers use the same method, though they can take more steps. Peel off the small primes first using the divisibility rules, which shrinks the number fast and keeps the arithmetic light, as in the example above. But sometimes none of the small primes fit at all, and you have to work upward.
Worked example 2 Find the prime factorization of
Use the divisibility rules to cross off the small primes, then test the next ones in turn.
The number is odd, so is out. Its digit sum is , not a multiple of , so is out. It does not end in or , so is out. The next prime is :
So works, and now factor the quotient . It is :
Both and are prime, so the factorization is
When the small primes all fail, work upward through , and remember the stopping rule from the last lesson: keep testing primes only while the prime times itself is at most the number you are testing. Once every prime up to that point has failed, what remains is itself prime.
Check your understanding
Using the smallest prime that fits at each step, which division record correctly factors ?
Start with because is even. The quotient is odd and its digits add to , so is the smallest prime that fits. Divide by again at , then by .
The record starting with still gives the correct primes, but does not follow the requested smallest-prime order. The last two records stop before the quotient reaches .