OFFSET
1,1
COMMENTS
As no leading zeros are allowed, all terms are zeroless.
From Michael S. Branicky, Jun 27 2025: (Start)
Finite since each term with first digit removed must be a member of A024785, which is finite.
Last term here is a(7407) = 6357686312646216567629137. (End)
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..7407
EXAMPLE
637 is a term because when it is split in two in all possible ways, it first results in 63, a nonprime, and 3, a prime. When split in the second and final possible way, it results in 6, a nonprime, and 37, a prime.
MATHEMATICA
q[n_] := !MemberQ[IntegerDigits[n], 0] && AllTrue[Range[IntegerLength[n]-1], PrimeQ[QuotientRemainder[n, 10^#]] == {False, True} &]; Select[Range[10, 1000], q] (* Amiram Eldar, Jun 27 2025 *)
PROG
(Python)
from sympy import isprime
def ok(n): return '0' not in (s:=str(n)) and len(s) > 1 and all(not isprime(int(s[:i])) and isprime(int(s[i:])) for i in range(1, len(s)))
print([k for k in range(1000) if ok(k)]) # Michael S. Branicky, Jun 27 2025
(Python) # uses import and function ok above
from itertools import count, islice, product
def agen(): # generator of terms
tp = list("23579") # set of left-truncatable primes
for d in count(2):
tpnew = []
for f in "123456789":
for e in tp:
if isprime(int(s:=f+e)):
tpnew.append(s)
if ok(t:=int(f+e)):
yield t
tp = tpnew
if len(tp) == 0:
return
afull = list(agen())
print(afull[:60]) # Michael S. Branicky, Jun 27 2025
CROSSREFS
KEYWORD
nonn,base,fini,full
AUTHOR
Tamas Sandor Nagy, Jun 27 2025
STATUS
approved
