def sum_of_digits(power):
# Calculate 2^N
number = 2 ** power
# Convert to string, iterate over digits, and sum them
return sum(int(digit) for digit in str(number))
for n in [15, 100, 1000]:
print(f"Sum of digits of 2^{n} is: {sum_of_digits(n)}")
'''
run:
Sum of digits of 2^15 is: 26
Sum of digits of 2^100 is: 115
Sum of digits of 2^1000 is: 1366
'''