Prime Factorization
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 number like that is composite breaks into several primes. A number that is already prime, like , is its own prime factorization, a product of a single prime. The point is to keep splitting until you cannot split any further, which happens exactly when every remaining factor is prime. The splitting stops there because a prime is the kind of number that has no smaller factors to break off.
This is different from just listing factors. The factors of are , a mixed bag of primes and composites. The prime factorization picks out only the prime building blocks and shows how many of each you multiply together to rebuild the number. It is the recipe, not the inventory.
Every number breaks down into primes
Before learning a method, settle the basic question: can every composite number really be written this way? The answer is yes.
Watch come apart. Start anywhere you like, say . Neither piece is prime, so split each one again: and . Every piece is now prime, and .
Each step traded a number for pieces smaller than it, and no piece is allowed below . There is only so much room between and , so the splitting runs out of places to go. The same reasoning works for any whole number greater than : every split trades a number for smaller pieces, the pieces can never sink below , so the splitting always has to stop, and it stops exactly when only primes are left.
Whatever number you start with, the splitting ends in a pile of primes that multiply back to it. The question left is whether two people who split the same number in two different ways could end up with two different piles.
The factor-tree method
The most common way to carry out the splitting is a factor tree (a diagram that branches a number down into its primes). Write the number at the top. Find any two factors whose product is that number (not and the number itself, but a genuine split). Then draw a branch down to each. Whenever a number is composite, split it again. Whenever a number is prime, stop that branch and circle it. The factorization is the collection of primes at the ends of the branches, the leaves of the tree.
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
When the same prime shows up more than once, writing it out in full gets clumsy. The factorization of has two s and two s, and a larger number can have a prime repeated many times. There is a compact shorthand: can be written , and can be written . The small raised number, the exponent, just counts how many copies of the prime are multiplied together. It is nothing more than shorthand for repeated multiplication:
Using this, the factorization of becomes
This compact form is called prime-power form: each distinct prime written once, with an exponent telling how many times it appears. When you write a factorization, group the equal primes together and collect them into powers, and by convention list the primes from smallest to largest. You can always expand the shorthand back into a plain product whenever you want to see every factor spelled out.
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
A factor tree can branch in many shapes, which is handy but a little untidy for bookkeeping. A second method keeps everything in a single column: repeated division by primes. Divide the number by the smallest prime that goes into it, then divide the quotient by the smallest prime that goes into it. Keep going until the quotient reaches . The divisors you used, in order, are the prime factorization.
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.
This is where the prime factorization starts paying off. Regroup the primes of any way you like and you get a genuine factor pair for free: , so . Spotting 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
Here is the result that makes prime factorization so powerful. 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 in the same four primes: two s and two s. The order of the leaves changes, but the collection does not. This is not a lucky coincidence of . It is a law that holds for every whole number, important enough to have a name.
Apart from the order in which you write the factors, every whole number greater than has exactly one prime factorization. That statement is the Fundamental Theorem of Arithmetic. The order may change, but the same primes show up the same number of times, no matter how you start the tree. That uniqueness is also why we can speak of the prime factorization of a number rather than a prime factorization.
Why is the answer always the same? It comes down to one 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 . Every prime has this guarantee. A composite number need not: divides , but divides neither nor .
That is what ties two prime lists together. Every prime in one list has to match a prime in the other, so neither list can hold anything the other is missing.
So a prime factorization is a fact about the number, not a choice you make.
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.
Larger numbers, same method
Nothing changes for bigger numbers; you just 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
This one has no small even or five factor to give it away. So lean on the divisibility rules to rule out the easy 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
What is the prime factorization of ?
Divide by the smallest prime each time: , then , then , then .
The choice is missing a , uses composite factors, and has one too many.