A344637 a(n) is the smallest k > 0 such that the number that results from inserting a string of k zeros between all adjacent digits of prime(n) is also prime, or 0 if no such k exists.
1, 1, 1, 1, 2, 4, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 3, 1, 30, 1, 1
Offset: 5
Examples
For n = 10: prime(10) = 29 and 200009 is the smallest prime obtained by inserting a string of zeros between all adjacent digits, so a(10) = 4.
Programs
-
PARI
eva(n) = subst(Pol(n), x, 10) 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) a(n) = my(p=prime(n)); for(k=1, oo, if(ispseudoprime(insert_zeros(p, k)), return(k)))
Comments