You are viewing a single comment's thread. Return to all comments →
#python pw=int(input()) res=set() for num0 in range(100, 1000000): su=0 num=num0 while num!=0: su+=(num %10)**pw num//=10 if su==num0: res.add(num0) print(sum(res))
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #30: Digit Nth powers
You are viewing a single comment's thread. Return to all comments →