Cody

Problem 45767. Prime number check (★★)

Solution 2911840

Submitted on 4 Sep 2020 by Ramesh Kumar V
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
x = 35; y_correct = [1 2 3 0]; assert(isequal(your_fcn_name(x),y_correct))

z = 5.9161 z1 = 2 3 4 5 m = 4 y = [] z3 = 1 y = 1 z3 = 2 y = 1 2 z3 = 3 y = 1 2 3 z3 = 0 y = 1 2 3 0

2   Pass
x = 31; y_correct = [1 1 3 1]; assert(isequal(your_fcn_name(x),y_correct))

z = 5.5678 z1 = 2 3 4 5 m = 4 y = [] z3 = 1 y = 1 z3 = 1 y = 1 1 z3 = 3 y = 1 1 3 z3 = 1 y = 1 1 3 1

3   Pass
x = 21; y_correct = [1 0 1]; assert(isequal(your_fcn_name(x),y_correct))

z = 4.5826 z1 = 2 3 4 m = 3 y = [] z3 = 1 y = 1 z3 = 0 y = 1 0 z3 = 1 y = 1 0 1