Prime number generator using the Miller-Rabin primality test