login

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”).

A367562
Iterates of the Christmas tree pattern map (A367508), read by rows and converted to decimal.
10
0, 1, 2, 0, 1, 3, 4, 5, 2, 6, 0, 1, 3, 7, 10, 8, 9, 11, 12, 4, 5, 13, 2, 6, 14, 0, 1, 3, 7, 15, 20, 21, 18, 22, 16, 17, 19, 23, 24, 25, 10, 26, 8, 9, 11, 27, 12, 28, 4, 5, 13, 29, 2, 6, 14, 30, 0, 1, 3, 7, 15, 31, 42, 40, 41, 43, 44, 36, 37, 45, 34, 38, 46, 32, 33, 35, 39, 47
OFFSET
1,3
COMMENTS
See A367508 for the description of the Christmas tree patterns, references and links.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..8190 (first 12 orders, flattened).
EXAMPLE
The first 4 tree pattern orders are shown below (on the right their elements are converted to decimal: the present sequence is obtained by reading the right half of the diagram left to right, top to bottom).
The sequence of the terms in chains of length 1 (marked with asterisks) coincides with the positive terms of A014486.
.
Order 1: |
0 1 | 0 1
|
Order 2: |
10 | 2*
00 01 11 | 0 1 3
|
Order 3: |
100 101 | 4 5
010 110 | 2 6
000 001 011 111 | 0 1 3 7
|
Order 4: |
1010 | 10*
1000 1001 1011 | 8 9 11
1100 | 12*
0100 0101 1101 | 4 5 13
0010 0110 1110 | 2 6 14
0000 0001 0011 0111 1111 | 0 1 3 7 15
.
MATHEMATICA
With[{imax=6}, Map[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 *)
PROG
(Python)
from itertools import islice
from functools import reduce
def uniq(r): return reduce(lambda u, e: u if e in u else u+[e], r, [])
def agen(): # generator of terms
R = [["0", "1"]]
while R:
r = R.pop(0)
yield from map(lambda b: int(b, 2), r)
if len(r) > 1: R.append(uniq([r[k]+"0" for k in range(1, len(r))]))
R.append(uniq([r[0]+"0", r[0]+"1"] + [r[k]+"1" for k in range(1, len(r))]))
print(list(islice(agen(), 77))) # Michael S. Branicky, Nov 23 2023
KEYWORD
nonn,base,tabf,look
AUTHOR
Paolo Xausa, Nov 23 2023
STATUS
approved