len sieve[] 100
max = sqrt len sieve[]
for i = 2 to max
   if sieve[i] = 0
      j = i * i
      while j <= len sieve[]
         sieve[j] = 1
         j += i
      .
   .
.
for i = 2 to len sieve[]
   if sieve[i] = 0
      print i
   .
.
