Primality proof for n = 1276987:
Take b = 2.
b^(n-1) mod n = 1.
179 is prime.
b^((n-1)/179)-1 mod n = 449904, which is a unit, inverse 486054.
41 is prime.
b^((n-1)/41)-1 mod n = 1207307, which is a unit, inverse 543984.
(41 * 179) divides n-1.
(41 * 179)^2 > n.
n is prime by Pocklington's theorem.