You are viewing a single comment's thread. Return to all comments →
Try this
n=int(input()) print(sum([i for i in range(n**2,10**6) if i==sum(int(z)**n for z in str(i))]))
Project Euler #30: Digit Nth powers
You are viewing a single comment's thread. Return to all comments →
Try this