login
Triangle read by rows, where row n = L(n) is defined by L(1) = [1,0] and L(n+1) is obtained from L(n) by inserting their binary concatenation between elements x,y.
2

%I #26 Jan 19 2024 21:43:52

%S 1,0,1,2,0,1,6,2,4,0,1,14,6,26,2,20,4,8,0,1,30,14,118,6,218,26,106,2,

%T 84,20,164,4,72,8,16,0,1,62,30,494,14,1910,118,950,6,1754,218,7002,26,

%U 3434,106,426,2,340,84,2708,20,5284,164,1316,4,584,72,1160,8,272,16,32,0

%N Triangle read by rows, where row n = L(n) is defined by L(1) = [1,0] and L(n+1) is obtained from L(n) 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 The numbers of bits of the numbers in this triangle are provided by the A049456 triangle.

%C The sorted set of the numbers that occur in some row of this triangle is provided by A367745.

%H Luc Rousseau, <a href="/A367795/a367795.svg">SVG illustration of the nesting of the L(n) lists for n=1..9</a>.

%F Length of row n = #L(n) = 2^(n-1) + 1 = A000051(n-1).

%e Triangle begins:

%e 1 0

%e 1 2 0

%e 1 6 2 4 0

%e 1 14 6 26 2 20 4 8 0

%e 1 30 14 118 6 218 26 106 2 84 20 164 ...

%e Or the same in binary:

%e 1 0

%e 1 10 0

%e 1 110 10 100 0

%e 1 1110 110 11010 10 10100 100 1000 0

%e 1 11110 1110 1110110 110 11011010 11010 1101010 10 1010100 10100 10100100 ...

%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 for(k=1,8,my(l=L(k));for(i=1,#l,print1(l[i],", ")))

%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 (int(t, 2) for t in L)

%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(), 69))) # _Michael S. Branicky_, Nov 30 2023

%Y Cf. A000051, A049456, A367745.

%K nonn,tabf,base

%O 1,4

%A _Luc Rousseau_, Nov 30 2023