miller-rabin test with bases 2, 3 and 4