Cody

Problem 42977. Prime number removal

Solution 963288

Submitted on 8 Sep 2016 by J.R.! Menzinger
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
x = [277 680 656 163 119 499 960 341 586 224 752 256 506 700]; y_correct = [ 680 656 119 960 341 586 224 752 256 506 700] ; assert(isequal(prime_remove(x),y_correct))

y_correct = 680 656 119 960 341 586 224 752 256 506 700

2   Pass
x = [ 891 960 548 139 150 258 841 255 815 244 930 350 197 252] ; y_correct = [891 960 548 150 258 841 255 815 244 930 350 252] ; assert(isequal(prime_remove(x),y_correct))

x = 891 960 548 139 150 258 841 255 815 244 930 350 197 252 y_correct = 891 960 548 150 258 841 255 815 244 930 350 252

3   Pass
x = [617 474 352 831 586 550 918 286 758 754 381 568 76 54] ; y_correct = [474 352 831 586 550 918 286 758 754 381 568 76 54] ; assert(isequal(prime_remove(x),y_correct))

x = 617 474 352 831 586 550 918 286 758 754 381 568 76 54 y_correct = 474 352 831 586 550 918 286 758 754 381 568 76 54

4   Pass
x = [ 531 780 935 130 569 470 12 338 163 795 312 529 166 602] ; y_correct = [ 531 780 935 130 470 12 338 795 312 529 166 602] ; assert(isequal(prime_remove(x),y_correct))

x = 531 780 935 130 569 470 12 338 163 795 312 529 166 602 y_correct = 531 780 935 130 470 12 338 795 312 529 166 602

5   Pass
x = [107 962 5 775 818 869 85 400 260 801 432 911 182 264] ; y_correct = [ 962 775 818 869 85 400 260 801 432 182 264] ; assert(isequal(prime_remove(x),y_correct)) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

x = 107 962 5 775 818 869 85 400 260 801 432 911 182 264 y_correct = 962 775 818 869 85 400 260 801 432 182 264

Suggested Problems

More from this Author2

Community Treasure Hunt

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

Start Hunting!