cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A367726 Row sums of A367562 (iterates of the Christmas tree pattern map, A367508, converted to decimal).

Original entry on oeis.org

1, 2, 4, 9, 8, 11, 10, 28, 12, 22, 22, 26, 41, 40, 75, 49, 36, 55, 40, 51, 52, 57, 42, 124, 44, 118, 118, 186, 50, 148, 52, 94, 94, 130, 56, 106, 94, 114, 100, 112, 114, 120, 169, 168, 331, 177, 164, 311, 168, 307, 308, 441, 201, 200, 395, 209, 148, 231, 152, 227
Offset: 1

Views

Author

Paolo Xausa, Nov 28 2023

Keywords

Comments

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

Examples

			The first 4 tree pattern orders of A367508 are shown below (left). In the middle they are converted to decimal (A367562); row sums are on the right.
.
Order 1:                        |                 |
              0  1              |      0  1       |   1
                                |                 |
Order 2:                        |                 |
               10               |        2        |   2
           00  01  11           |     0  1  3     |   4
                                |                 |
Order 3:                        |                 |
            100  101            |      4  5       |   9
            010  110            |      2  6       |   8
       000  001  011  111       |   0  1  3  7    |  11
                                |                 |
Order 4:                        |                 |
              1010              |       10        |  10
        1000  1001  1011        |     8  9 11     |  28
              1100              |       12        |  12
        0100  0101  1101        |     4  5 13     |  22
        0010  0110  1110        |     2  6 14     |  22
  0000  0001  0011  0111  1111  |  0  1  3  7 15  |  26
.
		

Crossrefs

Programs

  • Mathematica
    With[{imax=8},Map[Total,Map[FromDigits[#,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 *)
  • 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(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(), 60))) # Michael S. Branicky, Nov 28 2023