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.

Showing 1-1 of 1 results.

A371509 a(n) is the smallest prime that becomes composite if any single digit of its base-(2n+1) expansion is changed to a different digit (but not to zero).

Original entry on oeis.org

2, 67, 223, 2789, 701, 2423, 243367, 10513, 10909, 2114429, 68543, 181141, 6139219, 114493, 356479, 399946711, 22549349, 8371249, 660040873, 12088631, 3352003
Offset: 1

Views

Author

Chai Wah Wu, Mar 25 2024

Keywords

Comments

Bisection of A323745. a(n) <= A371475(n) with equality for some values of n.

Crossrefs

Programs

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

Formula

a(n) = A323745(2n+1).
a(n) <= A371475(n).
Showing 1-1 of 1 results.