Primality proof for n = 354751:
Take b = 2.
b^(n-1) mod n = 1.
43 is prime.
b^((n-1)/43)-1 mod n = 71900, which is a unit, inverse 252860.
11 is prime.
b^((n-1)/11)-1 mod n = 210657, which is a unit, inverse 147069.
5 is prime.
b^((n-1)/5)-1 mod n = 298366, which is a unit, inverse 329182.
(5^3 * 11 * 43) divides n-1.
(5^3 * 11 * 43)^2 > n.
n is prime by Pocklington's theorem.