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.

A358459 Numbers k such that the k-th standard ordered rooted tree is balanced (counted by A007059).

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 9, 11, 16, 17, 32, 35, 37, 41, 43, 64, 128, 129, 137, 139, 163, 169, 171, 256, 257, 293, 512, 515, 529, 547, 553, 555, 641, 649, 651, 675, 681, 683, 1024, 1025, 2048, 2053, 2057, 2059, 2177, 2185, 2187, 2211, 2217, 2219, 2305, 2341, 2563
Offset: 1

Views

Author

Gus Wiseman, Nov 19 2022

Keywords

Comments

An ordered tree is balanced if all leaves have the same distance from the root.
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.

Examples

			The terms together with their corresponding ordered trees begin:
   1: o
   2: (o)
   3: ((o))
   4: (oo)
   5: (((o)))
   8: (ooo)
   9: ((oo))
  11: ((o)(o))
  16: (oooo)
  17: ((((o))))
  32: (ooooo)
  35: ((oo)(o))
  37: (((o))((o)))
  41: ((o)(oo))
  43: ((o)(o)(o))
		

Crossrefs

These trees are counted by A007059.
The unordered version is A184155, counted by A048816.
A000108 counts ordered rooted trees, unordered A000081.
A358379 gives depth of standard ordered trees.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    srt[n_]:=If[n==1,{},srt/@stc[n-1]];
    Select[Range[100],SameQ@@Length/@Position[srt[#],{}]&]