login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A368465 Number of even terms in each row of the iterates of the Christmas tree pattern map (A367508). 4
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, 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, 1, 2, 1, 4, 1, 4, 1, 6, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,5
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 are shown below (left), with the corresponding number of even terms on the right.
.
Order 1: |
0 1 | 1
|
Order 2: |
10 | 1
00 01 11 | 1
|
Order 3: |
100 101 | 1
010 110 | 2
000 001 011 111 | 1
|
Order 4: |
1010 | 1
1000 1001 1011 | 1
1100 | 1
0100 0101 1101 | 1
0010 0110 1110 | 3
0000 0001 0011 0111 1111 | 1
.
MATHEMATICA
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 *)
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 sum(b[-1] == '0' for b in 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(), 88))) # Michael S. Branicky, Dec 25 2023
CROSSREFS
Sequence in context: A333769 A259396 A328672 * A325355 A219093 A062760
KEYWORD
nonn
AUTHOR
Paolo Xausa, Dec 25 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 16 21:21 EDT 2024. Contains 375191 sequences. (Running on oeis4.)