A357701 Irregular triangle read by rows where row n is the vertex depths of the rooted binary tree with Colijn-Plazzotta tree number n, traversed in pre-order, numerically larger child first.
0, 0, 1, 1, 0, 1, 2, 2, 1, 0, 1, 2, 2, 1, 2, 2, 0, 1, 2, 3, 3, 2, 1, 0, 1, 2, 3, 3, 2, 1, 2, 2, 0, 1, 2, 3, 3, 2, 1, 2, 3, 3, 2, 0, 1, 2, 3, 3, 2, 3, 3, 1, 0, 1, 2, 3, 3, 2, 3, 3, 1, 2, 2, 0, 1, 2, 3, 3, 2, 3, 3, 1, 2, 3, 3, 2, 0, 1, 2, 3, 3, 2, 3, 3, 1, 2, 3, 3, 2, 3, 3
Offset: 1
Examples
Triangle begins: k=1 2 3 4 5 6 7 8 9 10 11 n=1: 0, n=2: 0, 1, 1, n=3: 0, 1, 2, 2, 1, n=4: 0, 1, 2, 2, 1, 2, 2, n=5: 0, 1, 2, 3, 3, 2, 1, n=6: 0, 1, 2, 3, 3, 2, 1, 2, 2, n=7: 0, 1, 2, 3, 3, 2, 1, 2, 3, 3, 2, n=8: 0, 1, 2, 3, 3, 2, 3, 3, 1, n=9: 0, 1, 2, 3, 3, 2, 3, 3, 1, 2, 2, For n=6, tree 6 is as follows, with vertices numbered by pre-order traversal (column number k), 1 depth=0 / \ 2 7 depth=1 / \ / \ 3 6 8 9 depth=2 / \ 4 5 depth=3 row(6) = depths 0,1,2,3,3,2,1,2,2
Links
- Kevin Ryde, Table of n, a(n) for rows 1..500, flattened
- Caroline Colijn and Giacomo Plazzotta, A Metric on Phylogenetic Tree Shapes, Systematic Biology, volume 67, number 1, January 2018, pages 113-126.
- Kevin Ryde, PARI/GP Code
Crossrefs
Programs
-
Mathematica
yList=FoldList[{#1,#2}&,1,Range[2,20]]//Flatten;x[n_]:=Floor[Sqrt[2*n]+1/2];y[n_]:=yList[[n]];row[1]={0};row[n_]:=row[n]={0}~Join~(row[x[n-1]]+1)~Join~(row[y[n-1]]+1);Flatten[Array[row,11]] (* Shenghui Yang, Apr 15 2025 *)
-
PARI
\\ See links.
Comments