Create a boolean list " mark [ 0 . . n - 1 ] " and initialize all entries of it as True . A value in mark [ p ] will finally be False if ' p ' is Not a prime , else True .
mark = [ True for i in range ( limit + 1 ) ] NEW_LINE p = 2 NEW_LINE while ( p * p <= limit ) : NEW_LINE