Problem 252. Project Euler: Problem 16, Sums of Digits of Powers of Two
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^N?
Thanks to Project Euler Problem 16.
Solution Stats
Problem Comments
-
2 Comments
@bmtran (Bryant Tran)
on 4 Feb 2012
added a test case to make it a wee bit harder
Hoang Minh Tri
on 19 Nov 2025 at 19:40
ta cần nhân 2 cho đến khi đủ mũ n và hãy lưu ý rằng nên để kết quả dưới dạng char để tránh bị tràn số vì input là mũ rất lớn
Solution Comments
Show commentsProblem Recent Solvers172
Suggested Problems
-
7416 Solvers
-
Maximum running product for a string of numbers
2223 Solvers
-
655 Solvers
-
302 Solvers
-
264 Solvers
More from this Author56
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!