FunctionRacerProblemsRace

Next Prime

EasyMathPython, JavaScript, TypeScript, Java, C++

Return the smallest prime number that is strictly greater than n.

Example 1

n 10
returns 11

11 is prime.

Example 2

n 13
returns 17

The next prime after 13 is 17.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems