OFFSET
1,4
COMMENTS
LINKS
FORMULA
Length of row n = #L(n) = 2^(n-1) + 1 = A000051(n-1).
EXAMPLE
Triangle begins:
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 84 20 164 ...
Or the same in binary:
1 0
1 10 0
1 110 10 100 0
1 1110 110 11010 10 10100 100 1000 0
1 11110 1110 1110110 110 11011010 11010 1101010 10 1010100 10100 10100100 ...
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)
for(k=1, 8, my(l=L(k)); for(i=1, #l, print1(l[i], ", ")))
(Python)
from itertools import chain, count, islice, zip_longest
def agen(): # generator of terms
L = ["1", "0"]
for k in count(1):
yield from (int(t, 2) for t in L)
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(), 69))) # Michael S. Branicky, Nov 30 2023
CROSSREFS
KEYWORD
nonn,tabf,base
AUTHOR
Luc Rousseau, Nov 30 2023
STATUS
approved