Primality proof for n = 31937378989:
Take b = 2.
b^(n-1) mod n = 1.
3460921 is prime. b^((n-1)/3460921)-1 mod n = 27018183262, which is a unit, inverse 23875014899.
(3460921) divides n-1.
(3460921)^2 > n.
n is prime by Pocklington's theorem.