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.

User: A. Lamek

A. Lamek's wiki page.

A. Lamek has authored 2 sequences.

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

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

A385924 Integers k such that 2^k-1 has 0 as its second-most significant digit in base k.

Original entry on oeis.org

10, 19, 39, 181, 493, 941, 2454, 16111, 30730, 416488, 1433896, 1663074
Offset: 1

Author

A. Lamek, Jul 12 2025

Keywords

Comments

Inspired by the Wieferich primes which ask for two least significant 0 digits of 2^(p-1)-1 in base p.

Examples

			19 is a term since 2^19-1 = 524287 = 40861_19 has 0 as its second-most significant base 19 digit.
		

Crossrefs

Cf. A000225, A001220 (Wieferich primes).

Programs

  • Mathematica
    isok[k_] := Module[{d = IntegerDigits[2^k - 1, k]}, Length[d] >= 2 && d[[2]] == 0]
  • PARI
    isok(k) = digits(2^k-1, k)[2] == 0; \\ Michel Marcus, Jul 17 2025
    
  • PARI
    isok(k) = if (k>1, my(X=2^k-1); !((X\k^(logint(X, k)-1)) % k)); \\ Michel Marcus, Jul 17 2025
  • Python
    def is_a385924(k):
        x = pow(2, k) - 1
        r = None
        while x >= k:
            r = x % k
            x //= k
        return r == 0
    
  • Python
    def is_a385924(k):
        x = pow(2, k) - 1
        approx = k // k.bit_length()
        power = pow(k, approx)
        while power * k <= x:
            power *= k
            approx += 1
        return (x // pow(k, approx - 1)) % k == 0
    

Extensions

a(11)-a(12) from Michael S. Branicky, Jul 20 2025