Primality proof for n = 1390586390785817:
Take b = 2.
b^(n-1) mod n = 1.
3986498609 is prime.
b^((n-1)/3986498609)-1 mod n = 289137438737830, which is a unit, inverse 869790696162686.
(3986498609) divides n-1.
(3986498609)^2 > n.
n is prime by Pocklington's theorem.