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.

A379354 Beginning with 3, least prime such that concatenation of first n terms is prime.

Original entry on oeis.org

3, 7, 3, 3, 7, 29, 43, 11, 61, 71, 19, 191, 43, 53, 7, 239, 31, 173, 43, 137, 79, 53, 13, 557, 619, 47, 271, 797, 463, 83, 211, 467, 229, 131, 199, 359, 1249, 887, 853, 641, 109, 257, 1153, 1031, 613, 953, 607, 641, 499, 359, 1297, 1031, 2137, 401, 283, 29, 1321, 1499, 547, 83, 397, 2153, 1759, 1277
Offset: 1

Views

Author

J.W.L. (Jan) Eerland, Dec 21 2024

Keywords

Crossrefs

Programs

  • Mathematica
    w = {3};
    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, 57}];
    w
  • Python
    from itertools import count, islice
    from gmpy2 import digits, is_prime, mpz, next_prime
    def agen(): # generator of terms
        s, an = "", 3
        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(), 57))) # Michael S. Branicky, Dec 21 2024