Primality proof for n = 42641:
Take b = 3.
b^(n-1) mod n = 1.
41 is prime.
b^((n-1)/41)-1 mod n = 1217, which is a unit, inverse 10196.
13 is prime.
b^((n-1)/13)-1 mod n = 6210, which is a unit, inverse 19906.
(13 * 41) divides n-1.
(13 * 41)^2 > n.
n is prime by Pocklington's theorem.