Compute the largest number with a given integer complexity - MATLAB Cody - MATLAB Central

Problem 57487. Compute the largest number with a given integer complexity

Difficulty:Rate
Cody Problems 42831 and 42834 ask us to compute integer complexity, the smallest number of 1s needed to construct a number with addition and multiplication. For example, the integer complexity of 11 is 8 because it can be written as (1+1)x(1+1+1+1+1)+1. The other numbers with integer complexity 8 are 13, 14, 15, 16, and 18. Therefore 18 = (1+1+1)x(1+1+1)x(1+1) is the largest integer with complexity 8.
Write a function to determine the largest number with given integer complexities. Return the answers as a cell array of strings.

Solution Stats

37.04% Correct | 62.96% Incorrect
Last Solution submitted on Jun 20, 2025

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
3
6

Problem Recent Solvers7

Suggested Problems

More from this Author304

Problem Tags

Community Treasure Hunt

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

Start Hunting!