Primality proof for n = 407723:
Take b = 2.
b^(n-1) mod n = 1.
29123 is prime. b^((n-1)/29123)-1 mod n = 16383, which is a unit, inverse 2862.
(29123) divides n-1.
(29123)^2 > n.
n is prime by Pocklington's theorem.