OFFSET
1,1
COMMENTS
Only numbers > 10000 are considered, since all 4-digit primes are trivial members.
By definition, each term of the sequence with more than 5 digits is built up by an overlapped union of previous terms, i.e., a(254)=182339 has the two embedded previous terms a(26)=18233 and a(208)=82339.
The sequence is finite, the last term is 934919 (n=263). Proof of finiteness: Let p be a number with more than 6 digits. By the argument above, each 6-digit substring must be a previous term. The only 6-digit terms are 182339, 349199, 432713, 487793, 511933, 654799, 782339, 787793, 917333, 934919 (n=254..263, see b-file). As can be directly verified, none of them can be extended to a 7-digit number with the desired property.
LINKS
Hieronymus Fischer, Table of n, a(n) for n = 1..263
EXAMPLE
a(1)=11093, since all substrings of length >= 4 are primes (1109, 1093, and 11093).
a(263)=934919, all substrings of length >= 4 (9349, 3491, 4919, 93491, 34919 and 934919) are primes.
MATHEMATICA
sspQ[n_]:=Module[{idn=IntegerDigits[n], s1, s2}, s1=FromDigits[Most[idn]]; s2=FromDigits[Rest[idn]]; IntegerLength[s1]==IntegerLength[s2]==4 && AllTrue[{s1, s2}, PrimeQ]]; Select[Prime[Range[1230, 9592]], sspQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* The program generates all 253 five-digit terms of the sequence *)(* Harvey P. Dale, May 11 2018 *)
CROSSREFS
KEYWORD
nonn,fini,base
AUTHOR
Hieronymus Fischer, Jun 08 2012
STATUS
approved