A367508 Iterates of the Christmas tree pattern map, read by rows, with leading zeros removed and interpreted as decimal numbers (see description in Comments).
0, 1, 10, 0, 1, 11, 100, 101, 10, 110, 0, 1, 11, 111, 1010, 1000, 1001, 1011, 1100, 100, 101, 1101, 10, 110, 1110, 0, 1, 11, 111, 1111, 10100, 10101, 10010, 10110, 10000, 10001, 10011, 10111, 11000, 11001, 1010, 11010, 1000, 1001, 1011, 11011, 1100, 11100, 100, 101, 1101, 11101
Offset: 1
Examples
The first 4 tree pattern orders are shown below. . Order 1: 0 1 . Order 2: 10 00 01 11 . Order 3: 100 101 010 110 000 001 011 111 . Order 4: 1010 1000 1001 1011 1100 0100 0101 1101 0010 0110 1110 0000 0001 0011 0111 1111 .
References
- Donald E. Knuth, The Art of Computer Programming, Vol. 4A: Combinatorial Algorithms, Part 1, Addison-Wesley, 2011, Section 7.2.1.6, pp. 457-460.
Links
- Paolo Xausa, Table of n, a(n) for n = 1..8190 (first 12 orders, flattened).
- N. de Brujin, C. Tengbergen and D. Kruyswijk, On the set of divisors of a number, Nieuw Arch. Wiskunde 23, 1951, pp. 191-193.
- Curtis Greene and Daniel J. Kleitman, Strong versions of Sperner's theorem, Journal of Combinatorial Theory, Series A, Volume 20, Issue 1, 1976, pp. 80-88.
- G. Hansel, Sur le nombre des fonctions booléennes monotones de variables, Comptes Rendus Acad. Sci. 262, 1966, pp. 1088-1090.
- Donald E. Knuth, Stanford Lecture: Chains of Subsets, YouTube video, 2002.
- E. Sperner, Ein Satz über Untermengen einer endlichen Menge, Math Z 27, 1928, pp. 544-548.
- Paolo Xausa, Illustration of first 8 orders.
Crossrefs
Programs
-
Julia
function A367508(rows::Int) R = [["0", "1"]] seq = Int[] op = (r, n) -> [r[k] * n for k in 2:length(r)] for _ in 1:rows r = popfirst!(R) append!(seq, map(b -> parse(Int, b), r)) length(r) > 1 && push!(R, op(r, "0")) push!(R, [[r[1] * "0", r[1] * "1"]; op(r, "1")]) end return seq end println(A367508(20)) # Peter Luschny, Nov 28 2023
-
Mathematica
With[{imax=6},Map[FromDigits,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 *)
-
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), 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(), 62))) # Michael S. Branicky, Nov 23 2023
Comments