summaryrefslogtreecommitdiff
path: root/Problem23.py
blob: 00fd3a71786a99585573e8f0544ee167b4399ec8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#Unfinished
def isAbundant(n):
    sum = 0
    for x in range(1,int(n/2)+1):
        if n%x == 0:
            sum+=x
    if sum > n:
        return True
    else: 
        return False
abundantList = []
sumabundants = positivesum = 0
for x in range(1,28123):
    if isAbundant(x):
        abundantList.append(x)
print(abundantList)
for x in range(0,len(abundantList)-1):
    for y in range(x+1,len(abundantList)):
        sumabundants+=abundantList[x]+abundantList[y]
        print(sumabundants)
for x in range(2,28123,2):
    sum+=x
print(positivesum-sumabundants)
input("kekw")