Power digit sum

$$ 2^{15} = 32768 $$ and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.

What is the sum of the digits of the number $$ 2^{1000} $$


Idea

brute force


In [1]:
def solve(power):
    return sum([int(d) for d in str(pow(2, power))])
In [2]:
solve(15)
Out[2]:
26
In [3]:
solve(1000)
Out[3]:
1366