login
A367745
Numbers which occur anywhere in A367795, i.e. in lists L(k) where L(1) = [1,0] and L(k+1) is obtained from L(k) by inserting their binary concatenation between elements x,y.
2
0, 1, 2, 4, 6, 8, 14, 16, 20, 26, 30, 32, 62, 64, 72, 84, 106, 118, 126, 128, 164, 218, 254, 256, 272, 340, 426, 494, 510, 512, 584, 950, 1022, 1024, 1056, 1160, 1316, 1364, 1706, 1754, 1910, 2014, 2046, 2048, 2708, 3434, 4094, 4096, 4160, 4368, 4680, 5284, 5460, 6826, 7002, 7606, 7918, 8126, 8190
OFFSET
1,3
COMMENTS
0 is considered to be a 1-bit-long number and has 0 for binary expansion.
Empirically, there are A000010(n) positive terms with n binary digits. - Rémy Sigrist, Jan 01 2024
EXAMPLE
The L(k) lists written in binary begin:
L(1) = [1, 0]
L(2) = [1, 10, 0] -- 10 inserted between 1 and 0
L(3) = [1, 110, 10, 100, 0] -- 110 inserted between 1 and 10, 100 between 10 and 0
L(4) = [1, 1110, 110, 11010, 10, 10100, 100, 1000, 0] -- etc.
0, 1, 10, 100, 110, 1000, ... are producible binary expansions, so the corresponding numbers (0, 1, 2, 4, 6, 8, ...) are in this sequence.
PROG
(PARI)
sz(n)=if(n==0, 1, logint(n, 2)+1)
L(n)=if(n==1, List([1, 0]), my(LL=L(n-1), k=#LL); while(k>1, listinsert(LL, (LL[k-1] << sz(LL[k])) + LL[k], k); k--); LL)
list_a(depth)=my(aa=vecsort(L(depth)), i=1, j=2^depth); while(i<=#aa&&aa[i]<j, print1(aa[i], ", "); i++)
list_a(15)
(PARI) explore(w, p, s) = { my (ps=concat(p, s)); if (#ps <= w, if (nb++ > #vv, vv=concat(vv, vector(#vv))); vv[nb]=fromdigits(ps, 2); explore(w, p, ps); explore(w, ps, s); ); }
list_a(w) = { nb = 2; vv = [1, 0]; explore(w, [1], [0]); Set(vv[1..nb]); } \\ terms < 2^w; Rémy Sigrist, Jan 01 2024
(Python)
from itertools import chain, count, islice, zip_longest
def agen(): # generator of terms
L = ["1", "0"]
for k in count(1):
yield from sorted(int(t, 2) for t in L if len(t) == k)
Lnew = [s+t for s, t in zip(L[:-1], L[1:])]
L = [t for t in chain(*zip_longest(L, Lnew)) if t is not None]
print(list(islice(agen(), 60))) # Michael S. Branicky, Nov 30 2023
CROSSREFS
Cf. A000010, A367795 (the triangle of L(k) lists).
Sequence in context: A152973 A089747 A274170 * A173144 A356702 A005250
KEYWORD
nonn,base
AUTHOR
Luc Rousseau, Nov 29 2023
STATUS
approved