login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Iterates of the Christmas tree pattern map (A367508), where each row is interpreted as a single binary word and converted to decimal.
2

%I #17 Dec 28 2023 15:03:48

%S 1,2,7,37,22,95,10,2203,12,1117,622,4991,661,598,542327,793,346,

%T 271739,412,136637,72158,1154559,42,166507,44,149869,141742,545667567,

%U 50,199795,52,83317,75190,272971255,56,99961,42682,136623867,51004,68474749,35186622,1125971967

%N Iterates of the Christmas tree pattern map (A367508), where each row is interpreted as a single binary word and converted to decimal.

%C See A367508 for the description of the Christmas tree patterns, references and links.

%H Paolo Xausa, <a href="/A368398/b368398.txt">Table of n, a(n) for n = 1..13494</a> (first 15 orders).

%e The first 4 tree pattern orders of A367508 are shown below (left). In the middle the elements of each row are joined into single words; decimal conversion is on the right.

%e .

%e Order 1: | |

%e 0 1 | 01 | 1

%e | |

%e Order 2: | |

%e 10 | 10 | 2

%e 00 01 11 | 000111 | 7

%e | |

%e Order 3: | |

%e 100 101 | 100101 | 37

%e 010 110 | 010110 | 22

%e 000 001 011 111 | 000001011111 | 95

%e | |

%e Order 4: | |

%e 1010 | 1010 | 10

%e 1000 1001 1011 | 100010011011 | 2203

%e 1100 | 1100 | 12

%e 0100 0101 1101 | 010001011101 | 1117

%e 0010 0110 1110 | 001001101110 | 622

%e 0000 0001 0011 0111 1111 | 00000001001101111111 | 4991

%e .

%t With[{imax=7},Map[FromDigits[StringJoin[#],2]&,NestList[Map[Delete[{If[Length[#]>1,Map[#<>"0"&,Rest[#]],Nothing],Join[{#[[1]]<>"0"},Map[#<>"1"&,#]]},0]&],{{"0","1"}},imax-1],{2}]] (* Generates terms up to order 7 *)

%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 int("".join(r), 2)

%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(), 42))) # _Michael S. Branicky_, Dec 26 2023

%Y Cf. A367508, A367555, A367562.

%K nonn,base

%O 1,2

%A _Paolo Xausa_, Dec 22 2023