Pregunta
How do I find the nearest prime number greater than the input? This is what I've managed to do so far...
function out = next_prime(X)
out = 0;
n = 0;
while out == isprime(X)
n = n + 1;
out = out + n + X;
...
más de 5 años hace | 1 respuesta | 0