login
A355634
Irregular triangle T(n, k), n > 0, k = 1..A093640(n), read by rows; the n-th row contains in ascending order the divisors of n whose binary expansions appear as substrings in the binary expansion of n.
3
1, 1, 2, 1, 3, 1, 2, 4, 1, 5, 1, 2, 3, 6, 1, 7, 1, 2, 4, 8, 1, 9, 1, 2, 5, 10, 1, 11, 1, 2, 3, 4, 6, 12, 1, 13, 1, 2, 7, 14, 1, 3, 15, 1, 2, 4, 8, 16, 1, 17, 1, 2, 9, 18, 1, 19, 1, 2, 4, 5, 10, 20, 1, 21, 1, 2, 11, 22, 1, 23, 1, 2, 3, 4, 6, 8, 12, 24, 1, 25
OFFSET
1,3
FORMULA
T(n, 1) = 1.
T(n, A093640(n)) = n.
Sum_{k = 1..A093640(n)} T(n, k) = A355633(n).
EXAMPLE
Triangle T(n, k) begins:
1: [1]
2: [1, 2]
3: [1, 3]
4: [1, 2, 4]
5: [1, 5]
6: [1, 2, 3, 6]
7: [1, 7]
8: [1, 2, 4, 8]
9: [1, 9]
10: [1, 2, 5, 10]
11: [1, 11]
12: [1, 2, 3, 4, 6, 12]
13: [1, 13]
14: [1, 2, 7, 14]
15: [1, 3, 15]
16: [1, 2, 4, 8, 16]
MATHEMATICA
Table[Select[Divisors[n], StringContainsQ[IntegerString[n, 2], IntegerString[#, 2]] &], {n, 50}] (* Paolo Xausa, Jul 23 2024 *)
PROG
(PARI) row(n, base=2) = { 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 = bin(n)[2:]
return sorted(d for d in divisors(n, generator=True) if bin(d)[2:] in s)
def table(r): return [i for n in range(1, r+1) for i in row(n)]
print(table(25)) # Michael S. Branicky, Jul 11 2022
CROSSREFS
Cf. A027750, A093640 (row lengths), A355632 (decimal analog), A355633 (row sums).
Sequence in context: A275055 A254679 A343651 * A275280 A319845 A319847
KEYWORD
nonn,base,tabf
AUTHOR
Rémy Sigrist, Jul 11 2022
STATUS
approved