def main(under): global cache for i in xrange(2, under): divisor_sum = sum(list(list_divisors(i))) - i if divisor_sum < under: cache[i] = divisor_sum result = 0 for i in xrange(2, under): if i in cache and cache[i] in cache and i != cache[i] and cache[cache[i]] == i: print ">>", i, cache[i] result += i print result
def main(under): global cache for i in xrange(2, under): divisor_sum = sum(list(list_divisors(i))) - i if divisor_sum < under: cache[i] = divisor_sum result = 0 for i in xrange(2, under): if i in cache and cache[i] in cache and i != cache[i] and cache[cache[i]] == i: print ">>", i, cache[i] result += i print result
def get_proper_divisors(number): # print(number) return int(sum(list_divisors(int(number))) - number)
def is_abundant(number): return sum(list(list_divisors(number))) - number - number > 0