Function for finding smallest prime factors for every integer
def smallestPrimeFactors ( ) : NEW_LINE INDENT for i in range ( 10005 ) : NEW_LINE INDENT spf [ i ] = - 1 NEW_LINE DEDENT i = 2 NEW_LINE while i * i < 100005 : NEW_LINE INDENT for j in range ( i , 100005 , i ) : NEW_LINE INDENT if ( spf [ j ] == - 1 ) : NEW_LINE INDENT spf [ j ] = i NEW_LINE DEDENT DEDENT i += 1 NEW_LINE DEDENT DEDENT