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.

A384979 a(n) is the smallest (n+2)-digit prime consisting of a string of n identical digits d sandwiched between two digits different from d, or -1 if no such prime exists.

Original entry on oeis.org

11, 101, 1009, 10007, 100003, 1000003, 13333339, 100000007, 1000000007, 13333333339, 100000000003, 1333333333337, 13333333333339, 122222222222227, 1555555555555553, 16666666666666661, 100000000000000003, 1000000000000000003, 15555555555555555557
Offset: 0

Views

Author

Gonzalo Martínez, Jun 14 2025

Keywords

Comments

Unlike A300102, where the central string contains only zeros, in this sequence the central string can be any digit d, which gives more combinations to find primes sandwiched between two digits that are different from the central string.
As n grows, these primes tend to become sparser, where a(94) is the first term for which k does not exist. Specifically, a(n) = -1, only for 1 term for n < 100 and for 479 terms for n < 1000.
For each n >= 1, there are a fixed number (657) of possible candidates to test for primality; this, plus the increasing sparsity of primes themselves as their number of digits grows, accounts for the pattern noted above. - Michael S. Branicky, Jun 25 2025

Crossrefs

Programs

  • Python
    from sympy import isprime
    def a(n): return next((t for l in "123456789" for d in "0123456789" if d!=l for r in "123456789" if r!=d and isprime(t:=int(l+d*n+r))), -1)
    print([a(n) for n in range(20)]) # Michael S. Branicky, Jun 14 2025

Formula

a(n) <= A300102(n), for all n >= 0, with equality when the central string of a(n) is zero and A300102(n) has n+2 digits.