Problem 1722. Find the next prime number

Find the next prime number or numbers for given n. For example:

n = 1;
out = 2;


n = [5 7];
out = [7 11];

Good luck!

Solution Stats

63.64% Correct | 36.36% Incorrect
Last solution submitted on Oct 04, 2016


Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Join the 15-year community celebration.

Play games and win prizes!

Learn more