Cody

Solution 1657301

Submitted on 23 Oct 2018 by Kristopher Powers
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
m = 220; n = 284; y_correct = true; assert(isequal(amicable(m,n),y_correct))

x = 220 110 0 55 44 0 0 0 0 22 20 z = 284 142 0 71 b = logical 1

2   Pass
m = 220; n = 504; y_correct = false; assert(isequal(amicable(m,n),y_correct))

x = 220 110 0 55 44 0 0 0 0 22 20 z = 504 252 168 126 0 84 72 63 56 0 0 42 0 36 0 0 0 28 0 0 24 b = logical 0

3   Pass
m = 2620; n = 2924; y_correct = true; assert(isequal(amicable(m,n),y_correct))

x = Columns 1 through 15 2620 1310 0 655 524 0 0 0 0 262 0 0 0 0 0 Columns 16 through 20 0 0 0 0 131 z = Columns 1 through 15 2924 1462 0 731 0 0 0 0 0 0 0 0 0 0 0 Columns 16 through 30 0 172 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 31 through 43 0 0 0 86 0 0 0 0 0 0 0 0 68 b = logical 1

4   Pass
m = 5020; n = 5564; y_correct = true; assert(isequal(amicable(m,n),y_correct))

x = Columns 1 through 15 5020 2510 0 1255 1004 0 0 0 0 502 0 0 0 0 0 Columns 16 through 20 0 0 0 0 251 z = Columns 1 through 15 5564 2782 0 1391 0 0 0 0 0 0 0 0 428 0 0 Columns 16 through 30 0 0 0 0 0 0 0 0 0 0 214 0 0 0 0 Columns 31 through 45 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 46 through 52 0 0 0 0 0 0 107 b = logical 1

5   Pass
m = 2924; n = 5020; y_correct = false; assert(isequal(amicable(m,n),y_correct))

x = Columns 1 through 15 2924 1462 0 731 0 0 0 0 0 0 0 0 0 0 0 Columns 16 through 30 0 172 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 31 through 43 0 0 0 86 0 0 0 0 0 0 0 0 68 z = Columns 1 through 15 5020 2510 0 1255 1004 0 0 0 0 502 0 0 0 0 0 Columns 16 through 20 0 0 0 0 251 b = logical 0

Suggested Problems

More from this Author1