Primality proof for n = 1376827:
Take b = 2.
b^(n-1) mod n = 1.
907 is prime.
b^((n-1)/907)-1 mod n = 21635, which is a unit, inverse 106086.
23 is prime.
b^((n-1)/23)-1 mod n = 178928, which is a unit, inverse 944414.
(23 * 907) divides n-1.
(23 * 907)^2 > n.
n is prime by Pocklington's theorem.