OFFSET
1,1
LINKS
Michael S. Branicky, Python program
EXAMPLE
16 is a term because 16! = {209227}89888000 and its largest prime substring 209227 starts from the left.
PROG
(Python)
from sympy import isprime
def starts_with_lps(n): # see link for faster version
s = str(n)
ss = (s[i:j] for i in range(len(s)) for j in range(i+1, len(s)+1))
lps = max((u for u in (int(t) for t in ss) if isprime(u)), default=0)
return lps > 0 and s.startswith(str(lps))
def afind():
k, fk = 1, 1
while True:
if starts_with_lps(fk):
print(k, end=", ")
k += 1
fk *= k
afind() # Michael S. Branicky, Dec 31 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Jan 15 2000
EXTENSIONS
More terms from Sean A. Irvine, Feb 16 2011
Offset changed to 1 by Jon E. Schoenfield, Oct 17 2019
a(38)-a(49) from Michael S. Branicky, Dec 31 2021
a(50)-a(55) from Michael S. Branicky, May 31 2023
STATUS
approved