# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a279366 Showing 1-1 of 1 %I A279366 #48 Oct 27 2023 18:28:26 %S A279366 89,449,499,4649,4969,6469,6869,6949,8669,8699,8849,9649,9949,44699, %T A279366 46649,48649,48869,49669,64849,84869,86969,88469,94849,94949,98869, %U A279366 99469,444469,444869,446969,466649,468869,469849,469969,494699,496669,496849,498469,644669 %N A279366 Primes whose proper substrings of consecutive digits are all composite. %C A279366 All digits are composite. Each term ends with the digit '9'. Since each term is prime, it never serves as the suffix of any subsequent term; e.g., no term beyond 89 ends with the digits '89', so the only remaining allowed two-digit endings are '49', '69', and '99'; no terms beyond 449 and 499 end with '449' or '499' (and '899' is ruled out because of 89), so the only remaining allowed three-digit endings are '469', '649', '669', '699', '849', '869', '949', '969', and '999' (and each of these appears as the ending of at least one four-digit term, except '999', which doesn't appear as the ending of any term until a(75) = 4696999). - _Jon E. Schoenfield_, Dec 10 2016 %C A279366 Number of terms < 10^k, k=1,2,3,...: 0, 1, 2, 10, 13, 38, 66, 197, 410, 1053, 2542, 7159, 18182, 49388, ..., . _Robert G. Wilson v_, Jan 15 2017 %H A279366 Alois P. Heinz, Table of n, a(n) for n = 1..10000 (first 63 terms from Rodrigo de O. Leite) %e A279366 44699 is in the sequence because 4, 6, 9, 44, 46, 69, 99, 446, 469, 669, 4469 and 4699 are composite numbers. However, 846499 is not included because 4649 is prime. %t A279366 Select[Prime@ Range[5, 10^5], Function[n, Times @@ Boole@ Map[CompositeQ, Flatten@ Map[FromDigits /@ Partition[n, #, 1] &, Range[Length@ n - 1]]] == 1]@ IntegerDigits@ # &] (* _Michael De Vlieger_, Dec 10 2016 *) %t A279366 Select[Flatten[Table[FromDigits/@Tuples[{4,6,8,9},d],{d,6}]],PrimeQ[#]&&AllTrue[ FromDigits /@ Union[Flatten[Table[Partition[IntegerDigits[#],n,1],{n,IntegerLength[#]-1}],1]], CompositeQ]&] (* _Harvey P. Dale_, Jul 15 2023 *) %o A279366 (Python) %o A279366 from sympy import isprime %o A279366 from itertools import count, islice, product %o A279366 def ok(n): %o A279366 s = str(n) %o A279366 if set(s) & {"1", "2", "3", "5", "7"} or not isprime(n): return False %o A279366 ss2 = set(s[i:i+l] for i in range(len(s)-1) for l in range(2, len(s))) %o A279366 return not any(isprime(int(ss)) for ss in ss2) %o A279366 def agen(): %o A279366 for d in count(2): %o A279366 for p in product("4689", repeat=d-1): %o A279366 t = int("".join(p)+"9") %o A279366 if ok(t): yield t %o A279366 print(list(islice(agen(), 38))) # _Michael S. Branicky_, Oct 07 2022 %Y A279366 Subsequence of A051416. %Y A279366 Cf. A033274, A061372, A254754. %K A279366 nonn,base %O A279366 1,1 %A A279366 _Rodrigo de O. Leite_, Dec 10 2016 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE