Cody

# Problem 156. Parasitic numbers

Solution 1907702

Submitted on 21 Aug 2019
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   Fail
x = 128205; n = 4 y_correct = true; assert(isequal(parasitic(x,n),y_correct))

n = 4 sx = '52820'

Matrix dimensions must agree. Error in parasitic (line 5) y = prod(sxn==sx) Error in Test1 (line 4) assert(isequal(parasitic(x,n),y_correct))

2   Fail
x = 179487; n = 4; y_correct = true; assert(isequal(parasitic(x,n),y_correct))

sx = '77948'

Matrix dimensions must agree. Error in parasitic (line 5) y = prod(sxn==sx) Error in Test2 (line 4) assert(isequal(parasitic(x,n),y_correct))

3   Fail
x = 179487; n = 3; y_correct = false; assert(isequal(parasitic(x,n),y_correct))

sx = '77948'

Matrix dimensions must agree. Error in parasitic (line 5) y = prod(sxn==sx) Error in Test3 (line 4) assert(isequal(parasitic(x,n),y_correct))

4   Fail
x = 142857; n = 5; y_correct = true; assert(isequal(parasitic(x,n),y_correct))

sx = '74285'

Matrix dimensions must agree. Error in parasitic (line 5) y = prod(sxn==sx) Error in Test4 (line 4) assert(isequal(parasitic(x,n),y_correct))

5   Fail
x = 142857; n = 4; y_correct = false; assert(isequal(parasitic(x,n),y_correct))

sx = '74285'

Matrix dimensions must agree. Error in parasitic (line 5) y = prod(sxn==sx) Error in Test5 (line 4) assert(isequal(parasitic(x,n),y_correct))

6   Fail
x = 142657; n = 5; y_correct = false; assert(isequal(parasitic(x,n),y_correct))

sx = '74265'

Matrix dimensions must agree. Error in parasitic (line 5) y = prod(sxn==sx) Error in Test6 (line 4) assert(isequal(parasitic(x,n),y_correct))

7   Fail
x = 142857; n = 4; y_correct = false; assert(isequal(parasitic(x,n),y_correct))

sx = '74285'

Matrix dimensions must agree. Error in parasitic (line 5) y = prod(sxn==sx) Error in Test7 (line 4) assert(isequal(parasitic(x,n),y_correct))

8   Fail
x = 1012658227848; n = 8; y_correct = true; assert(isequal(parasitic(x,n),y_correct))

sx = '801265822784'

Matrix dimensions must agree. Error in parasitic (line 5) y = prod(sxn==sx) Error in Test8 (line 4) assert(isequal(parasitic(x,n),y_correct))

9   Fail
x = 1012658227848; n = 4; y_correct = false; assert(isequal(parasitic(x,n),y_correct))

sx = '801265822784'

Matrix dimensions must agree. Error in parasitic (line 5) y = prod(sxn==sx) Error in Test9 (line 4) assert(isequal(parasitic(x,n),y_correct))

10   Fail
x = 142857; n = 7; y_correct = false; assert(isequal(parasitic(x,n),y_correct))

sx = '74285'

Matrix dimensions must agree. Error in parasitic (line 5) y = prod(sxn==sx) Error in Test10 (line 4) assert(isequal(parasitic(x,n),y_correct))

11   Pass
x = 12; n = 2; y_correct = false; assert(isequal(parasitic(x,n),y_correct))

sx = '2' y = 0