Cody

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

Solution 1851568

Submitted on 18 Jun 2019 by Noriko HOUNOKI
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)

P = 997

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

P = 9973

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

P = 99871

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!