OFFSET
1,2
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..12288 (rows 1..5000 of the triangle, flattened).
EXAMPLE
Triangle T(n, k) begins:
1: [1]
2: [2]
3: [3]
4: [4]
5: [5]
6: [6]
7: [7]
8: [8]
9: [9]
10: [1, 10]
11: [1, 11]
12: [1, 2, 12]
13: [1, 13]
14: [1, 14]
15: [1, 5, 15]
16: [1, 16]
MATHEMATICA
Table[Select[Divisors[n], StringContainsQ[IntegerString[n], IntegerString[#]] &], {n, 50}] (* Paolo Xausa, Jul 23 2024 *)
PROG
(PARI) row(n, base=10) = { my (d=digits(n, base), s=setbinop((i, j) -> fromdigits(d[i..j], base), [1..#d]), v=0); select(v -> v && n%v==0, s) }
(Python)
from sympy import divisors
def row(n):
s = str(n)
return sorted(d for d in divisors(n, generator=True) if str(d) in s)
def table(r): return [i for n in range(1, r+1) for i in row(n)]
print(table(44)) # Michael S. Branicky, Jul 11 2022
CROSSREFS
KEYWORD
nonn,base,tabf
AUTHOR
Rémy Sigrist, Jul 11 2022
STATUS
approved