mirror of
https://github.com/correl/euler.git
synced 2024-11-30 11:09:52 +00:00
Problem 023. Very slow, but works. Should look into speeding this up
somehow. git-svn-id: file:///srv/svn/euler@53 e5f4c3ec-3c0c-11df-b522-21efaa4426b5
This commit is contained in:
parent
7ab229ba18
commit
87d2ab997d
1 changed files with 20 additions and 0 deletions
20
e023.py
Normal file
20
e023.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from e021 import proper_divisors
|
||||||
|
|
||||||
|
abundant = []
|
||||||
|
total = 1
|
||||||
|
|
||||||
|
i = 2
|
||||||
|
while i < 28123:
|
||||||
|
s = sum(proper_divisors(i))
|
||||||
|
if s > i:
|
||||||
|
abundant.append(i)
|
||||||
|
summed = False
|
||||||
|
for a in abundant:
|
||||||
|
if i - a in abundant:
|
||||||
|
summed = True
|
||||||
|
break
|
||||||
|
if not summed:
|
||||||
|
total = total + i
|
||||||
|
i = i + 1
|
||||||
|
|
||||||
|
print 'Total:', total
|
Loading…
Reference in a new issue