Initial commit
This commit is contained in:
18
problem-34.py
Normal file
18
problem-34.py
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
MAX_NUM = 100000
|
||||
|
||||
def fact(n):
|
||||
result = 1
|
||||
for i in range(2, n+1):
|
||||
result *= i
|
||||
return result
|
||||
|
||||
if __name__ == '__main__':
|
||||
results = []
|
||||
for i in range(3, MAX_NUM):
|
||||
digits = list(str(i))
|
||||
if i == sum([fact(int(j)) for j in digits]):
|
||||
results.append(i)
|
||||
|
||||
print(results)
|
||||
print(sum(results))
|
||||
Reference in New Issue
Block a user