def p47(): i = 0 while True: i += 1 temp = pelib.remove_dupes(pelib.prime_factors(i)) if len(temp) == 4: count += 1 if count == 4: return (i - 3) else: count = 0
def divisors(n): factors = pelib.prime_factors(n) temp = [0]*factors[-1] div = 1 #get multiples of divisors for i in range(len(factors)): temp[factors[i]-1] += 1 #find divisors for i in range(len(temp)): if temp[i] > 0: div *= (temp[i]+1) return div