Given a number N, find the smallest prime P>N - MATLAB Cody - MATLAB Central

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

Difficulty:Rate

Given a number N, find the smallest prime P greater than N. For example: If N=10 then P=11. If N=13 then P=17.

Solution Stats

59.72% Correct | 40.28% Incorrect
Last Solution submitted on Jan 09, 2025

Problem Comments

Solution Comments

Show comments
MATLAB Central 2024 In Review
...
Let's celebrate what made 2024 memorable! Together, we made big impacts, hosted...

Problem Recent Solvers175

Suggested Problems

More from this Author100

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page