cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A385856 Near-Wieferich primes (primes p satisfying 2^p == 2 + A*p (mod p^2)) with |A| <= 10.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 29, 37, 41, 43, 47, 71, 157, 173, 211, 251, 263, 379, 383, 1093, 1097, 1699, 1753, 2633, 2659, 3373, 3511, 3593, 5501, 8089, 10691, 15823, 27967, 30577, 45827, 46477, 1437049, 1483597, 1897121, 2152849, 6266543, 52368101, 110057537, 126233057, 1683955849, 2001907169, 13211006161, 47004625957
Offset: 1

Views

Author

A. Lamek, Jul 10 2025

Keywords

Comments

Near-Wieferich primes: 2^p == 2 + A*p (mod p^2) for |A| <= 10. Extends the Wieferich condition by allowing small symmetric offsets.
See also A246568 for a related formulation involving the same congruence structure.
All values verified for p <= 5*10^10.

Examples

			p=11: 2^11 == 2048 == 2+(-1)*11 == -9 == 112 (mod 121), so A=-1.
p=5: 2^5 == 32 == 2+1*5 == 7 (mod 25), so A=1.
		

Crossrefs

Programs

  • Mathematica
    isokQ[p_] := Module[{A}, A = Quotient[PowerMod[2, p, p^2] - 2, p]; A <= 10 || p - A <= 10]
  • PARI
    isok(p) = lift(Mod(2, p^2)^p-2+10*p) <= 20*p; \\ Michel Marcus, Jul 12 2025
  • Python
    def is_a385856(p):
        A = ((pow(2, p, p*p)-2) // p) % p
        return (A<=10) or (p-A<=10)
    

Extensions

a(44)-a(46) from Michel Marcus, Jul 12 2025
a(48) from Jinyuan Wang, Jul 13 2025