Cody

# Problem 45367. Sieve of Eratosthenes - 02

Solution 2685425

Submitted on 13 Jul 2020
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   Fail
assert(isequal(sieve(50),primes(50)))

Output argument "y" (and maybe others) not assigned during call to "sieve". Error in Test1 (line 1) assert(isequal(sieve(50),primes(50)))

2   Fail
assert(isequal(sieve(5000),primes(5000)))

Output argument "y" (and maybe others) not assigned during call to "sieve". Error in Test2 (line 1) assert(isequal(sieve(5000),primes(5000)))

3   Fail
assert(isequal(sieve(19),primes(19)))

Output argument "y" (and maybe others) not assigned during call to "sieve". Error in Test3 (line 1) assert(isequal(sieve(19),primes(19)))

4   Fail
assert(isequal(sieve(6660),primes(6660)))

Output argument "y" (and maybe others) not assigned during call to "sieve". Error in Test4 (line 1) assert(isequal(sieve(6660),primes(6660)))

5   Fail
assert(isequal(sieve(20050),primes(20050)))

Output argument "y" (and maybe others) not assigned during call to "sieve". Error in Test5 (line 1) assert(isequal(sieve(20050),primes(20050)))

6   Fail
assert(isequal(sieve(200500),primes(200500)))

Output argument "y" (and maybe others) not assigned during call to "sieve". Error in Test6 (line 1) assert(isequal(sieve(200500),primes(200500)))

7   Fail
filetext = fileread('sieve.m'); assert(isempty(strfind(filetext, 'primes')),'primes() forbidden') assert(isempty(strfind(filetext, 'isprime')),'isprime() forbidden')

primes() forbidden

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!