You are viewing a single comment's thread. Return to all comments →
import math as m
def sumfactordigit(n):
ch=str(n) s=0 for e in ch : s+=m.factorial(int(e)) if s % n == 0 : return(True) return(False)
d={10:0} s=0 for e in range(10,10**5 +1): d[e]=s if sumfactordigit(e): s+=e n=int(input()) print(d[n])
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #34: Digit factorials
You are viewing a single comment's thread. Return to all comments →
import math as m
def sumfactordigit(n):
d={10:0} s=0 for e in range(10,10**5 +1): d[e]=s if sumfactordigit(e): s+=e n=int(input()) print(d[n])