def main(): sumofdivisors = [ 0 ] * 10000 result = 0 for i in range(1, 10000): sumofdivisors[i] = sum(libeuler.getDivisors(i)) for i in range(2, 10000): temp = sumofdivisors[i] if temp > 10000 or temp == i: continue if i == sumofdivisors[temp]: result += i print(result)
def main(): result = 0 abundants = [i for i in range(1,28123) if sum(libeuler.getDivisors(i))> i] abunset = set(abundants) for i in range(1,28123): temp = False for j in abundants: if (i - j) in abunset: temp = True break if not temp: result += i print(result)