Cody

Problem 45794. *Prime number check 2 (in construction)

Solution 2525276

Submitted on 12 Jun 2020 by Binbin Qi
  • Size: 18
  • 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
x = 16; y_correct = [ 2 4 8 16 ]; assert(isequal(your_fcn_name(x),y_correct))

ans = 2 4 8 16

2   Pass
x = 23; y_correct = [ 23 ]; assert(isequal(your_fcn_name(x),y_correct))

ans = 23

3   Pass
x = 100; y_correct = [ 2 4 5 10 20 25 50 100 ]; assert(isequal(your_fcn_name(x),y_correct))

ans = 2 4 5 10 20 25 50 100

Suggested Problems

More from this Author46

Community Treasure Hunt

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

Start Hunting!