Sieve of Eratosthenes
The sieve of Eratosthenses is an ancient method of finding small prime numbers. It is based on the fact that all composite (non-prime) numbers are multiples of another number.
The steps for doing so is listed below.
- On the list of numbers on board, start by skipping 1 and marking the number 2 as prime (encircling).
- Skip count by 2 until all multiples of 2 are marked as composite (crossed-out).
- Since 1 is skipped, 2 is marked as a prime already, the smallest unmarked number is 3. Now, mark 3 as a prime number.
- As with step 2, skip count by 3 and mark the multiples of 3 that are unmarked as composite.
- The smallest unmarked number now is 5 as 4 is marked as composite from step 2. Mark 5 as prime and its multiples as composite.
- Repeat the process until all the numbers are marked as prime or composite.
See how to mark a number below.
-
In toggle marking mode, unmarked numbers gets marked as compoosite in one click, composites gets marked as primes, and primes gets unmarked.
Hint: unmarked → composite → prime → unmarked
-
Click on the
Mark As Compositebutton, and then click on numbers to mark them as composite. -
Click on the
Mark As Primebutton, and then click on numbers to mark them as prime. -
Click on the
Unmarkbutton and then click on numbers to erase the markings. -
Click on the
Undobutton to undo the previous action. -
Click on the
Redoto redo the previously undone action. -
Click on the
Toggle Marking Modebutton to toggle betweenTogglemode andFixedmode. -
Click on the
Toggle Lock Mode on Fixed Modebutton to toggle betweenUnlockedmode andLockedmode. Whenever the mode isLockedwhile theMarking ModeisFixed, only unmarked numbers gets to be marked as composite or prime avoiding accidentally change a previously marked number into another marking.Hint: Whenever a number is checked already be it prime or composite, its marking is unchangeable.
-
On the
Checkspane, theCheck Allbutton checks all the numbers except for 1 if they are correctly marked as prime or composite. Green is for the correct ones, red is for the wrong ones, and yellow is for the ones that are skipped.Hint: The
Tallypane account for all of marking and checking. -
On the
Guidespane, theHintbutton puts a square outline on the number to signal that it is the next number to be marked as either prime or composite.Hint: This is based on the Steps explained above.
-
On the
Guidespane, theShow Next Stepbutton does the same as theHintbutton with the addition of the help text on theNext Stepseen on theGuidespane.Hint: Both buttons add hints that are counted on the
Hints Tallystatistics. -
The
Finish Stepbutton will perform checks on the help text on theNext Stepseen on theGuidespane. This button is enabled wheneverShow Next Stepbutton is activated, and it gets disabled whenever a number's marking is changed. So, to use it, activateShow Next Step, and then subsequently activateFinish Step.