Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #21 Nov 29 2023 07:46:04
%S 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 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 14,14,21,7,7,14,7,14,14,21,7,14,14,21,14,21,21,28
%N Number of zeros (or ones) in each row of the iterates of the Christmas tree pattern map (A367508).
%C See A367508 for the description of the Christmas tree patterns, references and links.
%H Paolo Xausa, <a href="/A367555/b367555.txt">Table of n, a(n) for n = 1..13494</a> (first 15 orders).
%e The following diagram shows the first 4 tree pattern orders, along with the corresponding number of zeros = number of ones.
%e .
%e Order 1: |
%e 0 1 | 1
%e |
%e Order 2: |
%e 10 | 1
%e 00 01 11 | 3
%e |
%e Order 3: |
%e 100 101 | 3
%e 010 110 | 3
%e 000 001 011 111 | 6
%e |
%e Order 4: |
%e 1010 | 2
%e 1000 1001 1011 | 6
%e 1100 | 2
%e 0100 0101 1101 | 6
%e 0010 0110 1110 | 6
%e 0000 0001 0011 0111 1111 | 10
%e .
%t 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 (Python)
%o from itertools import islice
%o from functools import reduce
%o def uniq(r): return reduce(lambda u, e: u if e in u else u+[e], r, [])
%o def agen(): # generator of terms
%o R = [["0", "1"]]
%o while R:
%o r = R.pop(0)
%o yield sum(e.count("1") for e in r)
%o if len(r) > 1: R.append(uniq([r[k]+"0" for k in range(1, len(r))]))
%o R.append(uniq([r[0]+"0", r[0]+"1"] + [r[k]+"1" for k in range(1, len(r))]))
%o print(list(islice(agen(), 77))) # _Michael S. Branicky_, Nov 23 2023
%Y Cf. A367508, A367562.
%K nonn,base
%O 1,3
%A _Paolo Xausa_, Nov 22 2023