14 lines
283 B
Python
14 lines
283 B
Python
|
def get_digit_sum(n):
|
||
|
return sum(map(int, str(n)))
|
||
|
|
||
|
|
||
|
def euler_056():
|
||
|
s = max([get_digit_sum(a**b) for a in range(1, 100)
|
||
|
for b in range(1, 100)])
|
||
|
return s
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
print("e056.py: " + str(euler_056()))
|
||
|
assert(euler_056() == 972)
|