A358550 Depth of the ordered rooted tree with binary encoding A014486(n).
1, 2, 2, 3, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4, 3, 3, 3, 3, 4, 4, 4, 4, 5, 2, 3, 3, 3, 4, 3, 3, 3, 3, 4, 4, 4, 4, 5, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 2, 3, 3, 3, 4, 3, 3, 3, 3, 4, 4, 4, 4, 5, 3, 3, 3, 3, 4, 3, 3, 3
Offset: 1
Keywords
Examples
The first few rooted trees in binary encoding are: 0: o 2: (o) 10: (oo) 12: ((o)) 42: (ooo) 44: (o(o)) 50: ((o)o) 52: ((oo)) 56: (((o))) 170: (oooo) 172: (oo(o)) 178: (o(o)o) 180: (o(oo)) 184: (o((o)))
Crossrefs
Positions of first appearances are A014137.
Branches of the ordered tree are counted by A057515.
Edges of the ordered tree are counted by A072643.
The Matula-Goebel number of the ordered tree is A127301.
The standard ranking of the ordered tree is A358523.
For standard instead of binary encoding we have A358379.
A014486 lists all binary encodings.
Programs
-
Mathematica
binbalQ[n_]:=n==0||Count[IntegerDigits[n,2],0]==Count[IntegerDigits[n,2],1]&&And@@Table[Count[Take[IntegerDigits[n,2],k],0]<=Count[Take[IntegerDigits[n,2],k],1],{k,IntegerLength[n,2]}]; bint[n_]:=If[n==0,{},ToExpression[StringReplace[StringReplace[ToString[IntegerDigits[n,2]/.{1->"{",0->"}"}],","->""],"} {"->"},{"]]]; Table[Depth[bint[k]]-1,{k,Select[Range[0,1000],binbalQ]}]
Comments