Primality proof for n = 23311:
Take b = 3.
b^(n-1) mod n = 1.
37 is prime.
b^((n-1)/37)-1 mod n = 11310, which is a unit, inverse 14776.
7 is prime.
b^((n-1)/7)-1 mod n = 7031, which is a unit, inverse 3710.
(7 * 37) divides n-1.
(7 * 37)^2 > n.
n is prime by Pocklington's theorem.