login
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

%I #25 Jan 19 2024 21:36:26

%S 0,1,2,4,6,8,14,16,20,26,30,32,62,64,72,84,106,118,126,128,164,218,

%T 254,256,272,340,426,494,510,512,584,950,1022,1024,1056,1160,1316,

%U 1364,1706,1754,1910,2014,2046,2048,2708,3434,4094,4096,4160,4368,4680,5284,5460,6826,7002,7606,7918,8126,8190

%N 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.

%C 0 is considered to be a 1-bit-long number and has 0 for binary expansion.

%C Empirically, there are A000010(n) positive terms with n binary digits. - _Rémy Sigrist_, Jan 01 2024

%H Rémy Sigrist, <a href="/A367745/a367745.png">Binary plot of the terms < 2^64</a>

%e The L(k) lists written in binary begin:

%e L(1) = [1, 0]

%e L(2) = [1, 10, 0] -- 10 inserted between 1 and 0

%e L(3) = [1, 110, 10, 100, 0] -- 110 inserted between 1 and 10, 100 between 10 and 0

%e L(4) = [1, 1110, 110, 11010, 10, 10100, 100, 1000, 0] -- etc.

%e 0, 1, 10, 100, 110, 1000, ... are producible binary expansions, so the corresponding numbers (0, 1, 2, 4, 6, 8, ...) are in this sequence.

%o (PARI)

%o sz(n)=if(n==0,1,logint(n,2)+1)

%o 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)

%o list_a(depth)=my(aa=vecsort(L(depth)), i=1, j=2^depth); while(i<=#aa&&aa[i]<j, print1(aa[i], ", "); i++)

%o list_a(15)

%o (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);); }

%o 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

%o (Python)

%o from itertools import chain, count, islice, zip_longest

%o def agen(): # generator of terms

%o L = ["1", "0"]

%o for k in count(1):

%o yield from sorted(int(t, 2) for t in L if len(t) == k)

%o Lnew = [s+t for s, t in zip(L[:-1], L[1:])]

%o L = [t for t in chain(*zip_longest(L, Lnew)) if t is not None]

%o print(list(islice(agen(), 60))) # _Michael S. Branicky_, Nov 30 2023

%Y Cf. A000010, A367795 (the triangle of L(k) lists).

%K nonn,base

%O 1,3

%A _Luc Rousseau_, Nov 29 2023