Summing digits - MATLAB Cody - MATLAB Central

Problem 20. Summing digits

Difficulty:Rate

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

Example:

 Input  n = 7
 Output b = 11

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

Solution Stats

53.84% Correct | 46.16% Incorrect
Last Solution submitted on May 13, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
3
5
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers7756

Suggested Problems

More from this Author96

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page