Chapter 3/3.3Foundationabout 9 min
Prime numbers
Go back to the chairs. Which numbers of chairs, from 2 to 20, can only be arranged in a single line? List them.
Some numbers refuse to be broken into smaller rectangles. With 7 chairs, the only arrangement is one row of 7. These stubborn numbers are the most important numbers in mathematics.
prime number A prime number is a whole number greater than 1 that has exactly two factors: 1 and itself.
composite number A composite number is a whole number greater than 1 that has more than two factors.
The primes below 20 are 2, 3, 5, 7, 11, 13, 17 and 19. The number 1 is neither prime nor composite, because it has only one factor. The number 2 is the only even prime, because every other even number has 2 as a third factor.
The sieve of Eratosthenes. About 2,200 years ago a scholar named Eratosthenes was in charge of the great library at Alexandria, in Egypt. He was born in Cyrene, a city in what is now Libya, and he is the same man who measured the size of the Earth using the shadow of a stick. He invented a simple way to catch every prime. Write the numbers in a grid. Cross out 1. Circle 2 and cross out all its other multiples. Circle the next number that is left, 3, and cross out its multiples. Carry on. The numbers that fall through the sieve are composite. The numbers that remain are prime.
There are 25 primes below 100. Look at the pattern in the figure: there is none that anyone has been able to describe fully. Primes thin out slowly, but they turn up without any simple rule, and understanding exactly how they are scattered is one of the great unsolved problems of mathematics.
How to test whether a number is prime. You do not need to test every smaller number. You need only test the primes up to its square root (the number which, multiplied by itself, gives the number; square roots are studied in Chapter 6). The reason is the pairing of factors from Section 3.1: if a number had a factor larger than its square root, the partner of that factor would be smaller than the square root, and you would already have found it.
Is 97 prime? Is 91 prime?
Trusting that a number "looks prime". The numbers 51, 57, 87 and 91 all look prime and none of them is: 51 = 3 × 17, 57 = 3 × 19, 87 = 3 × 29 and 91 = 7 × 13. Always test.
Is there a largest prime? Around 300 BC, also in Alexandria, Euclid wrote the most successful textbook in history, the Elements. In it he proved that the primes never run out. His argument is one of the most beautiful in mathematics, and you can follow it.
There are infinitely many primes. However many primes you list, there is always another prime that is not on your list.
Take any list of primes, for example 2, 3 and 5. Multiply them all together and add 1. Here that gives 2 × 3 × 5 + 1 = 31. Divide this new number by any prime on the list and the remainder is 1, because the product divides exactly and the extra 1 is left over. So no prime on the list is a factor of the new number. But the new number is greater than 1, so it must have some prime factor: its smallest factor greater than 1 is prime, because any factor of that factor would be a still smaller factor of the number. That prime factor is not on the list. So the list was not complete, and no list ever can be.
Be careful about what the proof says. The new number does not have to be prime itself. From the list 2, 3, 5, 7, 11, 13 we get 30,031, which equals 59 × 509. But 59 and 509 are primes that were not on the list, and that is all the proof needs.
Giant primes. People still hunt for record primes using thousands of computers working together. In 2024 a prime was found that has more than 41 million digits. Printed in this book's type it would fill more than ten thousand pages. Large primes are not only a sport. When you send a message or pay with a phone, your information is locked using two secret primes, each hundreds of digits long. Multiplying them takes a computer a moment. Finding them again from their product would take longer than the age of the universe.
The oldest mathematics in the world? In 1950 a small bone was found at Ishango, near Lake Edward in what is now the Democratic Republic of the Congo. It is about 20,000 years old and is covered in groups of carved notches. One column has groups of 11, 13, 17 and 19 notches, which are exactly the primes between 10 and 20. Nobody knows whether the carver was thinking about primes, counting days, or doing something else. What is certain is that people in Africa were recording numbers long before writing was invented.
Check your understanding 3.3
- List the primes between 20 and 40.
Show answerHide answer
23, 29, 31, 37. - Is 119 prime? Show your test.
Show answerHide answer
No. Test 2, 3, 5, 7 (since 11 × 11 = 121 is more than 119). 119 = 7 × 17, so it is composite. - Which primes do you need to test to decide whether 151 is prime?
Show answerHide answer
2, 3, 5, 7 and 11, because 13 × 13 = 169 is more than 151. (None divides it, so 151 is prime.) - Explain why 1 is not a prime number.
Show answerHide answer
A prime has exactly two factors. The number 1 has only one factor, itself. Also, if 1 were prime, prime factorisations would no longer be unique.
