What is the sum of the digits of the number 2^1000?

- Code: Select all
`: sumDigits(n) { 0 while(n) [ n 10 /mod ->n + ] }`

2 1000 pow sumDigits

1 post
• Page **1** of **1**

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?

What is the sum of the digits of the number 2^1000?

- Code: Select all
`: sumDigits(n) { 0 while(n) [ n 10 /mod ->n + ] }`

2 1000 pow sumDigits

- Franck
**Posts:**163**Joined:**29 Oct 2014 19:01

1 post
• Page **1** of **1**

Return to Project Euler in Oforth

Users browsing this forum: No registered users and 1 guest