You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
313 B

total_sum = 0
# just gonna take a wild guess and say there aren't any more higher than 1 million
for i in range(2, 1000000):
num_str = str(i)
sum = 0
for ch in num_str:
sum += pow(int(ch), 5)
if sum == i:
print(i)
total_sum += i
print("Total sum {0}".format(total_sum))