Introduction

Welcome back to Breaking Numbers Into Primes! This is the second of four lessons in the course, and your understanding of prime factorisation is already taking shape. In our previous lesson, we explored what prime factorisation means, confirmed that every number has a unique prime "fingerprint," and practised decomposing small numbers by inspection. Now we are ready for a visual, structured method called the factor tree that keeps our work organised as numbers grow larger. Let's jump in!

Why We Need a Systematic Approach

In the last lesson, we broke apart small numbers like 1818 and 3030 by mentally dividing out primes one at a time. That works nicely when numbers are small, but what happens with a number like 180180 or 360360? Keeping track of all the pieces in our heads gets tricky fast.

A factor tree solves this problem by giving us a clear visual framework. We write each split on paper, branch by branch, until every endpoint is prime. Think of it like mapping out a family tree for a number — the "ancestors" at the top are composite, and the final "descendants" at the bottom are always primes.

What Is a Factor Tree?

A factor tree starts with a composite number at the top and splits it into two factors on the branches below. If a factor is still composite, we split it again. If a factor is prime, we mark it and leave it alone — it becomes a leaf of the tree. We keep going until every branch ends at a prime, and multiplying all the leaves together gives us back the original number.

Conceptual illustration of a factor tree showing composite numbers at interior nodes and primes as highlighted leaves at the tips

Here are the rules to follow at each step:

  1. Choose any factor pair of the current number (both factors must be greater than 11).
  2. Write the two factors as branches below the number.
  3. Mark any prime factor as a leaf — it needs no further splitting.
  4. Split any composite factor by repeating from step 1.
  5. Stop when every branch ends at a prime.
Building a Factor Tree: Example with 36

Let's walk through 3636 step by step to see the method in action.

Step 1: Pick a factor pair of 3636. We will start with 4×94 \times 9. Write 3636 at the top, then draw branches down to 44 and . Neither is prime, so both still need splitting.

A Larger Example: 60

Now let's try 6060, choosing 6×106 \times 10 as our starting pair.

Step 1: Write 6060 at the top and branch into 66 and 1010. Both are composite, so we keep going.

Step 2: Split into . Both are prime — mark them as leaves.

Different Starting Splits, Same Result

One of the best things about factor trees is that you cannot pick a "wrong" starting pair. The Fundamental Theorem of Arithmetic, which we met in the previous lesson, guarantees that every number has exactly one prime factorisation regardless of how you split it. Let's see this in action with two trees for 6060.

Tree A begins with 60=6×1060 = 6 \times 10. Splitting 66 gives 2×32 \times 3 (both prime), and splitting gives (both prime). The leaves are .

Practical Tips for Building Factor Trees

A few pointers will make your factor trees smooth and reliable:

  • Start with small primes when convenient. If the number is even, splitting out a 22 first often simplifies things quickly. But any valid pair works, so choose what feels comfortable.
  • Mark primes immediately. As soon as a branch lands on a prime, circle it or highlight it. This prevents accidentally trying to split a prime further.
  • Always multiply back. Once you have collected all the leaves, multiply them together to confirm the product equals the original number.

One common mistake is stopping too early. For example, if we split 7272 into 8×98 \times 9 and then write 8=2×48 = 2 \times 4, we are not done — the factor is still composite and must be split into . Every single leaf must be prime before the tree is complete.

Conclusion and Next Steps

In this lesson, we learned how to use factor trees to break any composite number into its prime factors in an organised, visual way. The process is straightforward: pick a factor pair, split composite factors further, and stop when every branch ends at a prime. We also saw firsthand that different starting splits always lead to the same set of prime factors, so there is no wrong way to begin.

Up next, you will put those branching skills into practice! You will complete partial factor trees, build your own from scratch for various numbers, explore how different starting pairs converge on the same answer, and explain your reasoning step by step.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal