|
|
A052056
|
|
Numbers k such that k! starts with its largest prime substring.
|
|
1
|
|
|
2, 4, 6, 7, 9, 10, 15, 16, 20, 21, 23, 25, 30, 35, 43, 78, 102, 105, 132, 138, 151, 189, 202, 215, 219, 233, 241, 264, 320, 334, 349, 352, 367, 386, 433, 458, 520, 583, 779, 885, 905, 1068, 1078, 1131, 1149, 1198, 1271, 1276, 1314, 1503, 1623, 1646, 1903, 1962, 2053
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|