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.

A371475 Smallest weak prime in base 2n+1.

Original entry on oeis.org

2, 83, 223, 2789, 3347, 4751, 484439, 10513, 10909, 2823167, 68543, 181141, 6139219, 488651, 356479, 399946711, 22549349, 8371249, 660040873, 12088631, 3352003, 234606268969, 84343813, 82751411, 153722088497, 141451831, 11085190183, 350552595007, 535946951, 658716229
Offset: 1

Views

Author

Chai Wah Wu, Mar 24 2024

Keywords

Comments

Bisection of A186995. Smallest weak prime in odd bases appear to be relatively smaller than smallest weak prime in even bases. This could be due to the fact that for an odd base and an odd prime, any digit change with an odd difference from the original digit results in an even number and thus not prime, so only digit changes with an even difference need to be checked for primality, whereas for an even base, all digit changes need to be checked.
Smallest weak prime in odd bases of the form 6k+3 appear to be relatively larger than smallest weak prime in other odd bases.

Crossrefs

Cf. A186995, A050249 (base 10), A137985 (base 2).

Programs

  • Python
    from sympy import isprime, nextprime
    from sympy.ntheory import digits
    def A371475(n):
        if n == 1: return 2
        p, r = 5, (n<<1)+1
        while True:
            s = digits(p,r)[1:]
            l = len(s)
            for i,j in enumerate(s[::-1]):
                m = r**i
                for k in range(j&1,r,2):
                    if k!=j and isprime(p+(k-j)*m):
                        break
                else:
                    continue
                break
            else:
                return p
            p = nextprime(p)

Formula

a(n) = A186995(2*n+1).

Extensions

a(22)-a(27) from Michael S. Branicky, Apr 01 2024
a(28)-a(30) from Michael S. Branicky, Apr 06 2024