Find the Sum of the Digits of 2^1000

Status
Not open for further replies.

ring_wraith

=--=l33t=--=
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 2^1000?

Ripped off from Project Euler. Any solutions anyone?
 

QwertyManiac

Commander in Chief
Isn't it straightforward? Or are you looking for non-bruteforce methods. I don't know of a way if so.

Is a nice one-liner in most languages otherwise.

Edit: Guess you are wondering how to store such a large number? Using modulo (10) can help in that case. You need to understand a bit more of multiplication. Else just use BigNum/Etc :)
 
Last edited:
Status
Not open for further replies.
Top Bottom