Learn math by practice

Re-engineering Math

All news about Mathedu

Find Prime Numbers with ScilabĀ®: Programing of the Sieve of Erastothenes

The Sieve of Erasthotenes is a very old algorithm to find by elimination the prime numbers up to a given integer N.

The manual process is so:

  1. write down the numbers from 2 to N (say 100)
  2. stripe the multiples of 2, except 2
  3. stripe the multiples of 3 not yet striped, except 3
  4. iterate the process for the next unstriped number k: stripe the multiples of k not yet striped, except k.
  5. continue until you get no more unstriped multiples before N

The unstriped remaining numbers are the numbers...

Read More
© 2016 Mathedu Postmaster