i remember implementing miller rabin for project euler. but i still preferred the 4Gb file i produced via sieve of eratosthenes for most of the problems where i could use it.