Project Euler #56: Powerful digit sum

  • + 0 comments

    Simple solution in Python 3

    n=int(input().strip())
    m=0
    for i in range(1,n):
        for j in range(1,n):
            s=sum(map(int,list(str(pow(i,j)))))
            if s>m:
                m=s
    print(m)