OFFSET
1,1
COMMENTS
For all terms: substrings of length 3 correspond to one of the first 21 terms of A069489. - Reinhard Zumkeller, Jun 08 2015
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..100
EXAMPLE
11317 is a term as the substrings of length 2, i.e., 11, 13, 31, 17 and the three substrings of length 3, i.e., 113, 131 and 317 are all prime.
MATHEMATICA
Do[ If[ Union[ PrimeQ[ Map[ FromDigits, Partition[ IntegerDigits[ Prime[n]], 2, 1]]]] == Union[ PrimeQ[ Map[ FromDigits, Partition[ IntegerDigits[ Prime[n]], 3, 1]]]] == {True}, Print[ Prime[n]]], {n, PrimePi[1000] + 1, 10^5}]
Select[Prime[Range[169, 226000]], AllTrue[FromDigits/@Flatten[Table[ Partition[ IntegerDigits[ #], k, 1], {k, {2, 3}}], 1], PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 02 2021 *)
PROG
(Haskell)
import Data.Set (fromList, deleteFindMin, union)
a069490 n = a069490_list !! (n-1)
a069490_list = f $ fromList [1..9] where
f s | m < 1000 = f s''
| h m && a010051' m == 1 = m : f s''
| otherwise = f s''
where s'' = union s' $ fromList $ map (+ (m * 10)) [1, 3, 7, 9]
(m, s') = deleteFindMin s
h x = x < 100 && a010051' x == 1 ||
a010051' (x `mod` 1000) == 1 &&
a010051' (x `mod` 100) == 1 && h (x `div` 10)
-- Reinhard Zumkeller, Jun 08 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Mar 30 2002
EXTENSIONS
Edited, corrected and extended by Robert G. Wilson v, Apr 12 2002
STATUS
approved