Primality proof for n = 145709:
Take b = 2.
b^(n-1) mod n = 1.
499 is prime. b^((n-1)/499)-1 mod n = 8478, which is a unit, inverse 83854.
(499) divides n-1.
(499)^2 > n.
n is prime by Pocklington's theorem.