diff options
author | Joshua Drake <joshua.drake@ditchwitch.com> | 2023-04-07 08:13:49 -0500 |
---|---|---|
committer | Joshua Drake <joshua.drake@ditchwitch.com> | 2023-04-07 08:13:49 -0500 |
commit | 1161f9a034de06a63538e3a9a0b7717098c744d9 (patch) | |
tree | 55bb842b2daa4f096eb7916a8d3630426fc1c376 /Problem23.py |
Diffstat (limited to 'Problem23.py')
-rw-r--r-- | Problem23.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Problem23.py b/Problem23.py new file mode 100644 index 0000000..00fd3a7 --- /dev/null +++ b/Problem23.py @@ -0,0 +1,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")
\ No newline at end of file |