// you’re reading...

Project Euler Solutions

Project Euler Problem 16 Solution

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Problem Description

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?

Analysis

Calculate 21000, split the digits and add them together.

Solution

Runs < 1 second in Python.

print "Answer to PE16 = ", sum(int(i) for i in str(2**1000))

Comments

Discussion

One comment for “Project Euler Problem 16 Solution”

  1. [...] Same solution as problem 16. [...]

    Posted by Dreamshire | Project Euler Problem 20 Solution | May 18, 2009, 12:48 pm

Post a comment