예제 #1
0
#!/usr/bin/python

import eulerlib


lower = 12
upper = 28123

if __name__ == '__main__':

    abundantNumbers = list()

    for ii in xrange(1, upper + 1):
        if sum(eulerlib.propDivisors(ii) > ii):
            abundantNumbers.append(ii)

    abundantSums = list()
    for a in abundantNumbers:
        for b in abundantNumbers:
            if a + b < upper:
                abundantSums.append(a + b)

    abundantSums = sum(set(abundantSums))

    return
예제 #2
0
#!/usr/bin/python

import eulerlib

n = 10000

if __name__ == '__main__':

    ans = []
    for ii in xrange(0, n):
        d_ii = sum(eulerlib.propDivisors(ii))
        if (sum(eulerlib.propDivisors(d_ii)) == ii) and (d_ii != ii):
            ans.append(d_ii)
        print d_ii, '  ', ii
    print sum(ans)