Skip to content

← Math Further 6–8

Is There a Biggest Prime Number?

Topic 5 · Grades 6–8 · Primes and Euclid’s proof

What this builds on from class
  • Grade 6: Whole Number (prime and composite numbers)
  • Grade 7: HCF and LCM
In this unit 8 sections
  1. Hunting primes
  2. Every number is built from primes
  3. Can the primes run out?
  4. Rarer, but never gone
  5. The twist: a formula for primes?
  6. Where this is used
  7. Questions
  8. Where to go next

In Grade 6, Asmita’s class hunted for the prime numbers up to 100 on the board: the numbers with no factors except 1 and themselves. They found 25 of them, and the board looked full of them: 2, 3, 5, 7, 11, 13 …

Then her friend Ishan wrote the primes between 100 and 200, and found only 21. Between 900 and 1,000 there were just 14. “They’re running out,” he said. “Somewhere, far away, there must be a last one. After that, every number can be split up.”

Was he right? Before you read on, guess.

Do the prime numbers ever stop?

Pick an answer to see why.

Here is a harder guess. Among the hundred numbers just after 1 crore, from 1,00,00,001 to 1,00,00,100, how many are prime?

Pick an answer to see why.

Try it

A hundred numbers, far out

Choose where to start looking. The grid shows the 100 numbers after that start: each square holds how far past the start it is, and the primes are filled in. Press Next 100 to move on.

1,00,00,000 + the number in each square123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
Start from:
Primes among them
2
Longest stretch with no prime
59

Hunting primes

A prime number is a whole number bigger than 1 whose only factors are 1 and itself: 7 can only be split as 1 × 7. A whole number bigger than 1 that has other factors is composite: 12 = 3 × 4. The number 1 is neither (you will see why below).

To find every prime up to 100, you don’t need to test each number one by one. A trick from ancient Greece, the sieve of Eratosthenes, does it by crossing out:

  1. Start with 2, the smallest prime. Cross out every multiple of 2 after it: 4, 6, 8, …
  2. The smallest number not crossed out is 3. It must be prime, because no smaller number divides it. Cross out its multiples.
  3. Keep going: each time, the smallest number left is the next prime, and you cross out its multiples.

Try it

Sieve the numbers 1 to 100

Tap the smallest number not crossed out (or press Next step). Its multiples are crossed out in its color. When can you stop?

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
Primes you have used
–
Not crossed out, 2 to 100
99

Tap 2, the first prime: all its multiples get crossed out.

You only needed four primes, 2, 3, 5 and 7. Why could you stop at 7, with 11 still waiting?

Any composite number can be split into two factors, a small one and a big one, like 91 = 7 × 13. The smaller factor can’t be bigger than 10, because 11 × 11 = 121 is already past 100. So every composite number up to 100 has a factor of 10 or less, and that factor is 2, 3, 5 or 7 or is built from them (4, 6, 8, 9, 10). Either way it was crossed out by 2, 3, 5 or 7. What is left is prime.

Counting them

Here is how many primes there are in each hundred up to 1,000:

Numbers 1–100 101–200 201–300 301–400 401–500 501–600 601–700 701–800 801–900 901–1,000
Primes 25 21 16 16 17 14 16 14 15 14

They get fewer, but not smoothly: 401–500 has more than 301–400. Primes don’t follow a simple rule that tells you where the next one is. Now count much farther:

Up to 10 100 1,000 10,000 1 lakh 10 lakh 1 crore
Primes 4 25 168 1,229 9,592 78,498 664,579
About one number in 2.5 4 6 8 10 13 15

Up to 100, one number in four is prime. Up to 1 crore, only one in fifteen.

Look at the last row. Each time you count ten times farther, about how much rarer do the primes get?

Pick an answer to see why.

Close to a big number, the pattern is even neater. Near a 1 followed by some zeros, about one number in 2.3 × (the number of zeros) is prime. Near 1 crore (7 zeros), one in about 16; near 1 kharab (11 zeros), one in about 25. Counting 10,000 numbers after each start in our program: 1 in 16.3 after 1 crore, 1 in 20.5 after 1 arab (9 zeros, the rule says 20.7), 1 in 25.4 after 1 kharab. The great German mathematician Carl Friedrich Gauss noticed this thinning when he was 15 or 16, counting primes in blocks. Proving it took another century, until 1896, and the proof is far beyond school maths. But the question in this topic needs nothing like that.

Every number is built from primes

Primes matter because every whole number is made of them. Keep splitting a composite number until you can’t split any more, and you are left with primes only:

360 = 36 × 10 = (6 × 6) × (2 × 5) = 2 × 3 × 2 × 3 × 2 × 5 = 2³ × 3² × 5

Start differently, 360 = 8 × 45 = (2 × 2 × 2) × (3 × 3 × 5), and you get exactly the same primes: three 2s, two 3s and one 5. However you split it, the primes at the end are always the same. This is the fundamental theorem of arithmetic: every whole number bigger than 1 is a prime or a product of primes, in just one way (apart from the order you write them in). That is why the primes are called the building blocks of the whole numbers, the way atoms build every substance.

It also explains why 1 is not counted as a prime. If it were, 6 = 2 × 3 = 1 × 2 × 3 = 1 × 1 × 2 × 3 … would have endless “different” factorizations, and the theorem would need an exception.

Which of these is the prime factorization of 1,001?

Pick an answer to see why.

Prime factorizations make HCF and LCM, from Grade 7, easy to see. 84 = 2 × 2 × 3 × 7 and 90 = 2 × 3 × 3 × 5. They share one 2 and one 3, so their HCF is 2 × 3 = 6. The LCM takes each prime as often as either number needs it: 2 × 2 × 3 × 3 × 5 × 7 = 1,260.

Can the primes run out?

Suppose Ishan is right, and there is a last prime. Then all the primes could be written on one list. Let’s test a list. Say someone claims the only primes are 2, 3 and 5.

Multiply them all, and add 1:

2 × 3 × 5 + 1 = 31

Now try to divide 31 by the primes on the list. 30 is a whole number of 2s, of 3s and of 5s, so 31, one more, is not: dividing by any of them leaves 1 over.

In 2s: 15 groups and 1 left overIn 3s: 10 groups and 1 left overIn 5s: 6 groups and 1 left over
Figure 5.1 31 counters put in 2s, in 3s and in 5s. Each time, exactly one is left over, because 30 = 2 × 3 × 5 shares out exactly and the extra 1 does not.

So none of 2, 3 or 5 divides 31. But every number bigger than 1 is built from primes. So 31 is either a prime itself, or built from primes that are not on the list. Either way, the list was not complete. (Here 31 is itself prime.)

Try it with other lists. Choose any primes you like.

Try it

Euclid’s machine

Tap primes to put them on your list (2, 3 and 5 are on it already). The machine multiplies them and adds 1. Under each prime on your list you see what is left when that number is divided by it.

Your primes multiplied
30
Add 1
31
Its prime factors
31
New primes found
31

31 is itself a prime, and it is not on your list.

Answer

The same thing happens with any list, however long. Call the list’s primes p, q, r, … and their product P. Then P + 1 leaves 1 over when divided by any of them, so it is either prime or built from primes not on the list. No list of primes can ever be complete. There are infinitely many primes, and there is no biggest one. This is Euclid’s theorem.

Mathematicians usually tell the argument like this:

  1. Suppose the primes do run out, so that a list holds every one of them.
  2. Multiply them all and add 1. The new number leaves 1 over when divided by every prime on the list.
  3. But the new number is bigger than 1, so some prime divides it, and that prime can’t be on the list.
  4. That contradicts step 1, where the list held every prime. So step 1 was false: the primes never run out.

This way of proving something, by supposing the opposite and showing that it leads to something impossible, is called proof by contradiction. Euclid himself put it a little more directly: give me any list of primes, and I will show you a prime that isn’t on it. Both say the same thing.

A list holds the primes 3, 7 and 13. What does Euclid’s machine give?

Pick an answer to see why.

Rarer, but never gone

If there are infinitely many primes, can there still be long stretches with none at all? Yes, as long as you like. Here is a stretch of five:

1 × 2 × 3 × 4 × 5 × 6 = 720.

  • 722 = 720 + 2: 2 divides 720 and 2, so 2 divides 722.
  • 723 = 720 + 3: 3 divides both, so 3 divides 723.
  • 724, 725, 726 the same way, divided by 4, 5 and 6.

Five composite numbers in a row: 722, 723, 724, 725 and 726. Want 100 in a row? Multiply 1 × 2 × 3 × … × 101, and add 2, 3, 4, …, 101 to it in turn: each sum is divided by the number you added. The product is a huge number, with 160 digits, but the argument works just as well. The first real stretch of over 100 composites starts much lower: between the primes 370,261 and 370,373 there are 111 composite numbers in a row.

Some primes are as close as two odd numbers can be: 3 and 5, 11 and 13, 29 and 31, 71 and 73. These are called twin primes. Do they too go on forever? Nobody knows. It is one of the oldest open questions in mathematics, simple enough to say to a Grade 6 student, and still unsolved in 2026.

The twist: a formula for primes?

If primes go on forever, perhaps there is a formula that makes them. In 1772 the Swiss mathematician Leonhard Euler wrote down a famous one: take any whole number n and work out

n × n + n + 41

For n = 0 it gives 41, a prime. For n = 1, 43; n = 2, 47; n = 3, 53; n = 10, 151. All prime. Our program checked every n from 0 to 39: forty primes in a row.

Mathematicians have proved that no formula of this kind (a polynomial: powers of n multiplied by whole numbers, added together) gives only primes, unless it gives the same number every time. Nobody has found a simple formula that makes every prime, and none is expected. The primes have to be hunted.

Where this is used

Questions

★ Which one of these is prime?

Pick an answer to see why.

a.★

Write 2,026 as a product of primes. How do you know when you have finished?

Hint
Answer
b.★

You want all the primes up to 200 by the sieve of Eratosthenes. After which prime can you stop crossing out? How many primes are there from 101 to 200?

Answer

★★ Someone says the only primes are 2 and 7. What does Euclid’s machine show them?

Pick an answer to see why.

c.★★

Find the HCF and the LCM of 72 and 120 by writing each as a product of primes. Check that HCF × LCM = 72 × 120.

Answer
d.★★

Would Euclid’s argument still work with “multiply and subtract 1” instead of adding 1? Try it with 2, 3, 5 and 7, and explain.

Hint
Answer
e.★★

Find ten composite numbers in a row, and say how you know each is composite. Then find the first such stretch of ten in the whole numbers.

Hint
Answer
f.★★★

In the world of 1, 5, 9, 13, 17, 21, … (numbers one more than a multiple of 4), show that 693 can be split into two of the world’s “primes” in two different ways. Why is 21 a “prime” there, though 21 = 3 × 7?

Answer
g.★★★

Ishan says: “Euclid’s machine with the first primes, 2 × 3 × 5 × … × the last prime + 1, would give the next prime after the last one.” Is he right? Use 2 × 3 × 5 × 7 + 1 to decide, and explain what Euclid’s machine really promises.

Answer
h.★★★

Show, without working out any big number, that for any number you choose, say 1,000, there are that many composite numbers in a row.

Answer

Where to go next

Where these facts come from
  • Euclid’s proposition (Elements Book IX, Proposition 20: “Prime numbers are more than any assigned multitude of prime numbers”), his proof with lines, the unit added and “absurd”: D. E. Joyce, Euclid’s Elements, Book IX, Proposition 20, Clark University, read October 2026; retold in our words.
  • Euclid’s proof as a proof by cases, often wrongly reported as by contradiction; 1806 + 1 = 1807 = 13 × 139; Euler’s proof (1744): Wikipedia, “Euclid’s theorem”, read October 2026.
  • Euclid in Alexandria around 300 BC, little known of his life, the Elements’ 13 books, Books VII–IX on numbers, the Euclidean algorithm in Book VII: Wikipedia, “Euclid”, read October 2026.
  • Book VII, Proposition 30 (a prime that divides a product divides one of the numbers): D. E. Joyce, Book VII, Proposition 30, read October 2026.
  • The fundamental theorem of arithmetic, Euclid’s ingredients, Gauss’s proof of uniqueness (Disquisitiones Arithmeticae, 1801), why 1 is not a prime: Wikipedia, “Fundamental theorem of arithmetic”, read October 2026.
  • The numbers one more than a multiple of 4 (Hilbert numbers) and their “primes” (9, 21 …): Wikipedia, “Hilbert number”, read October 2026; the examples 441 and 693 found by our program.
  • The sieve, first described by Nicomachus of Gerasa (early 2nd century CE) and credited by him to Eratosthenes; stopping once the square passes the end: Wikipedia, “Sieve of Eratosthenes”, read October 2026.
  • Eratosthenes, born 276 BC in Cyrene, chief librarian at Alexandria, the nickname Beta: Wikipedia, “Eratosthenes”, read October 2026.
  • Gauss considering how the primes thin out at 15 or 16 (1792 or 1793), the proof by Hadamard and de la Vallée Poussin in 1896: Wikipedia, “Prime number theorem”, read October 2026.
  • Euclid numbers (3, 7, 31, 211, 2,311, then 30,031 = 59 × 509) and the numbers one less (209 = 11 × 19): Wikipedia, “Euclid number”, read October 2026.
  • Bertrand’s guess (1845) and Chebyshev’s proof (1852): Wikipedia, “Bertrand’s postulate”, read October 2026.
  • Euler’s n² + n + 41 (1772), primes for n = 0 to 39; no polynomial gives only primes (Goldbach, Legendre): Wolfram MathWorld, “Prime-Generating Polynomial”, read October 2026.
  • The largest known prime, 2136,279,841−1 2^{136{,}279{,}841} - 1 , 41,024,320 digits, Luke Durant, 12 October 2024, GPUs in 24 data center regions in 17 countries: GIMPS, the press release and the list of known Mersenne primes (still the largest on 31 October 2026), read October 2026.
  • RSA (Rivest, Shamir and Adleman, 1977; Clifford Cocks, 1973), its security resting on factoring the product of two large primes, keys usually 2,048 to 4,096 bits: Wikipedia, “RSA cryptosystem”, read October 2026.
  • Prime95, by George Woltman (first released 1996), used by overclockers to test a computer’s stability: Wikipedia, “Prime95”, read October 2026.
  • Nepali number names (अर्ब for 100 crore, खर्ब for 100 arab): the Nepali Brihat Shabdakosh (Nepal Academy), the JSON copy in our textbook folder, read October 2026.
  • Every count, factorization and gap in this topic (the primes per hundred and up to 1 crore, the windows after 1 crore, 1 arab and 1 kharab, 1 in 2.3 × the zeros, the Euclid numbers, the 2,047 lists, 722–726, 114–126, 370,261 to 370,373, Euler’s formula, 441 and 693, 2,026, 1,001, HCF and LCM, the 617 digits of a 2,048-bit key, one in about 710 among 1,024-bit (308-digit) numbers) computed in checks/textbooks/math-further-6-8/05/tmp/prime_numbers.py.