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 A368464 #17 Dec 29 2023 13:54:46 %S A368464 1,0,2,1,0,3,0,2,0,2,0,4,1,0,3,1,0,3,0,3,0,5,0,2,0,2,0,4,0,2,0,2,0,4, %T A368464 0,2,0,4,0,4,0,6,1,0,3,1,0,3,0,3,0,5,1,0,3,1,0,3,0,3,0,5,1,0,3,0,3,0, %U A368464 5,0,3,0,5,0,5,0,7,0,2,0,2,0,4,0,2,0,2,0 %N A368464 Number of odd terms in each row of the iterates of the Christmas tree pattern map (A367508). %C A368464 See A367508 for the description of the Christmas tree patterns, references and links. %H A368464 Paolo Xausa, <a href="/A368464/b368464.txt">Table of n, a(n) for n = 1..13494</a> (first 15 orders). %e A368464 The first 4 tree pattern orders are shown below (left), with the corresponding number of odd terms on the right. %e A368464 . %e A368464 Order 1: | %e A368464 0 1 | 1 %e A368464 | %e A368464 Order 2: | %e A368464 10 | 0 %e A368464 00 01 11 | 2 %e A368464 | %e A368464 Order 3: | %e A368464 100 101 | 1 %e A368464 010 110 | 0 %e A368464 000 001 011 111 | 3 %e A368464 | %e A368464 Order 4: | %e A368464 1010 | 0 %e A368464 1000 1001 1011 | 2 %e A368464 1100 | 0 %e A368464 0100 0101 1101 | 2 %e A368464 0010 0110 1110 | 0 %e A368464 0000 0001 0011 0111 1111 | 4 %e A368464 . %e A368464 Apparently, removing the 0 terms from the order i pattern (for i >= 2), gives the row lengths of the order i-1 pattern (cf. A363718). %t A368464 With[{imax=8},Map[Total,Map[Mod[FromDigits[#],2]&,NestList[Map[Delete[{If[Length[#]>1,Map[#<>"0"&,Rest[#]],Nothing],Join[{#[[1]]<>"0"},Map[#<>"1"&,#]]},0]&],{{"0","1"}},imax-1],{3}],{2}]] (* Generates terms up to order 8 *) %o A368464 (Python) %o A368464 from itertools import islice %o A368464 from functools import reduce %o A368464 def uniq(r): return reduce(lambda u, e: u if e in u else u+[e], r, []) %o A368464 def agen(): # generator of terms %o A368464 R = [["0", "1"]] %o A368464 while R: %o A368464 r = R.pop(0) %o A368464 yield sum(1 for b in r if b[-1] == '1') %o A368464 if len(r) > 1: R.append(uniq([r[k]+"0" for k in range(1, len(r))])) %o A368464 R.append(uniq([r[0]+"0", r[0]+"1"] + [r[k]+"1" for k in range(1, len(r))])) %o A368464 print(list(islice(agen(), 88))) # _Michael S. Branicky_, Dec 25 2023 %Y A368464 Cf. A363718, A367508, A368463, A368465. %K A368464 nonn %O A368464 1,3 %A A368464 _Paolo Xausa_, Dec 25 2023