login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A345906 Numbers with at least 4 digits such that any 3-digit substring forms a prime number. 0
1011, 1013, 1017, 1019, 1031, 1037, 1071, 1073, 1079, 1097, 1131, 1137, 1139, 1271, 1277, 1311, 1313, 1317, 1373, 1379, 1397, 1491, 1499, 1571, 1577, 1631, 1673, 1677, 1733, 1739, 1797, 1811, 1911, 1919, 1937, 1971, 1977, 1991, 1997, 2113, 2233, 2239, 2271, 2277, 2293 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Only numbers greater than 1000 are considered, since all 3-digit primes are trivial members.
A211684 is a similar sequence that doesn't allow leading zeros in substrings.
LINKS
EXAMPLE
1011 belongs to the sequence as both 101 and 011=11 are primes.
MAPLE
q:= n-> (s-> andmap(isprime@parse, [seq(s[j-2..j], j=3..length(s))]))(""||n):
select(q, [$1000..2300])[]; # Alois P. Heinz, Jun 29 2021
MATHEMATICA
Select[Range[1000, 3000], PrimeQ[FromDigits[Take[IntegerDigits[#], -3]]] && PrimeQ[FromDigits[Take[IntegerDigits[#], 3]]] &]
PROG
(Python)
from sympy import isprime
def ok(n):
if n <= 1000: return False
s = str(n)
return all(isprime(int(s[i:i+3])) for i in range(len(s)-2))
print(list(filter(ok, range(1001, 2300)))) # Michael S. Branicky, Jun 29 2021
CROSSREFS
Sequence in context: A235775 A262865 A213315 * A035125 A183849 A185881
KEYWORD
nonn,base
AUTHOR
Tanya Khovanova, Jun 29 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 1 05:26 EST 2024. Contains 370430 sequences. (Running on oeis4.)