Cody

# Problem 83. Prime factor digits

Solution 2041306

Submitted on 1 Dec 2019 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 = 2; p_correct = 1; assert(isequal(factor_digits(n),p_correct))

a = 37 31 29 23 19 17 13 11 7 5 3 2 b = 2 d = 2 e = 1 q = 1×12 logical array 0 0 0 0 0 0 0 0 0 0 0 1 s = 0 0 0 0 0 0 0 0 0 0 0 1 s = 0 0 0 0 0 0 0 0 0 0 0 1 p = 1

2   Pass
n = 26; p_correct = [1 0 0 0 0 1]; assert(isequal(factor_digits(n),p_correct))

a = 37 31 29 23 19 17 13 11 7 5 3 2 b = 2 13 d = 2 13 e = 1 1 q = 1×12 logical array 0 0 0 0 0 0 1 0 0 0 0 1 s = 0 0 0 0 0 0 1 0 0 0 0 1 s = 0 0 0 0 0 0 1 0 0 0 0 1 s = 0 0 0 0 0 0 1 0 0 0 0 1 p = 1 0 0 0 0 1

3   Pass
n = 168; p_correct = [1 0 1 3]; assert(isequal(factor_digits(n),p_correct))

a = 37 31 29 23 19 17 13 11 7 5 3 2 b = 2 2 2 3 7 d = 2 3 7 e = 3 1 1 q = 1×12 logical array 0 0 0 0 0 0 0 0 1 0 1 1 s = 0 0 0 0 0 0 0 0 1 0 1 1 s = 0 0 0 0 0 0 0 0 1 0 1 3 s = 0 0 0 0 0 0 0 0 1 0 1 3 s = 0 0 0 0 0 0 0 0 1 0 1 3 p = 1 0 1 3

4   Pass
n = 999; p_correct = [1 0 0 0 0 0 0 0 0 0 3 0]; assert(isequal(factor_digits(n),p_correct))

a = 37 31 29 23 19 17 13 11 7 5 3 2 b = 3 3 3 37 d = 3 37 e = 3 1 q = 1×12 logical array 1 0 0 0 0 0 0 0 0 0 1 0 s = 1 0 0 0 0 0 0 0 0 0 1 0 s = 1 0 0 0 0 0 0 0 0 0 3 0 s = 1 0 0 0 0 0 0 0 0 0 3 0 p = 1 0 0 0 0 0 0 0 0 0 3 0