Cody

Solution 887902

Submitted on 9 May 2016 by James
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)