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 #17 Dec 28 2023 15:04:00
%S 0,1,0,0,1,1,0,1,0,0,0,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,1,1,0,1,0,0,
%T 0,1,1,1,0,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,1,1,0,0,
%U 1,1,0,0,0,0,1,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,1,1,1
%N Parity of the iterates of the Christmas tree pattern map (A367508), read by rows.
%C See A367508 for the description of the Christmas tree patterns, references and links.
%H Paolo Xausa, <a href="/A368463/b368463.txt">Table of n, a(n) for n = 1..8190</a> (first 12 orders, flattened).
%F a(n) = A367508(n) mod 2.
%p The first 4 tree pattern orders are shown below (left), with the corresponding parity on the right.
%p .
%p Order 1: |
%p 0 1 | 0 1
%p |
%p Order 2: |
%p 10 | 0
%p 00 01 11 | 0 1 1
%p |
%p Order 3: |
%p 100 101 | 0 1
%p 010 110 | 0 0
%p 000 001 011 111 | 0 1 1 1
%p |
%p Order 4: |
%p 1010 | 0
%p 1000 1001 1011 | 0 1 1
%p 1100 | 0
%p 0100 0101 1101 | 0 1 1
%p 0010 0110 1110 | 0 0 0
%p 0000 0001 0011 0111 1111 | 0 1 1 1 1
%p .
%t With[{imax=6},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}]] (* Generates terms up to order 6 *)
%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 from map(lambda b: int(b[-1]), 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(), 94))) # _Michael S. Branicky_, Dec 25 2023
%Y Cf. A367508, A367562, A368464, A368465.
%K nonn,tabf
%O 1
%A _Paolo Xausa_, Dec 25 2023