Cody

Solution 934222

Submitted on 10 Aug 2016 by SirSteve26
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 = 3; y_correct = 3; assert(isequal(closestPrime(n),y_correct))

a = 2 3 5 y = 3

2   Pass
n = 20; y_correct = 23; assert(isequal(closestPrime(n),y_correct))

a = 2 3 5 7 11 13 17 19 23 29 31 37 y = 23

3   Pass
n = 86; y_correct = 89; assert(isequal(closestPrime(n),y_correct))

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

4   Pass
n = 250; y_correct = 251; assert(isequal(closestPrime(n),y_correct))

a = Columns 1 through 16 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 Columns 17 through 32 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 Columns 33 through 48 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 Columns 49 through 64 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 Columns 65 through 80 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 Columns 81 through 95 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 y = 251