cp's OEIS Frontend

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.

A368465 Number of even terms in each row of the iterates of the Christmas tree pattern map (A367508).

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