Primality proof for n = 497801:
Take b = 2.
b^(n-1) mod n = 1.
131 is prime.
b^((n-1)/131)-1 mod n = 234602, which is a unit, inverse 430556.
19 is prime.
b^((n-1)/19)-1 mod n = 415397, which is a unit, inverse 133995.
(19 * 131) divides n-1.
(19 * 131)^2 > n.
n is prime by Pocklington's theorem.