function p = nextprimeAlt(n)

while ~isprime(n)
    n=n+1;
end
p=n;

end