cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A345667 a(n) is the largest prime substring of A345666(n).

This page as a plain text file.
%I A345667 #29 Jul 30 2021 09:18:32
%S A345667 2,5,7,11,17,19,23,29,41,43,47,53,59,61,71,83,89,97,101,103,107,109,
%T A345667 113,127,131,137,139,149,157,167,173,179,191,197,199,211,227,233,239,
%U A345667 241,251,257,263,269,271,281,293,311,313,317,331,337,347,349,353,359
%N A345667 a(n) is the largest prime substring of A345666(n).
%e A345667 a(4) = 11 is the largest prime substring of A345666(4) = 110.
%t A345667 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 *)
%o A345667 (Python)
%o A345667 def trojan_composites_records(limit_maxval=None, limit_terms=None, verbose=True):
%o A345667     from sympy import isprime
%o A345667     num = 1
%o A345667     found = []
%o A345667     while (not limit_maxval or not found or found[-1] <= limit_maxval) and (not limit_terms or len(found) < limit_terms):
%o A345667         num += 1
%o A345667         if not isprime(num):
%o A345667             string = str(num)
%o A345667             for length in range(len(string), len(str(found[-1])) if found else 1, -1):
%o A345667                 candidate = max(filter(isprime, {int(string[i:i + length - 1]) for i in range(len(string) - length + 2)}), default=0)
%o A345667                 if candidate:
%o A345667                     if not found or candidate > found[-1]:
%o A345667                         if limit_maxval and candidate > limit_maxval:
%o A345667                             if verbose:
%o A345667                                 print()
%o A345667                             return found
%o A345667                         found.append(candidate)
%o A345667                         if verbose:
%o A345667                             print(candidate, end=', ', flush=True)
%o A345667                 break
%o A345667     if verbose:
%o A345667         print()
%o A345667     return found
%o A345667 trojan_composites_records(limit_terms=7) # [2, 5, 7, 11, 17, 19, 23]
%Y A345667 Cf. A002808, A345666. Subset of A047814.
%K A345667 nonn,base
%O A345667 1,1
%A A345667 _Eyal Gruss_, Jun 21 2021