from __future__ import division from acmlib import all_factors for i in xrange(2, 15000): num = len(all_factors(i * (i + 1) // 2)) if num > 500: print i, i * (i + 1) // 2, num break
def is_abundant(n): return sum(all_factors(n)) > n
from acmlib import all_factors result = 0 for a in xrange(1, 10001): b = sum(all_factors(a)) if b > a and sum(all_factors(b)) == a: #print a, b result += a + b print result