Cody

Problem 42085. Sum of digits of powers of 2

Given n, first, calculate the number 2^n. Then, sum the digits that comprise that number. For example:

 Input: n = 7
 2^n = 128
 Output: b = 1 + 2 + 8 = 11

Solution Stats

48.31% Correct | 51.69% Incorrect
Last Solution submitted on Jan 11, 2020

Problem Comments