Cody

# Problem 42827. Number construction II

Solution 1727869

Submitted on 15 Feb 2019 by Alfonso Nieto-Castanon
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
n = 28; [a b c d] = numcons(n); assert(all([a b c d]==0))

2   Pass
n = 40; [a b c d] = numcons(n); assert(all([a b c d]==0))

3   Pass
n = 41; [a b c d] = numcons(n); assert(all([a b c d]==0))

4   Pass
n = 26; [a b c d] = numcons(n); assert(all(mod([a b c d],1)==0)) assert(all([a b c d]>1)) assert(a*2^b+c*3^d==n)

5   Pass
n = 38; [a b c d] = numcons(n); assert(all(mod([a b c d],1)==0)) assert(all([a b c d]>1)) assert(a*2^b+c*3^d==n)

6   Pass
n = 39; [a b c d] = numcons(n); assert(all(mod([a b c d],1)==0)) assert(all([a b c d]>1)) assert(a*2^b+c*3^d==n)

7   Pass
n = 555; [a b c d] = numcons(n); assert(all(mod([a b c d],1)==0)) assert(all([a b c d]>1)) assert(a*2^b+c*3^d==n)

### Community Treasure Hunt

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

Start Hunting!