Move Project Euler under puzzles.

This commit is contained in:
2015-02-08 23:11:37 +04:00
parent 1089dd825f
commit e2841a251e
872 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
#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?
pp = 1000
c = [0 for i in range(0, pp//3+1)]
c[0] = 1
for i in range(0,pp):
r = 0
for j in range(0,len(c)):
p = c[j]*2+r
r = p//10
c[j] = p%10
print( sum(c) )