def p21(): limit = 10000 answer = [] for n in xrange(1,limit): A = sum(lc.divisors(n)) B = sum(lc.divisors(A)) if n == B and n <> A: answer.append(n) print sum(answer)
def p12(): start = 1 pivot = 2 stop = 3 chunk = 10 goal = 25 found = False while not found: if len(lc.divisors(stop)) < goal: start = stop + 1 stop *= 2 pivot = (stop-start) // 2