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.

A344937 a(n) is the largest k such that when strings of zeros of lengths t = 1..k are inserted between every pair of adjacent digits of prime(n), the resulting numbers are all primes.

This page as a plain text file.
%I A344937 #21 Sep 07 2021 04:13:13
%S A344937 1,1,1,3,0,0,0,1,2,0,0,2,2,1,2,4,0,1,0,2,4,0,0,1,1,2,0,3,0,0,0,1,0,0,
%T A344937 2,0,1,0,0,1,0,1,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,2,0,0,1,0,0,0,1,
%U A344937 0,2,0,1,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0
%N A344937 a(n) is the largest k such that when strings of zeros of lengths t = 1..k are inserted between every pair of adjacent digits of prime(n), the resulting numbers are all primes.
%C A344937 Initially, except for n = 1..4, similar to A290174, but the two sequences differ from n = 28 onwards.
%e A344937 For n = 8: prime(8) = 19 and the numbers 109, 1009 and 10009 are all prime, while 100009 is not. Thus it is possible to insert strings of zeros of lengths 1, 2 and 3 between all adjacent digits of 19 such that the resulting number is prime. Since 3 is the largest length of such a string in case of 19, a(8) = 3.
%t A344937 Table[k=0;While[PrimeQ@FromDigits@Flatten@Riffle[IntegerDigits@Prime@n,{Table[0,k]}],k++];k-1,{n,5,100}] (* _Giorgos Kalogeropoulos_, Jun 03 2021 *)
%o A344937 (PARI) eva(n) = subst(Pol(n), x, 10)
%o A344937 insert_zeros(num, len) = my(d=digits(num), v=[]); for(k=1, #d-1, v=concat(v, concat([d[k]], vector(len)))); v=concat(v, d[#d]); eva(v)
%o A344937 a(n) = my(p=prime(n), ip=p); for(k=1, oo, ip=insert_zeros(p, k); if(!ispseudoprime(ip), return(k-1)))
%o A344937 (Python)
%o A344937 from sympy import isprime, prime
%o A344937 def insert_zeros(n, k): return int(("0"*k).join(list(str(n))))
%o A344937 def a(n):
%o A344937   pn, k = prime(n), 1
%o A344937   while isprime(insert_zeros(pn, k)): k += 1
%o A344937   return k - 1
%o A344937 print([a(n) for n in range(5, 92)]) # _Michael S. Branicky_, Jun 03 2021
%Y A344937 Cf. A290174, A344637, A344936.
%K A344937 nonn,base
%O A344937 5,4
%A A344937 _Felix Fröhlich_, Jun 03 2021