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

Solution 1251263

Submitted on 14 Aug 2017 by Zakaria Makhlouki
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)

y = 997 ans = []

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

y = 9973 ans = []

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

y = 99871 ans = []

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!