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!)
A345666 Composite numbers whose largest prime substring is greater than the record of all previous terms. 1
12, 15, 27, 110, 117, 119, 123, 129, 141, 143, 147, 153, 159, 161, 171, 183, 189, 297, 1010, 1030, 1070, 1090, 1113, 1127, 1131, 1137, 1139, 1149, 1157, 1167, 1173, 1179, 1191, 1197, 1199, 1211, 1227, 1233, 1239, 1241, 1251, 1257, 1263, 1269, 1271, 1281, 1293 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(1)=12 is the first composite containing a prime substring. Its largest prime substring is A345667(1)=2. It is the first nonzero composite index of A047814.
MATHEMATICA
lst={}; max=m=0; Do[If[!PrimeQ@n, If[IntegerQ[s=Max@Select[FromDigits/@Subsequences@IntegerDigits@n, PrimeQ]], m=s]]; If[m>max, max=m; AppendTo[lst, n]], {n, 10000}]; lst (* Giorgos Kalogeropoulos, Jun 25 2021 *)
PROG
(Python)
def trojan_composites(limit_maxval=None, limit_terms=None, verbose=True):
from sympy import isprime
num = 1
best = 0
found = []
while (not limit_maxval or num <= limit_maxval) and (not limit_terms or len(found) < limit_terms):
num += 1
if not isprime(num):
string = str(num)
for length in range(len(string), len(str(best)), -1):
candidate = max(filter(isprime, {int(string[i:i + length - 1]) for i in range(len(string) - length + 2)}), default=0)
if candidate:
if candidate > best:
best = candidate
found.append(num)
if verbose:
print(num, end=', ', flush=True)
break
if verbose:
print()
return found
trojan_composites(limit_terms=7) #[12, 15, 27, 110, 117, 119, 123]
CROSSREFS
Cf. A002808, A047814, A345667 (corresponding prime substrings).
Sequence in context: A357867 A350807 A124521 * A369005 A134221 A179148
KEYWORD
nonn,base
AUTHOR
Eyal Gruss, Jun 21 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 April 23 22:36 EDT 2024. Contains 371917 sequences. (Running on oeis4.)