Primality proof for n = 24709:
Take b = 2.
b^(n-1) mod n = 1.
71 is prime.
b^((n-1)/71)-1 mod n = 18360, which is a unit, inverse 15034.
29 is prime.
b^((n-1)/29)-1 mod n = 6264, which is a unit, inverse 15096.
(29 * 71) divides n-1.
(29 * 71)^2 > n.
n is prime by Pocklington's theorem.