A366826 Composite numbers whose proper substrings (of their decimal expansions) are all primes.
4, 6, 8, 9, 22, 25, 27, 32, 33, 35, 52, 55, 57, 72, 75, 77, 237, 537, 737
Offset: 1
Examples
237 is included because it is composite and 2, 3, 7, 23 and 37 are all primes. 4 is included because it is composite and has no proper substrings.
Crossrefs
Programs
-
Python
from itertools import combinations from sympy import isprime for n in range(2, 1000): if not isprime(n): properSubstrings = set( int(str(n)[start:end]) for (start, end) in combinations(range(len(str(n)) + 1), 2) ) - set((n,)) if all(isprime(s) for s in properSubstrings): print(n, end=', ')
Comments