Primality proof for n = 5113:
Take b = 5.
b^(n-1) mod n = 1.
71 is prime.
b^((n-1)/71)-1 mod n = 5104, which is a unit, inverse 568.
2 is prime.
b^((n-1)/2)-1 mod n = 5111, which is a unit, inverse 2556.
(2^3 * 71) divides n-1.
(2^3 * 71)^2 > n.
n is prime by Pocklington's theorem.