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 11 is a way of writing it as a product of prime numbers only. For example,

12=2×2×3,30=2×3×5,7=7.12 = 2 \times 2 \times 3, \qquad 30 = 2 \times 3 \times 5, \qquad 7 = 7.

Every factor on the right is prime. A number like 1212 that is composite breaks into several primes. A number that is already prime, like 77, 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 1212 are 1,2,3,4,6,121, 2, 3, 4, 6, 12, 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 6060 come apart. Start anywhere you like, say 60=6×1060 = 6 \times 10. Neither piece is prime, so split each one again: 6=2×36 = 2 \times 3 and 10=2×510 = 2 \times 5. Every piece is now prime, and 60=2×3×2×560 = 2 \times 3 \times 2 \times 5.

Each step traded a number for pieces smaller than it, and no piece is allowed below 22. There is only so much room between 22 and 6060, so the splitting runs out of places to go. The same reasoning works for any whole number greater than 11: every split trades a number for smaller pieces, the pieces can never sink below 22, 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 11 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 3636. One natural split is 36=4×936 = 4 \times 9. Neither 44 nor 99 is prime, so each splits again: 4=2×24 = 2 \times 2 and 9=3×39 = 3 \times 3. Now every leaf is prime, so we are finished.

A factor tree for 36, split first as 4 x 9. Each composite branch splits again until every leaf (highlighted) is prime. A factor tree that splits 36 down to its prime factors. 2 2 4 3 3 9 36
A factor tree for 36, split first as 4 x 9. Each composite branch splits again until every leaf (highlighted) is prime.

Reading the leaves from left to right gives

36=2×2×3×3.36 = 2 \times 2 \times 3 \times 3.

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 4848 as 48=6×848 = 6 \times 8, and split each branch until every leaf is prime.

Check your understanding

Finish the factor tree for 4848, starting from 48=6×848 = 6 \times 8. What are the prime leaves?

Answer choices

Repeated multiplication in exponent form

When the same prime shows up more than once, writing it out in full gets clumsy. The factorization of 3636 has two 22s and two 33s, and a larger number can have a prime repeated many times. There is a compact shorthand: 2×22 \times 2 can be written 222^2, and 2×2×22 \times 2 \times 2 can be written 232^3. 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:

23=2×2×2=8,32=3×3=9.2^3 = 2 \times 2 \times 2 = 8, \qquad 3^2 = 3 \times 3 = 9.

Using this, the factorization of 3636 becomes

36=2×2×3×3=22×32.36 = 2 \times 2 \times 3 \times 3 = 2^2 \times 3^2.

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 2424 in prime-power form?

Answer choices

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 11. The divisors you used, in order, are the prime factorization.

Run this on 360360. The smallest prime dividing it is 22, and you keep dividing by 22 as long as the result stays even:

360÷2=180,180÷2=90,90÷2=45.360 \div 2 = 180, \quad 180 \div 2 = 90, \quad 90 \div 2 = 45.

Now 4545 is odd, so 22 is finished. The smallest prime that divides 4545 is 33:

45÷3=15,15÷3=5.45 \div 3 = 15, \quad 15 \div 3 = 5.

Finally 55 is prime and divides itself: 5÷5=15 \div 5 = 1. We have reached 11, so we stop. The divisors, in the order we used them, were 2,2,2,3,3,52, 2, 2, 3, 3, 5, so

360=23×32×5.360 = 2^3 \times 3^2 \times 5.

The divisibility rules from earlier in this chapter make each step quick. They tell you at a glance whether 22, 33, or 55 divides the current number, so you rarely have to guess.

This is where the prime factorization starts paying off. Regroup the primes of 360360 any way you like and you get a genuine factor pair for free: (2×32)×(22×5)=18×20(2 \times 3^2) \times (2^2 \times 5) = 18 \times 20, so 360=18×20360 = 18 \times 20. 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 8484

Use repeated division, always dividing by the smallest prime that fits.

The number 8484 is even, so start with 22:

84÷2=42,42÷2=21.84 \div 2 = 42, \qquad 42 \div 2 = 21.

Now 2121 is odd, so 22 is done. Its digit sum is 2+1=32 + 1 = 3, a multiple of 33, so divide by 33:

21÷3=7.21 \div 3 = 7.

The quotient 77 is prime, so the last step is 7÷7=17 \div 7 = 1. Collecting the divisors 2,2,3,72, 2, 3, 7 and grouping the repeats,

84=2×2×3×7=22×3×7.84 = 2 \times 2 \times 3 \times 7 = 2^2 \times 3 \times 7.

A prime that appears only once, like the 33 and the 77 here, is written with no exponent (an exponent of 11 is understood). As a check, multiply the factorization back out: 22×3×7=4×3×7=842^2 \times 3 \times 7 = 4 \times 3 \times 7 = 84, the number we started with.

The Fundamental Theorem of Arithmetic

Here is the result that makes prime factorization so powerful. We saw that 3636 could be started as 4×94 \times 9. But you could just as well start it as 6×66 \times 6, or as 2×182 \times 18. Do those other starting splits change the final answer?

Two factor trees for 36 reach the same primesThe left tree splits 36 as 4 times 9; the right tree splits 36 as 6 times 6. Both end in the prime leaves 2, 2, 3, 3.start with 4 x 9start with 6 x 63649223336662323both give 2 x 2 x 3 x 3
Two different factor trees for 36. The left starts 4 x 9, the right starts 6 x 6. The starting splits differ, but the leaves at the bottom are the same four primes: two 2s and two 3s.

Both trees end in the same four primes: two 22s and two 33s. The order of the leaves changes, but the collection does not. This is not a lucky coincidence of 3636. 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 11 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 33 and 2×6=122 \times 6 = 12: the 33 shows up in the 66. Every prime has this guarantee. A composite number need not: 44 divides 2×6=122 \times 6 = 12, but 44 divides neither 22 nor 66.

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 7272 as 8×98 \times 9, and Jon splits it as 6×126 \times 12. Whose final list of prime factors is correct?

Answer choices

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 360360 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 539539

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 539539 is odd, so 22 is out. Its digit sum is 5+3+9=175 + 3 + 9 = 17, not a multiple of 33, so 33 is out. It does not end in 00 or 55, so 55 is out. The next prime is 77:

539÷7=77.539 \div 7 = 77.

So 77 works, and now factor the quotient 7777. It is 7×117 \times 11:

77÷7=11,11÷11=1.77 \div 7 = 11, \quad 11 \div 11 = 1.

Both 77 and 1111 are prime, so the factorization is

539=7×7×11=72×11.539 = 7 \times 7 \times 11 = 7^2 \times 11.

When the small primes all fail, work upward through 7,11,13,…7, 11, 13, \ldots, 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 9090?

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

Go deeper (optional)

You can skip this and keep going. Read it if you want to know more.

Why the splitting always finishes

The lesson showed the reasoning on 6060: every split trades a number for smaller pieces, and the pieces can never sink below 22, so the splitting has to stop. Here is that same argument run on a second number, and then written so it covers every whole number at once.

Why every whole number greater than 11 is a product of primes#

Follow 126126 through the argument. It is composite, so it splits, say 126=2×63126 = 2 \times 63, and both factors are smaller than 126126. The 22 is prime, so that branch is finished. The 6363 is composite, so put the same question to it: 63=7×963 = 7 \times 9, and the 99 splits once more into 3×33 \times 3. Every piece is prime now, and 126=2×7×3×3126 = 2 \times 7 \times 3 \times 3. Each split lowered the numbers in play, and they can never sink below 22, which is why the splitting ran out of moves.

Now the general version, with a letter in place of the 126126.

Take any whole number nn greater than 11. Either it is prime or it is composite.

If nn is prime, you are already done: nn by itself is a product of primes.

If nn is composite, it has a factor other than 11 and itself. So you can write n=a×bn = a \times b with both aa and bb greater than 11, which makes both smaller than nn. Ask the same question of each one: leave it alone if it is prime, split it again if it is composite, and keep repeating.

This has to end, because every split replaces a number with strictly smaller factors. There are only finitely many whole numbers between 22 and nn to descend through. It ends exactly when every factor is prime, since a prime is the only number that refuses to split. That leaves nn written as a product of primes.

Why the answer cannot depend on how you split the number

The lesson gives the reason uniqueness holds: a prime lands whole inside one factor of a product. This is that reason carried all the way to a finish, for anyone who wants to see the pairing done rather than described.

The idea behind uniqueness#

One fact about primes carries the whole argument: if a prime divides a product of two numbers, it divides at least one of them. For instance 33 divides 2×6=122 \times 6 = 12, and sure enough 33 divides the 66. This is the special property, seen earlier in the lesson, that composite numbers do not share.

Watch the pairing work on 6060, whose prime list is 2,2,3,52, 2, 3, 5. Suppose someone claims a second and different list for it. Take the 55 from the first list. It divides 6060, so it divides the product of the claimed primes, and by the fact above it has to divide one of them. That forces the prime it divides to be 55 itself. Cross out a 55 from each list and 1212 is left on both sides, ready for the same move with the 33, and then with the two 22s. The lists empty together, so the second was the first all along.

Now the same argument with letters. Suppose some number had two genuinely different prime factorizations, and pick a prime pp from the first. That number also equals the product of the second list, and pp divides the number, so pp divides that product. By the fact above, pp divides one of those primes, and one prime divides another only when they are equal. So pp matches a prime in the second list exactly. Cancel the matching pair from both lists and repeat on what remains. Every prime in the first list is paired off this way, and none can be stranded in the second. When the first list runs out, what is left of it multiplies to 11. So what is left of the second must multiply to 11 too, and no prime can do that. The two lists were the same all along, in a different order.

A bit of history (optional)

Why would anyone bother to prove the theorem in this lesson? That a number breaks into primes in just one way looks too obvious to argue about.

Then people began inventing new kinds of number. In the 1840s a German mathematician named Ernst Kummer was working inside one such system. It had its own primes and its own factor lists, and one alarming feature: a number in it could be built from two genuinely different sets of building blocks. Uniqueness simply failed.

That is why our version earns a proof and a grand name. Ordinary whole numbers behave, but they were never obliged to. That good behavior rests on one small fact about primes. A prime dividing a product must land whole inside one of the two factors.

So when your factor tree and a classmate’s tree end in the same primes, that is not luck. It is built into the number, and it had to be earned.