Few more problems
This commit is contained in:
15
problem_30.py
Normal file
15
problem_30.py
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
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))
|
||||
Reference in New Issue
Block a user