Cody

# Problem 44748. Amicable numbers

Solution 1659448

Submitted on 25 Oct 2018 by goc3
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))

dm = 1 2 4 5 10 11 20 22 44 55 110 dn = 1 2 4 71 142 ans = logical 1

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

dm = 1 2 4 5 10 11 20 22 44 55 110 dn = 1 2 3 4 6 7 8 9 12 14 18 21 24 28 36 42 56 63 72 84 126 168 252 ans = logical 0

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

dm = 1 2 4 5 10 20 131 262 524 655 1310 dn = 1 2 4 17 34 43 68 86 172 731 1462 ans = logical 1

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

dm = 1 2 4 5 10 20 251 502 1004 1255 2510 dn = 1 2 4 13 26 52 107 214 428 1391 2782 ans = logical 1

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

dm = 1 2 4 17 34 43 68 86 172 731 1462 dn = 1 2 4 5 10 20 251 502 1004 1255 2510 ans = logical 0