
EXAMPLE

Start from the 4 singledigit primes 2,3,5,7. Construct all 2digit primes with prime digits (to get the first 8 elements of A019546). Add the 4digit primes obtained by concatenation of the previous 2digit primes.


MATHEMATICA

a={2, 3, 5, 7} (* two digits primes*) b=Delete[Union[Flatten[Table[If[PrimeQ[a[[n]]*10+a[[m]]]==True, a[[n]]*10+a[[m]], 0], {n, 1, 4}, {m, 1, 4}], 1]], 1] (* only one four digit prime combination exists*) c=Delete[Union[Flatten[Table[If[PrimeQ[b[[n]]*100+b[[m]]]==True, b[[n]]*100+b[[m]], 0], {n, 1, 4}, {m, 1, 4}], 1]], 1] (* no eight digit prime of this type exists*) d=If[PrimeQ[c[[1]]*10000+c[[1]]]==True, c[[1]]*100+c[[1]], 0] Join[a, b, c]
