You are on the Home/Other Tutorials/Project Euler/Problem 16 page
Google
Web This Site

Project Euler - Problem 16

More about Project Euler.

Problem description

2^(15) = 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)?

Solution

Given the Large Number Arithmetic functions, in some cell in Excel (I used Cell S28) enter the function =LargePower(2,1000).  Then, to compute the sum of the individual digits in the result, use the array formula =SUM(--MID(S28,ROW(INDIRECT("1:"&LEN(S28))),1))  To enter an array formula complete data entry with the CTRL+SHIFT+ENTER combination rather than just the ENTER or TAB key.  If done correctly, Excel will show the formula wrapped between curly brackets { and }