topic badge

Extension: Prime factorizations


All whole numbers except for $1$1 are either prime or composite, and composite numbers can always be written as a product of primes. Finding this product (called a prime factoring) can be very useful.

Primes and composites

A number is prime if it has exactly two factors: $1$1, and itself. 

A number is composite if it has more than two factors.

Learn more about prime numbers in our investigation: The Sieve of Eratosthenes.

Factor trees

One of the best ways to find a prime factoring is by using a factor tree. We start with the number we want to investigate, draw a box around it, and draw two lines coming out of it. Here is how we might start with the number $12$12:

We then put two numbers that multiply to make $12$12, such as $4$4 and $3$3, at the end of each of the lines:

Because $3$3 is a prime number, we circle it. Since $4$4 is not a prime number, we draw a box around it instead:

We then repeat the process with $4$4, which is $2\times2$2×2:

And since $2$2 is prime, we circle both of these numbers:

This is a completed factor tree for $12$12, and it tells us that $12=2\times2\times3$12=2×2×3. Multiplying the circled numbers at the end of each branch together always makes the original number.

Factor trees are not always unique - here is another factor tree for $12$12:

Even though the number in the box is different, the numbers at the end of the branches will always be the same for any number - they will just be in a different order.

Here is a factor tree for $360$360:

We can therefore write: 


We usually rewrite the factors so they are in ascending order, like this:


We can use exponent notation to make the expression shorter as well:


Notice that the factor tree for $12$12 we made earlier is a smaller part of the factor tree for $360$360. This is because $12$12 is a factor of $360$360, and when we write $360=2\times2\times2\times3\times3\times5$360=2×2×2×3×3×5 we can recognize the prime factoring of $12$12 inside it: $360=2\times\left(2\times2\times3\right)\times3\times5$360=2×(2×2×3)×3×5.


Finding all the factors

Factor trees are useful because every number we write as we make it is a factor of the original number. We don't always see every factor appear, though - for example, $9$9 is a factor of $360$360, but it does not appear in the tree above.

To find every factor of a number we need to combine the prime factors in every possible way. First, we find the prime factoring like we did before, such as:


We then combine these factors in every possible way. Every factor of $12$12 can have no $2$2s, one $2$2, or two $2$2s in its prime factoring. Similarly, every factor of $12$12 can have no $3$3s, or one $3$3. Here we draw this out in a table:

Factors of $12$12
  No $2$2 One $2$2 Two $2$2s
No $3$3 $1$1 $2$2 $2\times2$2×2
One $3$3 $3$3 $2\times3$2×3 $2\times2\times3$2×2×3

We then perform each of the multiplications to find all the factors:

Factors of $12$12
  No $2$2 One $2$2 Two $2$2s
No $3$3 $1$1 $2$2 $4$4
One $3$3 $3$3 $6$6 $12$12

The factors of $12$12 are $1$1, $2$2, $3$3, $4$4, $6$6, and $12$12.

Here is how we can do it for $360$360 - every factor either has $5$5 as a factor or it doesn't, it has between zero and two $3$3s, and between zero and three $2$2s.

Factors of $360$360
    No $2$2 One $2$2 Two $2$2s Three $2$2s
No $5$5 No $3$3 $1$1 $2$2 $2\times2$2×2 $2\times2\times2$2×2×2
One $3$3 $3$3 $2\times3$2×3 $2\times2\times3$2×2×3 $2\times2\times2\times3$2×2×2×3
Two $3$3s $3\times3$3×3 $2\times3\times3$2×3×3 $2\times2\times3\times3$2×2×3×3 $2\times2\times2\times3\times3$2×2×2×3×3
One $5$5 No $3$3 $5$5 $2\times5$2×5 $2\times2\times5$2×2×5 $2\times2\times2\times5$2×2×2×5
One $3$3 $3\times5$3×5 $2\times3\times5$2×3×5 $2\times2\times3\times5$2×2×3×5 $2\times2\times2\times3\times5$2×2×2×3×5
Two $3$3s $3\times3\times5$3×3×5 $2\times3\times3\times5$2×3×3×5 $2\times2\times3\times3\times5$2×2×3×3×5 $2\times2\times2\times3\times3\times5$2×2×2×3×3×5

This table shows all the possible ways to multiply the prime factors together. We evaluate the multiplications to find all the factors:

Factors of $360$360
    No $2$2 One $2$2 Two $2$2s Three $2$2s
No $5$5 No $3$3 $1$1 $2$2 $4$4 $8$8
One $3$3 $3$3 $6$6 $12$12 $24$24
Two $3$3s $9$9 $18$18 $36$36 $72$72
One $5$5 No $3$3 $5$5 $10$10 $20$20 $40$40
One $3$3 $15$15 $30$30 $60$60 $120$120
Two $3$3s $45$45 $90$90 $180$180 $360$360

The factors of $360$360 are $1$1$2$2$3$3$4$4$5$5$6$6$8$8$9$9$10$10$12$12$15$15$18$18$20$20$24$24$30$30$36$36$40$40$45$45$60$60$72$72$90$90$120$120$180$180, and $360$360.


Practice questions

Question 1

A number has the following factor tree:

  1. What is this number at the top of the tree?

Question 2

Write $148$148 as a product of its prime factors.

Question 3

In this question we will be finding the factors of $20$20.

  1. First, write $20$20 as a product of prime factors in expanded form.

  2. Using your answer from part (a), list all the factors of $20$20, separated by commas.

What is Mathspace

About Mathspace