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 A297961 #50 Apr 11 2021 11:59:49 %S A297961 4,11,20,53,51,100,63,76,42,43,20,13,4,4,1 %N A297961 a(1) = number of 1-digit primes (that is, 4: 2,3,5,7); then a(n) = number of distinct n-digit prime numbers obtained by alternately left- and right-concatenating a digit to the a(n-1) primes obtained in the previous iteration. %C A297961 No 16-digit numbers can be obtained from the 15-digit number 889292677731979. %H A297961 Prime Curios, <a href="https://primes.utm.edu/curios/page.php/889292677731979.html">889292677731979</a> %e A297961 1-digit 2-digit 3-digit 4-digit ... 15-digit %e A297961 --------------------------------------------------------------- %e A297961 2 %e A297961 3 13 131 2131 %e A297961 6131 %e A297961 137 2137 %e A297961 3137 %e A297961 9137 %e A297961 139 4139 %e A297961 23 233 5233 %e A297961 8233 %e A297961 239 2239 %e A297961 9239 %e A297961 43 431 5431 %e A297961 8431 %e A297961 9431 %e A297961 433 1433 %e A297961 3433 %e A297961 7433 %e A297961 9433 %e A297961 439 1439 %e A297961 9439 %e A297961 53 %e A297961 73 733 1733 %e A297961 3733 %e A297961 4733 %e A297961 6733 %e A297961 9733 %e A297961 739 3739 %e A297961 9739 %e A297961 83 839 5839 %e A297961 8839 %e A297961 9839 %e A297961 5 %e A297961 7 17 173 6173 %e A297961 9173 %e A297961 179 2179 %e A297961 5179 %e A297961 8179 %e A297961 37 373 1373 %e A297961 3373 %e A297961 4373 %e A297961 6373 %e A297961 379 6379 %e A297961 47 479 5479 %e A297961 9479 %e A297961 67 673 3673 %e A297961 4673 %e A297961 6673 %e A297961 7673 %e A297961 677 2677 889292677731979 %e A297961 3677 %e A297961 8677 %e A297961 9677 %e A297961 97 971 2971 %e A297961 6971 %e A297961 8971 %e A297961 977 6977 %e A297961 --------------------------------------------------------------- %e A297961 a(1) = 4, a(2) = 11, a(3) = 20, a(4) = 53, ..., a(15)= 1. %t A297961 Block[{b = 10, t}, t = Select[Range[b], CoprimeQ[#, b] &]; TakeWhile[Length /@ Fold[Function[{a, n}, Append[a, If[EvenQ[n], Join @@ Map[Function[k, Select[Map[Prepend[k, #] &, Range[9]], PrimeQ@ FromDigits[#, b] &]], Last[a]], Join @@ Map[Function[k, Select[Map[Append[k, #] &, t], PrimeQ@ FromDigits[#, b] &]], Last[a]]]]] @@ {#1, #2} &, {IntegerDigits[Prime@ Range@ PrimePi@ b, b]}, Range[2, 16]], # > 0 &]] (* _Michael De Vlieger_, Jan 20 2018 *) %o A297961 (Python) %o A297961 from sympy import isprime %o A297961 def alst(): %o A297961 primes, alst = [2, 3, 5, 7], [] %o A297961 while len(primes) > 0: %o A297961 alst.append(len(primes)) %o A297961 if len(alst)%2 == 1: %o A297961 candidates = set(int(d+str(p)) for p in primes for d in "123456789") %o A297961 else: %o A297961 candidates = set(int(str(p)+d) for p in primes for d in "1379") %o A297961 primes = [c for c in candidates if isprime(c)] %o A297961 return alst %o A297961 print(alst()) # _Michael S. Branicky_, Apr 11 2021 %Y A297961 Cf. A050986, A050987, A297960, A298048. %K A297961 nonn,full,base,fini %O A297961 1,1 %A A297961 _Seiichi Manyama_, Jan 09 2018