Check out my first novel, midnight's simulacra!

Miller-Rabin Primality Test

From dankwiki

A deterministic primality test based on Fermat's Little Theorem. See The Structure and Interpretation of Computer Programs, 2nd edition, p56.