PrepShorts · Study sheet · Class 6 Mathematics · Chapter 5, Prime TimePrepShorts

Chapter 5 · Prime Time

The sieve of Eratosthenes: finding primes by removing multiples

यह वीडियो हिंदी में भी · Watch in Hindi

Primes10 min

This video could not be loaded. Reload the page to try again.

Sign in with Google

10 min.

Also recorded in Hindi.Englishहिन्दी

Twenty-five primes below 100, found without a single division. The sieve never tests anything — it only deletes.

The idea

The sieve never once asks whether a number is prime. It only ever deletes, and the primes are whatever it fails to delete — they are defined by what did not happen to them. Two facts make that work, and a Class 6 classroom can establish both. Nothing prime is ever crossed out, because a number is only crossed out as a multiple of something smaller than itself; and nothing composite survives, because a composite's smallest factor above 1 is a prime, and every prime gets a turn. A character in the margin protests that this cannot be magic and there must be a reason. Those two sentences are the reason.

What you should be able to do

  • Carry out the printed procedure on a hundred grid and produce the primes below 100
  • State what gets circled and what gets crossed out at each pass
  • Explain why the next uncrossed number must be prime
  • Explain why no composite number can survive to the end
  • Say why 1 is removed at the start and belongs to neither class
  • Read the finished grid for structure: gaps between neighbouring primes, pairs two apart, and the thinning-out as the numbers climb
  • Continue the method past 100 in principle, and say what would have to change
  • Name Eratosthenes and place him roughly in time, as the chapter does

Words to know

TermDefinition in one lineFirst introduced
Sieve of Eratosthenesthe deletion procedure that leaves the primes behindprinted and named in §5.2, p.113
prime numbera number with exactly two factorsprinted in §5.2, p.112
composite numbera number with more than two factorsprinted in §5.2, p.112
multiplea number reached by counting in equal stepsprinted in §5.1, p.107
twin primestwo primes differing by 2printed and defined in §5.2, p.114
consecutivenext to each other in the counting order, with nothing betweenprinted in §5.2, p.114
prime gapthe difference between one prime and the nextan added term; not printed in this chapter
hundred gridthe ten-by-ten table of 1 to 100 the procedure is run onan added name for it; the book prints the grid unlabelled

Where people slip up

  • "You cross out 2 as well, since it is a multiple of 2." No — each number is circled first and only its later multiples go. Getting this wrong deletes every prime and is the single most common execution error.
  • "The sieve tests each number for primality." It tests nothing. It deletes multiples, and primality is the leftover. Students who think a test is happening cannot say why the method is faster than dividing.
  • "You have to run a pass for every number up to 100." You do not, and the reason is worth 30 seconds: once the pass for 7 is done, everything composite below 100 has already been struck, because a composite below 100 must have a prime factor of 7 or less.
  • "Crossed out means composite, so 1 is composite." The book removes 1 in the very first step for a different reason, and says explicitly that the crossed-out numbers other than 1 are the composites.
  • "The primes thin out, so they must eventually stop." They do thin out — question 3 on p.114 is about exactly that — and they do not stop. The chapter raises this and deliberately leaves it hanging.
  • "A gap of 1 between primes is impossible, since primes are odd." 2 and 3 are neighbours. It is the only such pair, and it is on the grid.
Transcript1,294 words

Here are the numbers from one to one hundred. I'm going to find every single prime in this grid, and I am not going to do one division. Not one. I'm not even going to check whether any number is prime. All I'm going to do is cross things out. Before I start, guess. How many of these hundred numbers will still be standing at the end? Pick a number and hold on to it. Most people guess far too high.

The first move is a strange one. We remove the number one. Not because it's composite. It isn't. One has exactly one factor, so it's neither prime nor composite. It sits outside both classes. So it comes off the board straight away, and we never think about it again. Ninety-nine numbers left. Now the real work. Circle two. Two stays. We circle it, and we do not cross it out, even though two is a multiple of two.

That's the mistake almost everyone makes. A number circles first, and only its later multiples get struck. If you cross out two as well, you'll delete every prime on the board. So. Circle two, then strike every multiple of two after it. Four, six, eight, ten, twelve, and on and on, all the way to one hundred. Half the grid is gone in a single pass. Now find the next number that is still untouched. It's three.

Circle it, and strike its later multiples. Six, nine, twelve, fifteen, eighteen. Notice something. Six was already gone. Twelve was already gone. We just skip over them. A number can be struck twice, and it makes no difference. Next untouched number. Four is gone, so it's five. Circle five. Strike ten, fifteen, twenty, twenty-five, and the rest. Then seven. Circle it, strike fourteen, twenty-one, twenty-eight, thirty-five, forty-nine. Notice that forty-nine is the first multiple of seven that wasn't already crossed out.

Now, the obvious objection is exactly the right one to make. This can't just be magic. There has to be a reason it works. There is, and it comes in two halves. Here's the first. Why does the next untouched number always turn out to be prime? Think about what has already happened. Every prime smaller than it has had a turn. And on its turn, it struck out all of its own multiples.

So if any of those smaller primes divided our number, our number would already be crossed out. It isn't. So no smaller prime divides it. And any number with a factor bigger than one has a prime factor. So it has no factors except one and itself. It's prime. Guaranteed. Now the second half. Why can't a composite number sneak through? Take any composite number. Look at its smallest factor apart from one.

That smallest factor has to be prime. Here's why. If it had a factor of its own, that would be an even smaller factor of our composite number. But we picked the smallest. So the smallest factor is prime. Which means it got circled, and it got a turn. And on that turn, our composite number was struck, because it's one of that prime's multiples. No composite escapes. Every one of them has a prime waiting to delete it.

Those two arguments together are the whole reason the sieve works. Nothing was tested. Everything was accounted for. So when do we stop? The next uncrossed number after seven is eleven. Let's run its pass and watch what happens. Twenty-two. Already gone, struck as a multiple of two. Thirty-three. Gone, as a multiple of three. Forty-four, gone. Fifty-five, gone as a multiple of five. Sixty-six, seventy-seven, eighty-eight, ninety-nine. Every single one already crossed out.

The pass for eleven deletes nothing new, and neither does any pass after it. Here's why. Eleven times eleven is one hundred and twenty-one, which is off our grid. So any multiple of eleven that fits on this grid has to be eleven times something smaller than eleven, and that smaller thing already had its turn. Seven was the last pass that mattered, because seven times seven is forty-nine, and that still fits.

And we're done. Look at the board. Every number is either circled or crossed out, and we never divided anything. The circles are the primes. There are twenty-five of them below one hundred. Two, three, five, seven, eleven, thirteen, seventeen, nineteen, twenty-three, twenty-nine. Thirty-one, thirty-seven, forty-one, forty-three, forty-seven, fifty-three, fifty-nine, sixty-one, sixty-seven. Seventy-one, seventy-three, seventy-nine, eighty-three, eighty-nine, and ninety-seven. The crosses, apart from the one we removed at the start, are the composites.

How close was your guess? Twenty-five out of a hundred. A quarter of them. Now the grid is finished, it's worth reading it like a picture. First question. Is there any even number in the circles apart from two? No, and there never could be. Every other even number was struck on the very first pass. Second question. How far apart are neighbouring primes? The closest pair is two and three, sitting right next to each other with a gap of one.

That happens exactly once, and it has to, because after two, every prime is odd. The biggest gap below one hundred is between eighty-nine and ninety-seven. Seven numbers in a row with nothing circled. Third question. Does every row of ten hold the same number of primes? Not at all. The first two rows have four each. The last row, ninety-one to one hundred, has just one. Ninety-seven, alone. That last row points at something. The primes thin out as you climb.

And you can find stretches with no primes at all. Look for seven composite numbers in a row, somewhere on this grid. Pause and hunt for it if you like. The finished grid makes it a matter of looking, not calculating. There's exactly one such run below one hundred. Ninety to ninety-six. Ninety, ninety-one, ninety-two, ninety-three, ninety-four, ninety-five, ninety-six. Seven in a row, not a prime among them. And ninety-one is the sneaky one. It looks prime. It's seven times thirteen.

While we're reading the grid, look for the ringed pairs with exactly one cross between them. Three and five. Five and seven. Eleven and thirteen. Those are the twin primes, and there are eight such pairs below one hundred. This method has a name and an owner. It's called the sieve of Eratosthenes, after a Greek mathematician who lived about two thousand two hundred years ago. A sieve is the kitchen tool you shake to let the small stuff fall through and keep what you want.

That's exactly what this is. The composites fall through the holes, and the primes are what's left in the pan. And nothing about it stops at one hundred. Run the same procedure on a thousand numbers, or a million. The rule never changes. The only thing that changes is how far you have to go before the passes stop paying. So here's what the sieve gave us, and here's what it didn't.

It gave us every prime below one hundred, without testing a single number. The primes are simply whatever the crossing-out failed to reach. They're defined by what didn't happen to them. But there's one thing the sieve can never tell us. We watched the primes get rarer. Four in the first row, one in the last. So does the thinning ever finish? Is there a last prime, a biggest one, with nothing but composites after it?

Running a bigger sieve can't answer that. You'd be running forever, and never knowing. That question needs a different kind of argument altogether, and a Greek mathematician called Euclid found it. What's your instinct? Do the primes run out, or go on forever? Tell me in the comments before we settle it.

Where this fits

Taken from the notes each video was made from, not from the reading order — these are the ideas this one rests on and the ones that later rest on it.

Builds on

Either side of this one

The book

Open in a new tab