Problem 58
-original solution too slow
-used someone else's implementation of Rabin-Miller test
-credits go to Kristian of mathblog.dk