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.

A381130 a(n) is the smallest prime not yet in the sequence that contains a substring of size 2 from a(n-1); a(1)=11.

Original entry on oeis.org

11, 113, 13, 131, 31, 311, 211, 421, 521, 523, 23, 223, 227, 127, 271, 71, 571, 157, 151, 251, 257, 457, 557, 577, 277, 677, 67, 167, 163, 263, 269, 569, 563, 463, 461, 61, 613, 137, 37, 337, 233, 239, 139, 313, 317, 17, 173, 73, 373, 379, 79, 179, 479, 47
Offset: 1

Views

Author

Enrique Navarrete, Feb 14 2025

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        aset, an, minp = set(), 11, 13
        while True:
            yield an
            aset.add(an)
            s = str(an)
            targets = set(s[i:i+2] for i in range(len(s)-1))
            p = minp
            w = str(p)
            while p in aset or not any(t in w for t in targets):
                p = nextprime(p)
                w = str(p)
            while minp in aset:
                minp = nextprime(minp)
            an = p
    print(list(islice(agen(), 54))) # Michael S. Branicky, Apr 15 2025