No even number is prime except for 2
for i in range ( 4 , n + 1 , 2 ) : NEW_LINE INDENT check [ i ] = True NEW_LINE DEDENT for i in range ( 3 , n + 1 , 2 ) : NEW_LINE INDENT if i * i > n : NEW_LINE INDENT break NEW_LINE DEDENT if ( not check [ i ] ) : NEW_LINE DEDENT