Function to count total factors from 1 to N
def CountTotalfactors ( ) : NEW_LINE INDENT tfactor [ 1 ] = pre [ 1 ] = 1 ; NEW_LINE for i in range ( 2 , MAX + 1 ) : NEW_LINE INDENT mspf = spf [ i ] ; NEW_LINE prim = mspf ; NEW_LINE temp = i ; NEW_LINE cnt = 0 ; NEW_LINE while ( temp % mspf == 0 ) : NEW_LINE INDENT temp //= mspf ; NEW_LINE cnt += 1 ; NEW_LINE prim = prim * mspf ; NEW_LINE DEDENT DEDENT DEDENT