Problem 20. Summing digits

Created by Cody Team in Cody Challenge

Given n, find the sum of the digits that make up 2^n.


 Input  n = 7
 Output b = 11

since 2^7 = 128, and 1 + 2 + 8 = 11.

Solution Stats

51.39% Correct | 48.61% Incorrect
Last solution submitted on Aug 14, 2018

Problem Comments

Solution Comments

Recent Solvers4063


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!