OFFSET
1,2
COMMENTS
The binary encoding of an ordered tree (A014486) is obtained by replacing the internal left and right brackets with 0's and 1's, thus forming a binary number.
We define the n-th standard ordered rooted tree to be obtained by taking the (n-1)-th composition in standard order (graded reverse-lexicographic, A066099) as root and replacing each part with its own standard ordered rooted tree. This ranking is an ordered variation of Matula-Goebel numbers, giving a bijective correspondence between positive integers and unlabeled ordered rooted trees.
LINKS
EXAMPLE
The sixth standard tree is {{{}},{}}, which becomes (1,1,0,0,1,0), so a(6) = 50.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
srt[n_]:=If[n==1, {}, srt/@stc[n-1]];
trt[t_]:=FromDigits[Take[DeleteCases[Characters[ToString[t]]/.{"{"->1, "}"->0}, ", "|" "], {2, -2}], 2];
Table[trt[srt[n]], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 20 2022
STATUS
approved