Skip to main content

Section 5.1 Sieve of Eratosthenes

At a very basic level a mathematical sieve is very much like a real sieve that one would find in their kitchen. It is a tool that keeps what you want, and filters everything you don't out.

The easiest example is the sieve of Eratosthenes. This sieve is used to find out the integers below a given integer which are prime. As an example, take \(n = 100.\) We enumerate in rows of \(10\) for convenience, and start with \(2.\) Now every second number we cross out. The next number not crossed out is \(3,\) so we cross out every third number, and so on. The numbers that are left are prime.

Another way to visualize the sieve of Eratosthenes is to draw the parabola \(x = y^2\) and connect with a line all integer points in the image. Then the only integer points left on the \(x\)-axis are the primes. Figure 5.1.1 illustrates this.

Figure 5.1.1. A prime sieve