Take b = 2.

b^(n-1) mod n = 1.

677 is prime. b^((n-1)/677)-1 mod n = 165419, which is a unit, inverse 264356.

(677) divides n-1.

(677)^2 > n.

n is prime by Pocklington's theorem.