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.
%I A167416 #27 Dec 05 2021 05:38:03 %S A167416 2,23,523,2357,112573,11132357,1113257317,111317193257,11131719223357, %T A167416 0,111317192232935317,11131719223293157373,1113171922329313377541, %U A167416 111317192232931337415743,11131719223293133741474357 %N A167416 Smallest prime concatenation of the first n primes, or 0 if no such prime exists. %C A167416 a(10) doesn't exist, because the sum of digits of the first 10 primes (2+3+5+7+(1+1)+(1+3)+(1+7)+(1+9)+(2+3)+(2+9)) = 57 is a multiple of 3. %D A167416 Richard E. Crandall and Carl Pomerance, Prime Numbers, Springer 2005. %D A167416 Paulo Ribenboim, The New Book of Prime Number Records, Springer 1996. %D A167416 A. Weil, Number theory: an approach through history, Birkhäuser 1984. %e A167416 The only prime concatenations of the first n primes for n = 1..3 are a(1)=2, a(2)=23, and a(3)=523. %e A167416 For n=4, the only prime concatenations of 2, 3, 5, and 7 are 2357, 2753, 3257, 3527, 5237, 5273, 7253, 7523; the smallest of these is a(4) = 2357. %o A167416 (Python) %o A167416 from sympy import sieve, isprime %o A167416 from itertools import permutations %o A167416 for n in range(1, 20): %o A167416 sieve.extend_to_no(n) %o A167416 p = list(map(str, list(sieve._list)))[:n] %o A167416 mint = 10**1000 %o A167416 for i in permutations(p, len(p)): %o A167416 t = int(''.join(i)) %o A167416 if t < mint and isprime(t): %o A167416 mint = t %o A167416 if mint == 10**1000: %o A167416 print(0, end = ', ') %o A167416 else: %o A167416 print(mint, end = ', ') # _Gleb Ivanov_, Dec 04 2021 %Y A167416 Cf. A175429, A177275, A134966, A167417. %K A167416 nonn,base %O A167416 1,1 %A A167416 Eva-Maria Zschorn (e-m.zschorn(AT)zaschendorf.km3.de), Nov 03 2009 %E A167416 Keyword:full added by _R. J. Mathar_, Nov 11 2009 %E A167416 Edited by _Charles R Greathouse IV_, Apr 28 2010 %E A167416 Several terms corrected and a(11)-a(15) from _Gleb Ivanov_, Dec 04 2021