@AlextTP
My last entry is not miller-rabin, but a naive test to see if miller-rabin is correct.
You did not read the whole thread. Miller-rabin is about probabilities, either by determinstic values or by random probing.
The deterministic values come from verification runs and in the wiki entry you will find them.
It is
much faster than simple sieves or other naive prime algorithms on big primes.
Note that the current implementation I gave is hampered by the limits of native unsigned integer types.(Uint64, Uint32)
Ideally you would implement it using a biginteger library. (As I wrote before)
But the algorithm is correct and the example is useable for primes in a range < ~4.7 billion.
With the chosen values it covers the primes in that range 100%
That is "not quite" highschool math....
