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.

A358524 Binary encoding of balanced ordered rooted trees (counted by A007059).

This page as a plain text file.
%I A358524 #6 Nov 21 2022 22:01:53
%S A358524 0,2,10,12,42,52,56,170,204,212,232,240,682,820,844,852,920,936,976,
%T A358524 992,2730,3276,3284,3380,3404,3412,3640,3688,3736,3752,3888,3920,4000,
%U A358524 4032,10922,13108,13132,13140,13516,13524,13620,13644,13652,14568,14744,14760
%N A358524 Binary encoding of balanced ordered rooted trees (counted by A007059).
%C A358524 An ordered tree is balanced if all leaves are the same distance from the root.
%C A358524 The binary encoding of an ordered tree (see A014486) is obtained by replacing the internal left and right brackets with 0's and 1's, thus forming a binary number.
%e A358524 The terms together with their corresponding trees begin:
%e A358524     0: o
%e A358524     2: (o)
%e A358524    10: (oo)
%e A358524    12: ((o))
%e A358524    42: (ooo)
%e A358524    52: ((oo))
%e A358524    56: (((o)))
%e A358524   170: (oooo)
%e A358524   204: ((o)(o))
%e A358524   212: ((ooo))
%e A358524   232: (((oo)))
%e A358524   240: ((((o))))
%e A358524   682: (ooooo)
%e A358524   820: ((o)(oo))
%e A358524   844: ((oo)(o))
%e A358524   852: ((oooo))
%e A358524   920: (((o)(o)))
%e A358524   936: (((ooo)))
%e A358524   976: ((((oo))))
%e A358524   992: (((((o)))))
%t A358524 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]}];
%t A358524 bint[n_]:=If[n==0,{},ToExpression[StringReplace[StringReplace[ToString[IntegerDigits[n,2]/.{1->"{",0->"}"}],","->""],"} {"->"},{"]]]
%t A358524 Select[Range[0,1000],binbalQ[#]&&SameQ@@Length/@Position[bint[#],{}]&]
%Y A358524 These trees are counted by A007059.
%Y A358524 This is a subset of A014486.
%Y A358524 The version for binary trees is A057122.
%Y A358524 The unordered version is A184155, counted by A048816.
%Y A358524 Another ranking of balanced ordered trees is A358459.
%Y A358524 A000108 counts ordered rooted trees, unordered A000081.
%Y A358524 A358453 counts transitive ordered trees, unordered A290689.
%Y A358524 Cf. A001263, A003238, A244925, A358377, A358379, A358523.
%K A358524 nonn
%O A358524 1,2
%A A358524 _Gus Wiseman_, Nov 21 2022