Wieferich primes

A Wieferich prime (base 2) is a prime \(p\) such that

\[ 2^{p-1} \equiv 1 \pmod{p^2}. \]

Only two are currently known: \(1093\) and \(3511\). [The OEIS Foundation Inc., 2025, Wikipedia contributors, 2025]

Key facts

  • Origin (Fermat’s Last Theorem, first case): Wieferich proved in 1909 that if the first case of FLT fails for an odd prime exponent \(p\), then \(p\) must be a Wieferich prime (base 2). [Wieferich, 1909]

  • Rarity: Heuristics suggest Wieferich primes are very sparse; whether infinitely many exist is open. [Wikipedia contributors, 2025]

  • Generalization: One can define Wieferich primes for any base \(a\) via \(a^{p-1} \equiv 1 \pmod{p^2}\). [Prime Pages (UTM), 2025]

What to experiment with

  • Fast search: Implement modular exponentiation (pow with mod) to test primes up to a bound and recover \(1093,3511\).

  • Near-Wieferich primes: Measure the \(p\)-adic valuation \(v_p(2^{p-1}-1)\) and look for unusually large values.

  • Connections: Explore overlaps with other “rare prime” phenomena (e.g., Wall–Sun–Sun, Wilson) as tags rather than hard coupling.

References

See Wieferich [1909], The OEIS Foundation Inc. [2025], Wikipedia contributors [2025].