Primality proof for n = 126241:
Take b = 2.
b^(n-1) mod n = 1.
263 is prime.
b^((n-1)/263)-1 mod n = 40022, which is a unit, inverse 81428.
5 is prime.
b^((n-1)/5)-1 mod n = 118277, which is a unit, inverse 71284.
(5 * 263) divides n-1.
(5 * 263)^2 > n.
n is prime by Pocklington's theorem.