"There's no slick trick to check fast enough, whether or not a large number is prime. So much so that finding large prime numbers is one of the most challenging aspects of mathematics and computing.<p>This very fact, that large prime numbers are hard to find, is the basis of cryptography which is fundamental to cyber security."<p>That is simply flat out wrong.<p>What they probably are referring to is RSA. However the basis of RSA is not that it's hard to find a large prime number. (Actually if that would be hard then RSA would be impossible, as it needs large primes for key generation.) The basis is that it's hard to factorize a composite number.
There is a mistake in the description of the Rabin-Miller test.<p>The test itself is deterministic. If you try it for more than half of the numbers in the range, it gives you an exact answer.<p>In practice we run it as a probabilistic test because we don't want to test all of those numbers. :-)
Primes have always fascinated me despite not being a mathematician. Counting numbers are regular yet the pattern of primes seems not to be (although there is a way of plotting them that makes pretty spiral like structures).
It might be late and me being tired, but isPrime function will return false for 1 and any other prime? Shouldn't it be true when function is called isPrime?