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.

Showing 1-9 of 9 results.

A057123 Global ranks of terms of A057122: tells which terms of A014486 form rooted plane binary trees also when interpreted as codes for ordinary rooted planar trees.

Original entry on oeis.org

0, 2, 12, 16, 91, 99, 124, 140, 165, 868, 881, 944, 970, 1014, 1213, 1221, 1364, 1398, 1442, 1633, 1649, 1736, 1887, 9474, 9493, 9619, 9657, 9727, 10317, 10330, 10606, 10657, 10727, 11130, 11156, 11295, 11550, 13452, 13465, 13528, 13554, 13598
Offset: 0

Views

Author

Antti Karttunen, Aug 11 2000

Keywords

Examples

			E.g., we have codes A014486(2) = 10, A014486(12) = 180, A014486(16) = 210, A014486(91) = 2920, for which the corresponding mountain ranges are:
................................./\/\
......../\/\...../\/\........./\/____\
/\/\./\/____\.../____\/\.../\/________\
and corresponding trees have degree 3 in all non-leaf, non-root vertices:
...............................0.0
........0.0......0.0..........0.1.
0.0....0.1........1.0........0.1..
.1......1..........1..........1...
		

Programs

  • Maple
    map(CatalanRankGlobal, A057122)

A057124 Local ranks of terms of A057122.

Original entry on oeis.org

0, 0, 3, 7, 26, 34, 59, 75, 100, 242, 255, 318, 344, 388, 587, 595, 738, 772, 816, 1007, 1023, 1110, 1261, 2556, 2575, 2701, 2739, 2809, 3399, 3412, 3688, 3739, 3809, 4212, 4238, 4377, 4632, 6534, 6547, 6610, 6636, 6680, 8177, 8185, 8541, 8600, 8670, 9065
Offset: 0

Views

Author

Antti Karttunen, Aug 11 2000

Keywords

Programs

  • Maple
    a(n) = CatalanRank(floor(binwidth(bintree_depth_first2tree(A014486[n]))/2),bintree_depth_first2tree(A014486[n]))

A358505 Binary encoding of the n-th standard ordered rooted tree.

Original entry on oeis.org

0, 2, 12, 10, 56, 50, 44, 42, 52, 226, 204, 202, 184, 178, 172, 170, 240, 210, 908, 906, 824, 818, 812, 810, 180, 738, 716, 714, 696, 690, 684, 682, 228, 962, 844, 842, 3640, 3634, 3628, 3626, 820, 3298, 3276, 3274, 3256, 3250, 3244, 3242, 752, 722, 2956, 2954
Offset: 1

Views

Author

Gus Wiseman, Nov 20 2022

Keywords

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.

Examples

			The sixth standard tree is {{{}},{}}, which becomes (1,1,0,0,1,0), so a(6) = 50.
		

Crossrefs

Sorting gives A014486.
A dual sequence is A358523.

Programs

  • 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}]

A057517 Binary encodings of the Catalan mountain ranges with exactly one sea-level valley, i.e., the rooted plane trees with root degree = 2.

Original entry on oeis.org

10, 44, 50, 180, 184, 204, 210, 226, 724, 728, 740, 744, 752, 820, 824, 844, 850, 866, 908, 914, 930, 962, 2900, 2904, 2916, 2920, 2928, 2964, 2968, 2980, 2984, 2992, 3012, 3016, 3024, 3040, 3284, 3288, 3300, 3304, 3312, 3380, 3384, 3404, 3410, 3426
Offset: 1

Views

Author

Antti Karttunen, Sep 03 2000

Keywords

Comments

This bijective mapping from all rooted plane trees to one node larger, root degree = 2 trees illustrates the fact that CONV(A000108, A000108) = LEFT(A000108). (Catalan numbers shift left under convolution).

Crossrefs

Cf. A057501 (for binexp2pars, pars2binexp, car, cdr), A057518, A057519, A057122. Single-trunked trees: A057547.

Programs

  • Maple
    alltrees2doubletrunked := n -> pars2binexp(alltrees2doubletrunkedP(binexp2pars(n)));
    alltrees2doubletrunkedP := h -> [car(h),cdr(h)];

Formula

a(n) = alltrees2doubletrunked(A014486(n)) (Starting from n=1).

A358523 Standard ordered tree numbers of ordered trees in order of their binary encodings (A014486).

Original entry on oeis.org

1, 2, 4, 3, 8, 7, 6, 9, 5, 16, 15, 14, 25, 13, 12, 11, 18, 129, 65, 10, 33, 257, 17, 32, 31, 30, 57, 29, 28, 27, 50, 385, 193, 26, 97, 769, 49, 24, 23, 22, 41, 21, 36, 35, 258, 32769, 16385, 130, 8193, 16777217, 4097, 20, 19, 66
Offset: 0

Views

Author

Gus Wiseman, Nov 21 2022

Keywords

Comments

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.
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.

Examples

			The first six binary encodings are: 0, 2, 10, 12, 42, 44, and the corresponding trees have standard ranks: 1, 2, 4, 3, 8, 7.
		

Crossrefs

A dual sequence is A358505.
A000108 counts ordered rooted trees, unordered A000081.
A014486 lists all binary encodings.

Programs

  • Mathematica
    stcinv[q_]:=Total[2^Accumulate[Reverse[q]]]/2;
    srtinv[t_]:=If[t=={},1,stcinv[srtinv/@t]+1];
    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[srtinv[bint[n]],{n,Select[Range[0,100],binbalQ]}]

A057119 Iterative "rewrite" sequence of binary plane trees.

Original entry on oeis.org

2, 10, 180, 47940, 3185189700, 13760582141553025860, 254536428082497193743150874618461037380, 86730091025558229301371439971941296450524845723997443510460490068605668041540
Offset: 0

Views

Author

Antti Karttunen, Aug 11 2000

Keywords

Comments

This sequence is based on the observation that the terms of A014486 (2n-digit balanced binary sequences) encode rooted plane trees with n+1 vertices (n edges), but also rooted binary plane trees with n+1 leaves, i.e., 2n edges, 2n+1 vertices.

Examples

			We start from the simplest such binary tree: 0.0 (binary depth-first encoding = 2, from left to right, 1 with the zero of the last leaf ignored); then encode it as an ordinary rooted plane tree (depth-first-wise) to get the code 1010 = decimal 10, which in turn, when interpreted as an encoding of binary tree is:
..0.0
.0.1. (whose rooted plane tree coding is 10110100 = 180 in decimal)
..1.. etc.
		

Crossrefs

Programs

  • Maple
    a(n) = bt_df2tree_apply_k_times(2,n)
    bt_df2tree_apply_k_times := proc(n,k) option remember; if(0 = k) then (n) else bt_df2tree_apply_k_times(bintree_depth_first2tree(n),k-1); fi; end;
    bintree_depth_first2tree := n -> ((btdf2t(n*2,floor_log_2(n)+1)/2) - 2^(2*(floor_log_2(n)+1)));
    btdf2t := proc(n,ii) local i,e,x,y; i := ii; if(n >= (2^i)) then x := btdf2t(n - (2^i),i-1); i := i - ((floor_log_2(x)+1)/2); y := btdf2t((n mod (2^i)),i-1); RETURN((2^(floor_log_2(y)+2))*((2^(floor_log_2(x)+1)) + x) + 2*y); else RETURN(2); fi; end;

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

Original entry on oeis.org

0, 2, 10, 12, 42, 52, 56, 170, 204, 212, 232, 240, 682, 820, 844, 852, 920, 936, 976, 992, 2730, 3276, 3284, 3380, 3404, 3412, 3640, 3688, 3736, 3752, 3888, 3920, 4000, 4032, 10922, 13108, 13132, 13140, 13516, 13524, 13620, 13644, 13652, 14568, 14744, 14760
Offset: 1

Views

Author

Gus Wiseman, Nov 21 2022

Keywords

Comments

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

Examples

			The terms together with their corresponding trees begin:
    0: o
    2: (o)
   10: (oo)
   12: ((o))
   42: (ooo)
   52: ((oo))
   56: (((o)))
  170: (oooo)
  204: ((o)(o))
  212: ((ooo))
  232: (((oo)))
  240: ((((o))))
  682: (ooooo)
  820: ((o)(oo))
  844: ((oo)(o))
  852: ((oooo))
  920: (((o)(o)))
  936: (((ooo)))
  976: ((((oo))))
  992: (((((o)))))
		

Crossrefs

These trees are counted by A007059.
This is a subset of A014486.
The version for binary trees is A057122.
The unordered version is A184155, counted by A048816.
Another ranking of balanced ordered trees is A358459.
A000108 counts ordered rooted trees, unordered A000081.
A358453 counts transitive ordered trees, unordered A290689.

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->"}"}],","->""],"} {"->"},{"]]]
    Select[Range[0,1000],binbalQ[#]&&SameQ@@Length/@Position[bint[#],{}]&]

A358550 Depth of the ordered rooted tree with binary encoding A014486(n).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 22 2022

Keywords

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.

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.
Leaves of the ordered tree are counted by A057514, standard A358371.
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.
Positions of 2's are A155587, indices of A020988.
The standard ranking of the ordered tree is A358523.
Nodes of the ordered tree are counted by A358551, standard A358372.
For standard instead of binary encoding we have A358379.
A000108 counts ordered rooted trees, unordered A000081.
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]}]

A358551 Number of nodes in the ordered rooted tree with binary encoding A014486(n).

Original entry on oeis.org

1, 2, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
Offset: 1

Views

Author

Gus Wiseman, Nov 22 2022

Keywords

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.

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

Run-lengths are A000108.
Binary encodings are listed by A014486.
Leaves of the ordered tree are counted by A057514, standard A358371.
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.
For standard instead of binary encoding we have A358372.
The standard ranking of the ordered tree is A358523.
Depth of the ordered tree is A358550, standard A358379.

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[Count[bint[k],_,{0,Infinity}],{k,Select[Range[0,10000],binbalQ]}]

Formula

a(n) = A072643(n) + 1.
Showing 1-9 of 9 results.