Write a function that outputs the th prime after a given number n. For example, the th prime after is .
NOTE: If n itself is prime start counting from the next prime greater than n.

Solution Stats

105 Solutions

19 Solvers

Last Solution submitted on Jun 18, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers19

Suggested Problems

More from this Author116

Community Treasure Hunt

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

Start Hunting!