Cody

Problem 44305. 5 Prime Numbers

Solution 1937474

Submitted on 15 Sep 2019 by ChanXy
• Size: 8
• This is the leading solution.
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_min = 60; n_max = 1000; y_correct = [151,157,251,257,353]; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint1 (line 4) In solutionTest (line 3)]

2   Pass
n_min = 60; n_max = 300; y_correct = -1; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint2 (line 4) In solutionTest (line 5)]

3   Pass
n_min = 1; n_max = 200; y_correct = [5,53,59,151,157]; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint3 (line 4) In solutionTest (line 7)]

4   Pass
n_min = 1; n_max = 100; y_correct = -1; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint4 (line 4) In solutionTest (line 9)]

5   Pass
n_min = 500; n_max = 600; y_correct = [503,509,521,523,541]; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint5 (line 4) In solutionTest (line 11)]

6   Pass
n_min = 500; n_max = 555; y_correct = [503,509,521,523,541]; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint6 (line 4) In solutionTest (line 13)]

7   Pass
n_min = 500; n_max = 500000000; y_correct = [503,509,521,523,541]; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint7 (line 4) In solutionTest (line 15)]

8   Pass
n_min = 5000; n_max = 5020; y_correct = -1; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint8 (line 4) In solutionTest (line 17)]

9   Pass
n_min = 5000; n_max = 5200; y_correct = [5003,5009,5011,5021,5023]; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint9 (line 4) In solutionTest (line 19)]

10   Pass
n_min = 5000; n_max = 55555555; y_correct = [5003,5009,5011,5021,5023]; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint10 (line 4) In solutionTest (line 21)]

11   Pass
n_min = 55555; n_max = 56789; y_correct = [55579,55589,55603,55609,55619]; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint11 (line 4) In solutionTest (line 23)]

12   Pass
n_min = 987654321; n_max = 988777666; y_correct = [987654323,987654337,987654347,987654359,987654361]; assert(isequal(five_primes(n_min,n_max),y_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In five_primes (line 2) In ScoringEngineTestPoint12 (line 4) In solutionTest (line 25)]