Primality proof for n = 124778574733515931:
Take b = 2.
b^(n-1) mod n = 1.
1386428608150177 is prime.
b^((n-1)/1386428608150177)-1 mod n = 42584772714657001, which is a unit, inverse 111593277108648498.
(1386428608150177) divides n-1.
(1386428608150177)^2 > n.
n is prime by Pocklington's theorem.