Cody

Problem 44645. Prime numbers between a , b.

Solution 2037605

Submitted on 28 Nov 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
a=100; b=120; y_correct = [101 103 107 109 113]; assert(isequal(allprimes(a,b),y_correct))

c = 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 d = Columns 1 through 29 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 Column 30 113 y = 101 103 107 109 113

2   Pass
a=140; b=180; y_correct = [149 151 157 163 167 173 179]; assert(isequal(allprimes(a,b),y_correct))

c = Columns 1 through 29 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 Columns 30 through 34 113 127 131 137 139 d = Columns 1 through 29 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 Columns 30 through 41 113 127 131 137 139 149 151 157 163 167 173 179 y = 149 151 157 163 167 173 179

3   Pass
a=14; b=20; y_correct = [17 19]; assert(isequal(allprimes(a,b),y_correct))

c = 2 3 5 7 11 13 d = 2 3 5 7 11 13 17 19 y = 17 19