function n = nextPrime(m)
n = m + 1;
while 1
    if isprime(n) break;
    else n = n + 1;
    end;
end;
     