Primality proof for n = 97:
Take b = 5.
b^(n-1) mod n = 1.
3 is prime.
b^((n-1)/3)-1 mod n = 34, which is a unit, inverse 20.
2 is prime.
b^((n-1)/2)-1 mod n = 95, which is a unit, inverse 48.
(2^5 * 3) divides n-1.
(2^5 * 3)^2 > n.
n is prime by Pocklington's theorem.