1 comment

[ 40.6 ms ] story [ 170 ms ] thread
Forisek & Jancina is a deterministic (not probabilistic) primality test for small integers. It’s super fast and easy to code.

For 32-bit integers, one needs only a 512 byte lookup table and and a few adds and muls to test for primality