login
A387963
Fixed points of A387819.
3
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 113, 131, 137, 173, 179, 197, 311, 313, 317, 319, 373, 379, 419, 431, 437, 473, 479, 611, 613, 617, 619, 671, 673, 713, 719, 731, 737, 797, 971, 979, 1313, 1319, 1373
OFFSET
1,2
COMMENTS
The substring may not start with digit 0.
Also, a generalization of the condition in A131648 to every multi-digit substring is prime with respect to 2, 3, 5, 7.
Sequence is finite with a(104) = 67379 the final term.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..104
FORMULA
{n | A387819(n) = n}.
EXAMPLE
113 is a term because all its substrings of length greater than 1 are prime numbers.
PROG
(Python)
def children2357(s):
return set(int(s[:i]+str(q//d)+s[j:]) for i in range(len(s)-1) for j in range(i+2, len(s)+1) if (w:=s[i:j])[0]!='0' for d in [2, 3, 5, 7] if (q:=int(w))%d==0)
def ok(n): return n > 10 and len(children2357(str(n))) == 0
print([k for k in range(1, 10**5) if ok(k)])
CROSSREFS
Sequence in context: A072227 A122427 A161597 * A320320 A263364 A296242
KEYWORD
nonn,base,fini,full
AUTHOR
Michael S. Branicky and Ali Sada, Oct 12 2025
STATUS
approved