Cody

# Problem 42085. Sum of digits of powers of 2

Solution 1615012

Submitted on 23 Aug 2018 by Srishti Saha
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
assert(isequal(sum_of_digits(1),2))

x = 2 y = 0 D = 2 ans = 2

2   Pass
assert(isequal(sum_of_digits(3),8))

x = 8 y = 0 D = 8 ans = 8

3   Pass
assert(isequal(sum_of_digits(4),7))

x = 16 y = 1 D = 1 6 ans = 7

4   Pass
assert(isequal(sum_of_digits(5),5))

x = 32 y = 1 D = 3 2 ans = 5

5   Pass
assert(isequal(sum_of_digits(7),11))

x = 128 y = 2 D = 1 2 8 ans = 11

6   Pass
assert(isequal(sum_of_digits(9),8))

x = 512 y = 2 D = 5 1 2 ans = 8

7   Pass
assert(isequal(sum_of_digits(11),14))

x = 2048 y = 3 D = 2 0 4 8 ans = 14

8   Pass
assert(isequal(sum_of_digits(14),22))

x = 16384 y = 4 D = 1 6 3 8 4 ans = 22

9   Pass
assert(isequal(sum_of_digits(16),25))

x = 65536 y = 4 D = 6 5 5 3 6 ans = 25

10   Pass
assert(isequal(sum_of_digits(20),31))

x = 1048576 y = 6 D = 1 0 4 8 5 7 6 ans = 31