OFFSET
1,1
COMMENTS
The primes to insert are 2 (in front) or 5, 7, 11, 13, ... after the number's first, second, third, ... digit. So there cannot be any 1 digit solution because if 5 is appended this cannot yield a prime. One can show that the terms cannot have more than 21 digits.
The prime 3 is excluded from the strings to insert, because else no term could have more than 2 digits: to be prime with 2 prefixed or with 3 inserted, the number must be congruent to 2 (mod 3), so it cannot be prime with 7 appended or inserted. See also the Rivera link and A304244.
LINKS
Carlos Rivera, Puzzle 791. Interesting consecutive primes, The Prime Puzzles & Problems Connection.
EXAMPLE
a(1) = 27 because 2|27 = 227, 2|5|7 = 257 and 27|7 = 277 are all prime.
Similarly for a(6) = 333, because 2333, 3533, 3373 and 33311 are all prime.
PROG
(PARI) is(n, L=logint(n+!n, 10)+1, d, p, P)={isprime(n+2*10^L) && !for(k=1, L, isprime((d=divrem(n, P=10^(L-k)))[2]+(10^logint(10*p=prime(2+k), 10)*d[1]+p)*P)|| return)}
CROSSREFS
Cf. A304244 (prime(k) is inserted after the k-th digit), A304245 (2 is inserted after the first digit, or prime(k+1) is inserted after the k-th digit for k > 1).
Cf. A068679 (1 is prefixed, appended or inserted anywhere), A069246 (primes among these), A068673 (1 is prefixed, or appended).
Cf. A069832 (7 is prefixed, appended or inserted anywhere), A215420 (primes among these), A068677 (7 is prefixed or appended).
Cf. A158232 (13 is prefixed or appended).
KEYWORD
nonn,base,fini
AUTHOR
M. F. Hasler, May 10 2018
STATUS
approved