OFFSET
1,1
COMMENTS
The prime itself and its prime digits are counted among the prime substrings.
LINKS
C. Caldwell, G.L. Honaker (Editors), Prime curios!: 13151715131, by M. F. Hasler, Nov. 2009.
EXAMPLE
The prime 13151715131 is in the sequence since it is palindromic, of length 11, and contains the following 17 > 11*3/2 distinct primes as substrings: 3, 5, 7, 13, 17, 31, 71, 131, 151, 5171, 7151, 13151, 15131, 31517, 517151, 1315171513 and 13151715131.
PROG
(PARI) prime_substrings(p) = { p=Vec(Str(p)); select( x->isprime(x), vecsort( concat( vector( #p, i, vector( i, j, eval( concat( vecextract( p, Str(j".."i))))))), 8))} /* Note: In PARI version 2.4.2 (dvt CHANGES-1.1971), the syntax is select(L, f) instead of select(f, L). */
{forprime( p=2, default(primelimit), p==eval(concat(vecextract(Vec(Str(p)), "-1..1")))|next; #prime_substrings(p) > #Str(p)*3\2 & print1(p", "))}
CROSSREFS
KEYWORD
base,nonn
AUTHOR
M. F. Hasler, Nov 23 2009
STATUS
approved