Commit d8321647 authored by Taddeus Kroes's avatar Taddeus Kroes

Solved 34

parent 8668f019
#!/usr/bin/env python
from itertools import combinations
from math import factorial
def digits(n):
return map(int, str(n))
def facsum(n):
return sum(facs[d] for d in digits(n))
facs = map(factorial, range(10))
s = 0
for n in xrange(10, 99999):
if n == facsum(n):
s += n
print s
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment