1. Education
How to use the Sieve of Eratosthenes

The purpose is to create a list of prime numbers.

Difficulty Level: easy      Time Required: 10 minutes


Here's How:
  1. List all integers up to the number of your choice, say 20: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
  2. X off all multiples of 2: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
  3. X off all multiples of 3: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
  4. This leaves 1 2 3 5 7 11 13 17 19, all of which are prime.
  5. If your number were larger, you would continue marking off all multiples of the next prime (5) and then the next (7), etc.

Related Features:

Discuss in my forum

©2013 About.com. All rights reserved.