Spoiler
def getProperDivisors(x):
ams = []
for y in range(1,x):
if x%y == 0: ams.append(y)
return ams
def addProperDivisors(ams):
total = 0
for x in ams:
total +=x
return total
total = 0
dictionary = {}
for x in range(2,10001):
if x in dictionary:
if dictionary[x] < x:
continue
else:
b = addProperDivisors(getProperDivisors(dictionary[x]))
if b == dictionary[x]:
total += dictionary[x]+ b
continue
a = addProperDivisors(getProperDivisors(x))
dictionary[x] = a
b = addProperDivisors(getProperDivisors(a))
dictionary[a] = b
if a == b:
total += a+b
print total

New Topic/Question
Reply



MultiQuote



|