J10M

Joue 10 minutes.

Prime Factor Tree

Split every number down to its primes, which light up like lanterns. Eight trees against the clock, solo or in a race.

Ages 10 and up

A number appears at the top of the screen: 84. Which prime number divides it? You tap 2, and the number splits into two branches: a lantern marked 2 that lights up, and a 42 still waiting to be split. Another 2, then a 3, and you are left with 7, which no key can split any further. You declare it prime, it lights up in turn, and the factorization is written out under the tree: 84 = 2² × 3 × 7. The next number shows up right away.

Prime Factor Tree is a factor tree game for learning, reviewing or simply practicing prime factorization. A game is a series of eight numbers, played against the clock. It runs in your browser, with a finger on a phone, a mouse or the keyboard, with no sign-up and no download. It is made for middle school and high school students, and for anyone who enjoys numbers. If you have ever drawn a factor tree on paper in math class, you already know the idea: here, every branch you draw is checked on the spot.

How to play Prime Factor Tree

Each tree starts with a composite number at the very top. Below it sits a keypad: the small prime numbers, plus a purple key marked "Prime."

  • Tap a prime number that divides the current number: the number splits. The divisor hangs off one side of the branch, already lit, and the quotient keeps going down the middle. Then you split that quotient, and so on.
  • Tap "Prime" when the number at the end of the branch can't be divided any further: it lights up, and the tree is done. If that last number is on the keypad, you can also tap its own key: 7 only splits into 7.
  • Read the factorization. Once every leaf is lit, the whole product is written out, with exponents: 360 = 2³ × 3² × 5. Then the next tree grows.

A line between the tree and the keypad comments on every move: "84 = 2 × 42," then "42 = 2 × 21." When you make a mistake, it explains why in one sentence. If you pick 5 for 84, it reminds you that 84 doesn't end in 0 or 5. If you declare a number prime when it isn't, it shows you its factors: "91 is not prime: 91 = 7 × 13." After two wrong divisors in a row on the same number, or after a wrong "Prime," the right key starts to glow.

What is a prime number?

A prime number is a whole number with exactly two divisors: 1 and itself. 2, 3, 5, 7, 11 and 13 are prime; 12 is not, since it can also be divided by 2, 3, 4 and 6. The number 1 is not prime: it only has one divisor. And 2 is the only even prime, since every other even number can be divided by 2.

There are twenty-five prime numbers below 100: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97. Knowing them by heart saves you precious time in the game, and in every math class after it. There are infinitely many primes: more than two thousand years ago, Euclid proved it by noticing that if you multiply all the primes in a finite list and add 1, the result can't be divided by any of them.

To find all of them up to a limit, there is a famous method called the sieve of Eratosthenes. Write down the numbers from 2 to 100, circle 2 and cross out all its multiples, then circle the first number that isn't crossed out, 3, and cross out its multiples, and so on. The numbers left circled are the primes. In the game, the start screen shows a little garden of those twenty-five numbers: each one lights up the first time you make it shine in a tree.

Prime factorization, step by step

Every whole number from 2 up can be written as a product of prime numbers, and in only one way, apart from the order. That is the fundamental theorem of arithmetic. It doesn't matter where you start: whether you split 60 by 2, by 3 or by 5, you always end up with the same leaves, 2, 2, 3 and 5, so 60 = 2² × 3 × 5. Prime numbers are, in a way, the building blocks of every other number.

The surest method is repeated division: try 2 as long as the number is even, then 3, then 5, then 7, and so on. One rule of thumb saves a lot of time: you only need to try the primes whose square is no bigger than the number. To find out whether 97 is prime, there is no point going past 7, since 11 × 11 = 121 is already more than 97. Neither 2, 3, 5 nor 7 divides 97: it is prime. That is why the keypad stops at 7 on the first level, where the numbers don't go above 100.

Divisibility rules

To split fast, you need to spot a divisor at a glance. Here are the most useful divisibility rules:

  • By 2: the number is even, it ends in 0, 2, 4, 6 or 8.
  • By 3: the sum of its digits is a multiple of 3. For 741, 7 + 4 + 1 = 12, so 741 is divisible by 3.
  • By 5: it ends in 0 or 5.
  • By 9: the sum of its digits is a multiple of 9. If a number is divisible by 9, you can split it by 3 twice.
  • By 11: for a three-digit number, the first digit minus the middle one plus the last one gives 0 or 11. For 143, 1 − 4 + 3 = 0, so 143 = 11 × 13.
  • By 7: no rule as simple, but a trick. Drop the last digit, double it and subtract it from what is left. For 91: 9 − 2 × 1 = 7, a multiple of 7, so 91 is too.

Beyond that, for 13, 17, 19 or 23, there is no shortcut left: you have to do the division in your head. That is what the higher levels are all about.

Three levels

You choose your level before you start, on the start screen.

  • Seedling: numbers up to 100, and a keypad with four keys, 2, 3, 5 and 7. The right level to discover prime numbers, from the end of elementary school. It earns 60% of the points.
  • Shrub: numbers from 100 to 999, and primes up to 31 on the keypad. Most numbers have at least three prime factors, and the last one can be a big prime like 47 or 73 that you need to recognize. It earns 80% of the points.
  • Mighty oak: numbers from 1,000 to 9,999, with at least two two-digit factors. Trees like 8,959 = 17² × 31 call for real mental division. It earns all the points.

On every level, each series includes two trap numbers that look prime but aren't: 91 on the first level, 221 = 13 × 17 on the second, 1,207 = 17 × 71 on the third. The eight numbers of a series come from smallest to largest.

Score and leaderboard

Your score starts at 10,000 points, minus one point per tenth of a second. Every mistake, a wrong divisor or a false "Prime," adds 10 seconds to your time. The total is then multiplied by the level's percentage. The clock stops while the factorization of a finished tree is on display: only the time you spend playing counts. A fast, flawless series on the Mighty oak level can top 8,000 points.

You can play as often as you like: only your best score appears on the leaderboard. Every game you send is replayed move by move by the server, which works out the time and the score on its own: nobody can claim a result they didn't play.

Play Prime Factor Tree with friends: the race

Prime Factor Tree also works as a race between friends, from two to four players, each on their own screen. On the game page, choose Play together, then Create a table. Send the link, let your friends scan the QR code, or read them the eight-letter table code, which they type in after tapping Join. As the host, you accept each request before you start the race.

Everyone gets the same eight numbers, at the Shrub level. There are no turns: each player splits their trees at their own pace. In a race, a mistake doesn't cost you time, it freezes you: the keypad frosts over for 3 seconds after your first mistake, 5 after the second, then 8 after each one after that. At the top of the screen, you see how the others are doing, with their finished trees and their mistakes. The first player to finish all eight trees wins, and the standings follow: first who finished, then the number of trees, then the lanterns already lit in the tree in progress, and if that is still a tie, the fewest mistakes. Races don't go on the game's leaderboard, which stays a solo leaderboard.

What are prime numbers good for?

Much more than a math class exercise. Prime factorization first helps you simplify fractions: 84/90 is (2² × 3 × 7) / (2 × 3² × 5), and once you cross out the common factors you are left with 14/15. It also gives you the greatest common factor and the least common multiple of two numbers, the one you look for when you put two fractions over the same denominator.

Prime numbers also protect what you do online. Multiplying two large primes is easy for a computer; finding those two numbers again from their product, when they have hundreds of digits, is beyond the reach of today's machines. A large part of the encryption that secures online payments relies on that imbalance. On the Mighty oak level, when you hunt for the 17 hidden in 1,207, you get a tiny taste of that very same difficulty.

Tips for faster factor trees

Always start small. Look at the last digit first: even means 2; 0 or 5 means 5. Then add up the digits for 3. Those three tests cover the vast majority of numbers.

Learn the twenty-five primes below 100. At the end of each tree, you have to decide whether the last number is prime. Knowing by heart that 51 = 3 × 17 and that 53 is prime saves you both the mistake and the hesitation.

Think about the square. As soon as the square of the next prime to try is bigger than the number, stop: it is prime.

Watch out for odd numbers that don't end in 5. Those are the traps: 91, 119, 133, 143, 169, 187, 209, 221. A quick mental check by 7, 11 or 13 will save you ten seconds.

On a keyboard, type the divisor. For 13, type 1 then 3. A digit that can't start any other prime on the keypad, like 5 or 7, goes through as soon as you press it, and Enter confirms without waiting. The P key declares a number prime, and the arrow keys move between the keys of the keypad.

For more math practice, browse the educational games category.

Frequently asked questions

Do I have to pay or sign up to play?

Neither. The game is free and opens in your browser. For the leaderboard, a nickname chosen with your first score is all you need.

Is 1 a prime number?

No. A prime number has exactly two divisors, 1 and itself. The number 1 only has one. That is also what makes prime factorization unique: if 1 were prime, you could add it as many times as you like.

What happens when I make a mistake?

The explanation line tells you why, and your clock takes a 10-second penalty. The number stays where it is: you try again with another divisor. You never lose the game.

Why doesn't the keypad show every prime number?

Because it doesn't need to. A composite number always has a prime factor whose square is no bigger than the number: up to 100, 2, 3, 5 and 7 are enough. The last number of each tree is declared prime with the "Prime" key.

Does the order of the divisions matter?

Not for the result: the factorization is the same whichever path you take. Yes for speed: starting with the small factors, which are easy to spot, is almost always the fastest way.

Can I play with just a keyboard?

Yes, completely. Type the divisor on the number pad or the row of digits, press P to declare a number prime, and use the arrow keys and Tab to move through the keys.

What age is this game for?

The Seedling level works from age 10, once you know your multiplication tables. The Shrub and Mighty oak levels are aimed at middle school and high school, and at adults who want to keep their mind sharp.

More educational games

Educational games
  • Mental Math
    Twenty sums that get harder and harder: answer right, and as fast as you can.
  • Europe Chase
    A thief runs from city to city. Read the clues, follow the trail and name them.
  • Flag Quiz
    Name the flag, or find the flag of the country: twenty rounds, 162 countries.
  • World Capitals
    The capital of a country, or the country of a capital: twenty timed rounds.
  • Human Bones
    A skeleton, a bone named: click the right one. Twelve bones, two levels.
  • Chemical Elements
    Find the elements in the periodic table. Twenty rounds, three levels.
  • Inventions in Order
    Put the great inventions in order of time. Three levels, 160 dates.
  • The Solar System
    Order the planets and moons by distance or by size. Three levels, 30 bodies.