You are viewing a single comment's thread. Return to all comments →
Here is my code : 100 points
def factorial(x): if x==0: return 1 return x*factorial(x-1) lookup=[0]*1000001 sum_=0 for i in range(10,100000+1): s=0 t=i while t>0: r=t%10 s+=factorial(r) t=t//10 if s%i==0: sum_+=i lookup[i]=sum_ n=int(input().strip()) print(lookup[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 →
Here is my code : 100 points