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

Solution 3784038

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

z = 992

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

z = 9968

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

z = 99860

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!