login
A368398
Iterates of the Christmas tree pattern map (A367508), where each row is interpreted as a single binary word and converted to decimal.
2
1, 2, 7, 37, 22, 95, 10, 2203, 12, 1117, 622, 4991, 661, 598, 542327, 793, 346, 271739, 412, 136637, 72158, 1154559, 42, 166507, 44, 149869, 141742, 545667567, 50, 199795, 52, 83317, 75190, 272971255, 56, 99961, 42682, 136623867, 51004, 68474749, 35186622, 1125971967
OFFSET
1,2
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..13494 (first 15 orders).
EXAMPLE
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.
.
Order 1: | |
0 1 | 01 | 1
| |
Order 2: | |
10 | 10 | 2
00 01 11 | 000111 | 7
| |
Order 3: | |
100 101 | 100101 | 37
010 110 | 010110 | 22
000 001 011 111 | 000001011111 | 95
| |
Order 4: | |
1010 | 1010 | 10
1000 1001 1011 | 100010011011 | 2203
1100 | 1100 | 12
0100 0101 1101 | 010001011101 | 1117
0010 0110 1110 | 001001101110 | 622
0000 0001 0011 0111 1111 | 00000001001101111111 | 4991
.
MATHEMATICA
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 *)
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 int("".join(r), 2)
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(), 42))) # Michael S. Branicky, Dec 26 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo Xausa, Dec 22 2023
STATUS
approved