using miller rabin primality testing in a problem