Sieve method for prime calculation
Hash = [ True for i in range ( n + 1 ) ] NEW_LINE p = 2 NEW_LINE while ( ( p * p ) < n ) : NEW_LINE INDENT if bool ( Hash [ p ] ) : NEW_LINE INDENT i = p * 2 NEW_LINE while i < n : NEW_LINE INDENT Hash [ i ] = False NEW_LINE i += p NEW_LINE DEDENT DEDENT p += 1 NEW_LINE DEDENT