Primality proof for n = 28771:
Take b = 2.
b^(n-1) mod n = 1.
137 is prime.
b^((n-1)/137)-1 mod n = 18560, which is a unit, inverse 479.
7 is prime.
b^((n-1)/7)-1 mod n = 13823, which is a unit, inverse 13094.
(7 * 137) divides n-1.
(7 * 137)^2 > n.
n is prime by Pocklington's theorem.