Primality proof for n = 530597:
Take b = 2.
b^(n-1) mod n = 1.
389 is prime.
b^((n-1)/389)-1 mod n = 324642, which is a unit, inverse 269512.
31 is prime.
b^((n-1)/31)-1 mod n = 275236, which is a unit, inverse 103690.
(31 * 389) divides n-1.
(31 * 389)^2 > n.
n is prime by Pocklington's theorem.