Pre - computation of smallest prime divisor of all numbers
def sieveOfEratosthenes ( ) : NEW_LINE INDENT for i in range ( 2 , MAX ) : NEW_LINE INDENT if i * i > MAX : NEW_LINE INDENT break NEW_LINE DEDENT if ( primedivisor [ i ] == 0 ) : NEW_LINE INDENT for j in range ( 2 * i , MAX , i ) : NEW_LINE INDENT primedivisor [ j ] = i NEW_LINE DEDENT DEDENT DEDENT DEDENT