Primality proof for n = 121271:
Take b = 2.
b^(n-1) mod n = 1.
181 is prime.
b^((n-1)/181)-1 mod n = 85749, which is a unit, inverse 54941.
5 is prime.
b^((n-1)/5)-1 mod n = 63674, which is a unit, inverse 101435.
(5 * 181) divides n-1.
(5 * 181)^2 > n.
n is prime by Pocklington's theorem.