Sieve of Eratosthenese
sieve = [ 0 for i in range ( N // 2 + 1 ) ] NEW_LINE for i in range ( 2 , N // 2 + 1 , 1 ) : NEW_LINE INDENT if ( sieve [ i ] == 0 ) : NEW_LINE INDENT for j in range ( i * i , N // 2 + 1 , i ) : NEW_LINE INDENT sieve [ j ] = 1 NEW_LINE DEDENT DEDENT DEDENT