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.

A380010 Beginning with 7, least prime such that concatenation of the first n terms is prime.

Original entry on oeis.org

7, 3, 3, 3, 31, 23, 13, 3, 167, 13, 137, 3, 73, 383, 499, 431, 13, 101, 61, 47, 67, 101, 13, 83, 1237, 107, 97, 467, 499, 677, 1423, 353, 73, 431, 331, 683, 487, 2141, 3, 1753, 1787, 31, 443, 139, 653, 1327, 17, 919, 173, 2851, 137, 547, 557, 5167, 347, 7867, 839, 19, 179, 19
Offset: 1

Views

Author

J.W.L. (Jan) Eerland, Jan 09 2025

Keywords

Crossrefs

Programs

  • Mathematica
    w={7};Do[k=1;q=Monitor[Parallelize[While[True,If[PrimeQ[FromDigits[Join@@IntegerDigits/@Append[w,Prime[k]]]],Break[]];k++];Prime[k]],k];w=Append[w,q],{i,2,50}];w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, an = "", 7
        while True:
            yield int(an)
            s += digits(an)
            p = 3
            while not is_prime(mpz(s+digits(p))): p = next_prime(p)
            an = p
    print(list(islice(agen(), 50))) # after Michael S. Branicky in A379354