NOVANews
๐Ÿ”ข Maths

What are prime numbers?

Primes are the building blocks of every whole number, they never run out, and they guard your secrets online. Grab a pencil and sift them out with a 2,000-year-old trick.

A dark oil painting of a bearded man in a torn grey robe holding up pages covered in geometry diagrams, with old books on the table in front of him
Euclid, as imagined by the painter Jusepe de Ribera around 1630. More than 2,000 years ago, Euclid proved that the prime numbers never run out. Photo: Jusepe de Ribera, J. Paul Getty Museum, Public domain, via Wikimedia Commons

The numbers that will not split

Try sharing 12 lollies into equal piles. You can make 2 piles of 6, 3 piles of 4, 4 piles of 3 or 6 piles of 2. Now try 13. The only ways are 1 pile of 13 or 13 piles of 1. Numbers like 13 are special. We call them prime numbers.

A prime number is a whole number bigger than 1 that has exactly two factors: 1 and itself. The first primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. A whole number bigger than 1 with more than two factors, like 12, is called a composite number, because it is composed, or built, from smaller numbers.

Notice that 2 is prime. It is the only even prime, because every other even number can be divided by 2. Mathematicians like to joke that this makes 2 the oddest prime of all.

Why 1 misses out

Is 1 a prime? It has only one factor, itself, so it does not fit the rule. Mathematicians say 1 is neither prime nor composite. Long ago some people did count 1 as a prime, but there is a good reason we no longer do.

Every whole number bigger than 1 can be built by multiplying primes together, and there is only one way to do it. For example, 36 = 2 ร— 2 ร— 3 ร— 3, and no other collection of primes multiplies to 36. This rule is so important that it has a grand name: the fundamental theorem of arithmetic. Primes are like the atoms of the number world. Everything else is made from them.

If 1 were a prime, the rule would break. You could write 36 = 1 ร— 2 ร— 2 ร— 3 ร— 3, or 1 ร— 1 ร— 2 ร— 2 ร— 3 ร— 3, and keep going forever. Leaving 1 out keeps the building blocks tidy.

A sieve for numbers

More than 2,200 years ago, a Greek scholar named Eratosthenes ran the great library at Alexandria in Egypt. He worked out the size of the Earth by measuring shadows, and his answer was remarkably close. Other scholars nicknamed him Beta, the second letter of the Greek alphabet, because he came second in almost every subject. He was also a fine mathematician, and he invented a simple way to catch primes.

His method works like a kitchen sieve. Write out the numbers from 1 to 100. Cross out 1. Circle 2, then cross out every other multiple of 2: 4, 6, 8 and so on. Circle the next number still standing, 3, and cross out its multiples. Do the same for 5, then 7.

That is all it takes. Every number left uncrossed is prime, and you will find exactly 25 of them below 100. Computers still use versions of the sieve of Eratosthenes to hunt for primes today.

They never run out

Primes get rarer as numbers grow. There are 25 primes below 100, but only 168 below 1,000 and 1,229 below 10,000. So do they eventually stop? Around 300 BC, the Greek mathematician Euclid proved that they never do, and his argument is one of the most famous in all of mathematics.

Imagine you have a list of every prime there is. Multiply them all together and add 1. Your new number cannot be divided evenly by any prime on your list, because there is always 1 left over. So either the new number is itself a prime, or it is built from primes you forgot. Either way, your list was not complete. Try it: 2 ร— 3 ร— 5 ร— 7 + 1 = 211, which is prime. And 2 ร— 3 ร— 5 ร— 7 ร— 11 ร— 13 + 1 = 30,031 = 59 ร— 509, two primes that were not on the list.

Because the primes go on forever, the hunt for bigger ones never ends. The largest prime known, found in October 2024, is 136,279,841 twos multiplied together, minus 1. Written out, it has 41,024,320 digits. Luke Durant, a volunteer with the Great Internet Mersenne Prime Search, found it using thousands of graphics chips in data centres across 17 countries.

Primes keep your secrets

Every time someone pays for something online, primes are working behind the scenes. A system called RSA picks two enormous primes, each hundreds of digits long, and multiplies them together. The answer is published openly as a key that locks messages. Multiplying is easy, but working backwards to find the two primes from their product is so hard that even the fastest computers would take practically forever. Only the person who knows the two primes can unlock the message.

Primes may even turn up in nature. In eastern North America, periodical cicadas spend 13 or 17 years underground before millions crawl out at once. Both numbers are prime, and one idea is that prime-length cycles rarely line up with the shorter life cycles of predators or other cicadas. Scientists are still not sure that this is the reason.

๐Ÿ“š Words to know

Prime number
A whole number bigger than 1 with exactly two factors, 1 and itself, such as 2, 3, 5, 7 and 11.
Composite number
A whole number bigger than 1 with more than two factors, such as 4, 6, 8, 9 and 12.
Factor
A whole number that divides into another number exactly. The factors of 10 are 1, 2, 5 and 10.
Multiple
The result of multiplying a number by a whole number. The multiples of 7 are 7, 14, 21, 28 and so on.
Encryption
Scrambling a message so that only someone with the right key can read it.

๐Ÿงช Try this: sift out the primes

  1. Draw a grid 10 squares wide and 10 squares tall, and write the numbers 1 to 100 in it, one per square. Cross out 1: it is not prime.
  2. Circle 2. Then cross out every other multiple of 2 (4, 6, 8 โ€ฆ 100). Circle the smallest number not yet crossed out, 3, and cross out its multiples (6, 9, 12 โ€ฆ). Some will already be gone.
  3. Repeat with 5 and then 7. Now you can stop: any number below 100 that is not prime has a factor of 7 or less, because 11 ร— 11 = 121 is already too big.
  4. Circle everything that is left. Count the circles: you should have exactly 25 primes. Look at their last digits. Apart from 2 and 5, every prime ends in 1, 3, 7 or 9. Can you work out why?
  5. Challenge: extend your grid to 200. Which extra numbers do you need to sieve with now, and where can you stop?

๐Ÿง  Quick check

4 questions
1 Which of these numbers is prime?
2 Why is 1 not a prime number?
3 In the sieve of Eratosthenes, what do you do straight after circling 2?
4 How many prime numbers are there altogether?

Where this comes from

We check our facts against trusted sources. Want to find out more? Try these:

Keep exploring