Primality proof for n = 26161:
Take b = 2.
b^(n-1) mod n = 1.
109 is prime.
b^((n-1)/109)-1 mod n = 13439, which is a unit, inverse 22038.
5 is prime.
b^((n-1)/5)-1 mod n = 1292, which is a unit, inverse 22901.
(5 * 109) divides n-1.
(5 * 109)^2 > n.
n is prime by Pocklington's theorem.