Cody

Problem 44284. Given a number N, find the smallest prime P>N

Solution 3784023

Submitted on 22 Nov 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
N=991; P=997; assert(prima(N)==P)

z = 992

Assertion failed.

2   Fail
N=9967; P=9973; assert(prima(N)==P)

z = 9968

Assertion failed.

3   Fail
N=99859; P=99871; assert(prima(N)==P)

z = 99860

Assertion failed.

Suggested Problems

More from this Author100

Community Treasure Hunt

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

Start Hunting!