Finding prime number using sieve of Eratosthenes . Reusing same array as result of above computations in v .
arr1 = [ False ] * ( len ( arr ) ) ; NEW_LINE p = 2 ; NEW_LINE while ( p * p < n ) : NEW_LINE INDENT if ( arr1 [ p ] == False ) : NEW_LINE INDENT for i in range ( p * 2 , n , p ) : NEW_LINE INDENT arr1 [ i ] = True ; NEW_LINE DEDENT DEDENT p += 1 ; NEW_LINE DEDENT