A prime p is called a Wieferich prime if 2p-1-1 is a multiple of p2. Only two Wieferich primes are known, 1093 and 3511, and it is suspected that only finitely many primes share this property.

More generally, a Wieferich prime to base b is a prime p such that p2 divides bp-1-1. Double Wieferich primes are pairs of primes pq such that p is Wieferich to base q and vice versa.

Wieferich primes first arose in the study of Fermat's last theorem. Wieferich proved in 1909 that if a counterexample to Fermat's last theorem were to exist, the exponent of the integer powers involved must be a Wieferich prime. (Mirimanoff the following year proved that the exponent would also need to be a Wieferich prime to base 3.) More recently, double Wieferich primes have cropped up in the search for counterexamples to another famous problem, Catalan's conjecture.