Cody

# Problem 42827. Number construction II

Solution 2119811

Submitted on 6 Feb 2020 by Asif Newaz
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))

y = 0 0 0 0

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

y = 0 0 0 0

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

y = 0 0 0 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)

y = 2 2 2 2

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)

y = 5 2 2 2

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)

y = 3 2 3 2

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)

y = 132 2 3 2

### Community Treasure Hunt

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

Start Hunting!