Power digit sum
Problem 16
215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 21000?
|
k=1000
temp=1;
for i in range(1,k+1):
temp*=2
temp=str(temp)
result=0
for i in range(0,len(temp)):
result+=int(temp[i])
print(result)
time : <1s
时间: 2024-08-09 05:43:13