Primality proof for n = 124822877:
Take b = 2.
b^(n-1) mod n = 1.
4273 is prime.
b^((n-1)/4273)-1 mod n = 122492350, which is a unit, inverse 35056210.
109 is prime.
b^((n-1)/109)-1 mod n = 88257422, which is a unit, inverse 7603136.
(109 * 4273) divides n-1.
(109 * 4273)^2 > n.
n is prime by Pocklington's theorem.