Files
project-euler/problem_30.py
MitchellHansen b3831fb360 Few more problems
2017-04-23 22:19:11 -07:00

15 lines
313 B
Python

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))