This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A367555 #21 Nov 29 2023 07:46:04 %S A367555 1,1,3,3,3,6,2,6,2,6,6,10,5,5,10,5,5,10,5,10,10,15,3,9,3,9,9,15,3,9,3, %T A367555 9,9,15,3,9,9,15,9,15,15,21,7,7,14,7,7,14,7,14,14,21,7,7,14,7,7,14,7, %U A367555 14,14,21,7,7,14,7,14,14,21,7,14,14,21,14,21,21,28 %N A367555 Number of zeros (or ones) in each row of the iterates of the Christmas tree pattern map (A367508). %C A367555 See A367508 for the description of the Christmas tree patterns, references and links. %H A367555 Paolo Xausa, <a href="/A367555/b367555.txt">Table of n, a(n) for n = 1..13494</a> (first 15 orders). %e A367555 The following diagram shows the first 4 tree pattern orders, along with the corresponding number of zeros = number of ones. %e A367555 . %e A367555 Order 1: | %e A367555 0 1 | 1 %e A367555 | %e A367555 Order 2: | %e A367555 10 | 1 %e A367555 00 01 11 | 3 %e A367555 | %e A367555 Order 3: | %e A367555 100 101 | 3 %e A367555 010 110 | 3 %e A367555 000 001 011 111 | 6 %e A367555 | %e A367555 Order 4: | %e A367555 1010 | 2 %e A367555 1000 1001 1011 | 6 %e A367555 1100 | 2 %e A367555 0100 0101 1101 | 6 %e A367555 0010 0110 1110 | 6 %e A367555 0000 0001 0011 0111 1111 | 10 %e A367555 . %t A367555 With[{imax=9},Map[Total,NestList[Map[Delete[{If[Length[#]>1,Rest[#],Nothing],Join[{First[#]},#+1]},0]&],{{0,1}},imax-1],{2}]] (* Generates terms up to order 9 *) %o A367555 (Python) %o A367555 from itertools import islice %o A367555 from functools import reduce %o A367555 def uniq(r): return reduce(lambda u, e: u if e in u else u+[e], r, []) %o A367555 def agen(): # generator of terms %o A367555 R = [["0", "1"]] %o A367555 while R: %o A367555 r = R.pop(0) %o A367555 yield sum(e.count("1") for e in r) %o A367555 if len(r) > 1: R.append(uniq([r[k]+"0" for k in range(1, len(r))])) %o A367555 R.append(uniq([r[0]+"0", r[0]+"1"] + [r[k]+"1" for k in range(1, len(r))])) %o A367555 print(list(islice(agen(), 77))) # _Michael S. Branicky_, Nov 23 2023 %Y A367555 Cf. A367508, A367562. %K A367555 nonn,base %O A367555 1,3 %A A367555 _Paolo Xausa_, Nov 22 2023