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.

This page as a plain text file.
%I A379354 #21 Jan 03 2025 01:35:10
%S A379354 3,7,3,3,7,29,43,11,61,71,19,191,43,53,7,239,31,173,43,137,79,53,13,
%T A379354 557,619,47,271,797,463,83,211,467,229,131,199,359,1249,887,853,641,
%U A379354 109,257,1153,1031,613,953,607,641,499,359,1297,1031,2137,401,283,29,1321,1499,547,83,397,2153,1759,1277
%N A379354 Beginning with 3, least prime such that concatenation of first n terms is prime.
%H A379354 Michael S. Branicky, <a href="/A379354/b379354.txt">Table of n, a(n) for n = 1..1000</a>
%t A379354 w = {3};
%t A379354 Do[k = 1;
%t A379354   q = Monitor[
%t A379354     Parallelize[
%t A379354      While[True,
%t A379354       If[PrimeQ[FromDigits[
%t A379354           Join @@ IntegerDigits /@ Append[w, Prime[k]]]], Break[]]; k++];
%t A379354      Prime[k]], k];
%t A379354   w = Append[w, q], {i, 2, 57}];
%t A379354 w
%o A379354 (Python)
%o A379354 from itertools import count, islice
%o A379354 from gmpy2 import digits, is_prime, mpz, next_prime
%o A379354 def agen(): # generator of terms
%o A379354     s, an = "", 3
%o A379354     while True:
%o A379354         yield int(an)
%o A379354         s += digits(an)
%o A379354         p = 3
%o A379354         while not is_prime(mpz(s+digits(p))): p = next_prime(p)
%o A379354         an = p
%o A379354 print(list(islice(agen(), 57))) # _Michael S. Branicky_, Dec 21 2024
%Y A379354 Cf. A111382, A111383, A113584, A379355.
%K A379354 base,nonn
%O A379354 1,1
%A A379354 _J.W.L. (Jan) Eerland_, Dec 21 2024