Project Euler #56: Powerful digit sum

  • + 0 comments

    100/-points python3

    def summer(n):
        '''Takes in an integer n and returns the sum of its digits'''
        return sum([int(x) for x in str(n)])
    
    n=int(input())
    print(max([summer(i**j) for i in range(2,n) for j in range(1,n)]))