Primality proof for n = 9863677:
Take b = 2.
b^(n-1) mod n = 1.
881 is prime.
b^((n-1)/881)-1 mod n = 2183258, which is a unit, inverse 2715823.
311 is prime.
b^((n-1)/311)-1 mod n = 4477381, which is a unit, inverse 3050820.
(311 * 881) divides n-1.
(311 * 881)^2 > n.
n is prime by Pocklington's theorem.