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.15% Correct | 48.85% Incorrect
Last solution submitted on Oct 23, 2018

Problem Comments

Solution Comments

Recent Solvers4186


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!