Skip to content

Instantly share code, notes, and snippets.

@shieldsd
Created March 30, 2012 14:45
Show Gist options
  • Save shieldsd/2252029 to your computer and use it in GitHub Desktop.
Save shieldsd/2252029 to your computer and use it in GitHub Desktop.
Project Euler #34
def fact(n):
s = 1
while n > 0:
s = s * n
n -= 1
return s
print sum(n for n in xrange(3, 100000)
if sum(fact(int(c)) for c in str(n)) == n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment