You are viewing a single comment's thread. Return to all comments →
solution python 3
def digit_sum(number): return sum(map(int, str(number))) def max_digital_sum(n): max_sum = 0 for a in range(1, n): for b in range(1, n): max_sum = max(max_sum, digit_sum(a**b)) return max_sum n = int(input()) print(max_digital_sum(n))
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #56: Powerful digit sum
You are viewing a single comment's thread. Return to all comments →
solution python 3