I'm using a straight-forward implementation of miller-rabin with preset values that guarantee primality discovery for the range of values allowed in the problem. (I wrote my own pow_mod() which is probably where I'm missing out on time. Don't care enough to figure out the library call's name.) Alternately in Haskell I pre-calced the primes needed to cover the solution space. Perhaps I'm behind the state of the art in primality testing but I'd be really surprised if either of those could be labeled the 'wrong algorithm'.
-ljr