The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A345667 a(n) is the largest prime substring of A345666(n). 1
2, 5, 7, 11, 17, 19, 23, 29, 41, 43, 47, 53, 59, 61, 71, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 157, 167, 173, 179, 191, 197, 199, 211, 227, 233, 239, 241, 251, 257, 263, 269, 271, 281, 293, 311, 313, 317, 331, 337, 347, 349, 353, 359 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(4) = 11 is the largest prime substring of A345666(4) = 110.
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, s]], {n, 10000}]; lst (* Giorgos Kalogeropoulos, Jun 25 2021 *)
PROG
(Python)
def trojan_composites_records(limit_maxval=None, limit_terms=None, verbose=True):
from sympy import isprime
num = 1
found = []
while (not limit_maxval or not found or found[-1] <= 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(found[-1])) if found else 1, -1):
candidate = max(filter(isprime, {int(string[i:i + length - 1]) for i in range(len(string) - length + 2)}), default=0)
if candidate:
if not found or candidate > found[-1]:
if limit_maxval and candidate > limit_maxval:
if verbose:
print()
return found
found.append(candidate)
if verbose:
print(candidate, end=', ', flush=True)
break
if verbose:
print()
return found
trojan_composites_records(limit_terms=7) # [2, 5, 7, 11, 17, 19, 23]
CROSSREFS
Cf. A002808, A345666. Subset of A047814.
Sequence in context: A309290 A023238 A194991 * A319596 A235480 A049042
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 May 15 04:00 EDT 2024. Contains 372536 sequences. (Running on oeis4.)