Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
def get_proper_divisors(number):
    # print(number)
    return int(sum(list_divisors(int(number))) - number)
Esempio n. 4
0
def is_abundant(number):
    return sum(list(list_divisors(number))) - number - number > 0