factor in scalar context; miller_rabin_random should return only 0 or 1