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.

Previous Showing 11-20 of 20 results.

A358579 Numbers k such that the k-th standard ordered rooted tree has the same number of leaves as internal (non-leaf) nodes.

Original entry on oeis.org

2, 6, 7, 9, 20, 22, 23, 26, 27, 29, 35, 41, 66, 76, 78, 79, 84, 86, 87, 90, 91, 93, 97, 102, 103, 106, 107, 109, 115, 117, 130, 136, 138, 139, 141, 146, 153, 163, 169, 193, 196, 197, 201, 226, 241, 262, 263, 296, 300, 302, 303, 308, 310, 311, 314, 315, 317
Offset: 1

Views

Author

Gus Wiseman, Nov 25 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.

Examples

			The terms together with their corresponding rooted trees begin:
   2: (o)
   6: (o(o))
   7: ((oo))
   9: ((o)(o))
  20: (oo((o)))
  22: (o(((o))))
  23: (((o)(o)))
  26: (o(o(o)))
  27: ((o)(o)(o))
  29: ((o((o))))
  35: (((o))(oo))
  41: (((o(o))))
  66: (o(o)(((o))))
  76: (oo(ooo))
  78: (o(o)(o(o)))
  79: ((o(((o)))))
  84: (oo(o)(oo))
  86: (o(o(oo)))
		

Crossrefs

These ordered trees are counted by A000891.
The unordered version is A358578, counted by A185650.
Height instead of leaves: counted by A358588, unordered A358576.
Height instead of internals: counted by A358590, unordered A358577.
Standard ordered tree number statistics: A358371, A358372, A358379, A358553.
A000081 counts rooted trees, ordered A000108.
A055277 counts trees by nodes and leaves, ordered A001263.

Programs

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

Formula

A358371(a(n)) = A358553(a(n)).

A358592 Matula-Goebel numbers of rooted trees whose height, number of leaves, and number of internal (non-leaf) nodes are all equal.

Original entry on oeis.org

18, 21, 60, 70, 78, 91, 92, 95, 102, 111, 119, 122, 129, 146, 151, 181, 201, 227, 264, 269, 308, 348, 376, 406, 418, 426, 452, 492, 497, 519, 551, 562, 574, 583, 596, 606, 659, 664, 668, 698, 707, 708, 717, 779, 794, 796, 809, 826, 834, 911, 932, 934, 942, 958
Offset: 1

Views

Author

Gus Wiseman, Nov 25 2022

Keywords

Comments

The Matula-Goebel number of a rooted tree is the product of primes indexed by the Matula-Goebel numbers of the branches of its root, which gives a bijective correspondence between positive integers and unlabeled rooted trees.

Examples

			The terms together with their corresponding rooted trees begin:
   18: (o(o)(o))
   21: ((o)(oo))
   60: (oo(o)((o)))
   70: (o((o))(oo))
   78: (o(o)(o(o)))
   91: ((oo)(o(o)))
   92: (oo((o)(o)))
   95: (((o))(ooo))
  102: (o(o)((oo)))
  111: ((o)(oo(o)))
  119: ((oo)((oo)))
  122: (o(o(o)(o)))
  129: ((o)(o(oo)))
  146: (o((o)(oo)))
  151: ((oo(o)(o)))
  181: ((o(o)(oo)))
  201: ((o)((ooo)))
  227: (((oo)(oo)))
		

Crossrefs

Any number of leaves: A358576, counted by A358587 (ordered A358588).
Any number of internals: A358577, counted by A358589, ordered A358590.
Any height: A358578, ordered A358579, counted by A185650.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height.
A055277 counts rooted trees by nodes and leaves, ordered A001263.

Programs

  • Mathematica
    MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],Count[MGTree[#],[_],{0,Infinity}]==Count[MGTree[#],{},{0,Infinity}]==Depth[MGTree[#]]-1&]

Formula

A358552(a(n)) = A342507(a(n)) = A109129(a(n)).

A358588 Number of n-node ordered rooted trees of height equal to the number of internal (non-leaf) nodes.

Original entry on oeis.org

0, 0, 0, 0, 1, 8, 41, 171, 633, 2171, 7070, 22195, 67830, 203130, 598806, 1743258, 5023711, 14356226, 40737383, 114904941, 322432215, 900707165, 2506181060, 6948996085, 19207795836, 52944197508, 145567226556, 399314965956, 1093107693133, 2986640695436
Offset: 1

Views

Author

Gus Wiseman, Nov 25 2022

Keywords

Examples

			The a(5) = 1 and a(6) = 8 ordered trees:
  ((o)(o))  ((o)(o)o)
            ((o)(oo))
            ((o)o(o))
            ((oo)(o))
            (o(o)(o))
            (((o))(o))
            (((o)(o)))
            ((o)((o)))
		

Crossrefs

For leaves instead of height we have A000891, unordered A185650 aerated.
The unordered version is A358587, ranked by A358576.
For leaves instead of internal nodes we have A358590, unordered A358589.
A000108 counts ordered rooted trees, unordered A000081.
A001263 counts ordered rooted trees by nodes and leaves, unordered A055277.
A080936 counts ordered rooted trees by nodes and height, unordered A034781.
A090181 counts ordered rooted trees by nodes and internals, unord. A358575.

Programs

  • Mathematica
    aot[n_]:=If[n==1,{{}},Join@@Table[Tuples[aot/@c],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[Select[aot[n],Count[#,[_],{0,Infinity}]==Depth[#]-1&]],{n,1,10}]
  • PARI
    \\ Needs R(n,f) defined in A358590.
    seq(n) = {Vec(R(n, (h,p)->polcoef(subst(p, x, x/y), -h, y)), -n)} \\ Andrew Howroyd, Jan 01 2023

Formula

Conjectures from Chai Wah Wu, Apr 14 2024: (Start)
a(n) = 9*a(n-1) - 32*a(n-2) + 58*a(n-3) - 58*a(n-4) + 32*a(n-5) - 9*a(n-6) + a(n-7) for n > 7.
G.f.: x^5*(-x^2 + x - 1)/((x - 1)^3*(x^2 - 3*x + 1)^2). (End)

Extensions

Terms a(16) and beyond from Andrew Howroyd, Jan 01 2023

A358584 Number of rooted trees with n nodes, at most half of which are leaves.

Original entry on oeis.org

0, 1, 1, 3, 5, 15, 28, 87, 176, 550, 1179, 3688, 8269, 25804, 59832, 186190, 443407, 1375388, 3346702, 10348509, 25632265, 79020511, 198670299, 610740694, 1555187172, 4768244803, 12276230777, 37546795678, 97601239282, 297831479850, 780790439063, 2377538260547
Offset: 1

Views

Author

Gus Wiseman, Nov 23 2022

Keywords

Examples

			The a(2) = 1 through a(6) = 15 trees:
  (o)  ((o))  ((oo))   (((oo)))   (((ooo)))
              (o(o))   ((o)(o))   ((o)(oo))
              (((o)))  ((o(o)))   ((o(oo)))
                       (o((o)))   ((oo(o)))
                       ((((o))))  (o((oo)))
                                  (o(o)(o))
                                  (o(o(o)))
                                  (oo((o)))
                                  ((((oo))))
                                  (((o)(o)))
                                  (((o(o))))
                                  ((o)((o)))
                                  ((o((o))))
                                  (o(((o))))
                                  (((((o)))))
		

Crossrefs

For equality we have A185650 aerated, ranked by A358578.
The complement is A358581.
The strict case is A358582.
The opposite version is A358583.
A000081 counts rooted trees, ordered A000108.
A055277 counts rooted trees by nodes and leaves, ordered A001263.
A358575 counts rooted trees by nodes and internal nodes, ordered A090181.
A358589 counts square trees, ranked by A358577, ordered A358590.

Programs

  • Mathematica
    art[n_]:=If[n==1,{{}},Join@@Table[Select[Tuples[art/@c],OrderedQ],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[Select[art[n],Count[#,{},{0,Infinity}]<=Count[#,[_],{0,Infinity}]&]],{n,0,10}]
  • PARI
    R(n) = {my(A = O(x)); for(j=1, n, A = x*(y - 1  + exp( sum(i=1, j, 1/i * subst( subst( A + O(x*x^(j\i)), x, x^i), y, y^i) ) ))); Vec(A)};
    seq(n) = {my(A=R(n)); vector(n, n, vecsum(Vecrev(A[n]/y)[1..n\2]))} \\ Andrew Howroyd, Dec 30 2022

Formula

A358581(n) + A358584(n) = A000081(n).
A358582(n) + A358583(n) = A000081(n).
a(n) = Sum_{k=1..floor(n/2)} A055277(n, k). - Andrew Howroyd, Dec 30 2022

Extensions

Terms a(19) and beyond from Andrew Howroyd, Dec 30 2022

A358591 Number of 2n-node rooted trees whose height, number of leaves, and number of internal (non-leaf) nodes are all equal.

Original entry on oeis.org

0, 0, 2, 17, 94, 464, 2162, 9743, 42962, 186584, 801316, 3412034, 14430740, 60700548, 254180426, 1060361147, 4409342954, 18285098288, 75645143516, 312286595342, 1286827096964, 5293833371408, 21745951533236, 89208948855542, 365523293690804, 1496048600896784
Offset: 1

Views

Author

Gus Wiseman, Nov 23 2022

Keywords

Examples

			The a(3) = 2 and a(4) = 17 trees:
  ((o)(oo))  (((o))(ooo))
  (o(o)(o))  (((o)(ooo)))
             (((oo))(oo))
             (((oo)(oo)))
             ((o)((ooo)))
             ((o)(o(oo)))
             ((o)(oo(o)))
             ((o(o)(oo)))
             ((oo)(o(o)))
             ((oo(o)(o)))
             (o((o))(oo))
             (o((o)(oo)))
             (o(o)((oo)))
             (o(o)(o(o)))
             (o(o(o)(o)))
             (oo((o)(o)))
             (oo(o)((o)))
		

Crossrefs

For leaves = internals we have A185650 aerated, ranked by A358578.
For height = internals we have A358587, ranked by A358576, ordered A358588.
For height = leaves we have A358589, ranked by A358577, ordered A358590.
These trees are ranked by A358592.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height, ordered A080936.
A055277 counts rooted trees by nodes and leaves, ordered A001263.
A358575 counts rooted trees by nodes and internal nodes, ordered A090181.

Programs

  • Mathematica
    art[n_]:=If[n==1,{{}},Join@@Table[Select[Tuples[art/@c],OrderedQ],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[Select[art[n],Count[#,[_],{0,Infinity}]==Count[#,{},{0,Infinity}]==Depth[#]-1&]],{n,2,15,2}]
  • PARI
    \\ Needs R(n,f) defined in A358589.
    seq(n) = {Vecrev(R(2*n, (h,p)->if(h<=n, x^h*polcoef(polcoef(p, 2*h, x), h, y))), -n)} \\ Andrew Howroyd, Jan 01 2023

Extensions

Terms a(10) and beyond from Andrew Howroyd, Jan 01 2023

A358582 Number of rooted trees with n nodes, most of which are not leaves.

Original entry on oeis.org

0, 0, 1, 1, 5, 7, 28, 48, 176, 336, 1179, 2420, 8269, 17855, 59832, 134289, 443407, 1025685, 3346702, 7933161, 25632265, 62000170, 198670299, 488801159, 1555187172, 3882403641, 12276230777, 31034921462, 97601239282, 249471619165, 780790439063, 2015194486878
Offset: 1

Views

Author

Gus Wiseman, Nov 23 2022

Keywords

Examples

			The a(3) = 1 through a(6) = 7 trees:
  ((o))  (((o)))  (((oo)))   ((((oo))))
                  ((o)(o))   (((o)(o)))
                  ((o(o)))   (((o(o))))
                  (o((o)))   ((o)((o)))
                  ((((o))))  ((o((o))))
                             (o(((o))))
                             (((((o)))))
		

Crossrefs

For equality we have A185650 aerated, ranked by A358578.
The opposite version is A358581, non-strict A358583.
The non-strict version is A358584.
The ordered version is A358585, odd-indexed terms A065097.
A000081 counts rooted trees, ordered A000108.
A055277 counts rooted trees by nodes and leaves, ordered A001263.
A358575 counts rooted trees by nodes and internal nodes, ordered A090181.
A358589 counts square trees, ranked by A358577, ordered A358590.

Programs

  • Mathematica
    art[n_]:=If[n==1,{{}},Join@@Table[Select[Tuples[art/@c],OrderedQ],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[Select[art[n],Count[#,{},{0,Infinity}][_],{0,Infinity}]&]],{n,0,10}]
  • PARI
    \\ See A358584 for R(n).
    seq(n) = {my(A=R(n)); vector(n, n, vecsum(Vecrev(A[n]/y)[1..(n-1)\2]))} \\ Andrew Howroyd, Dec 30 2022

Formula

A358581(n) + A358584(n) = A000081(n).
A358582(n) + A358583(n) = A000081(n).
a(n) = Sum_{k=1..floor((n-1)/2)} A055277(n, k). - Andrew Howroyd, Dec 30 2022

Extensions

Terms a(19) and beyond from Andrew Howroyd, Dec 30 2022

A358585 Number of ordered rooted trees with n nodes, most of which are leaves.

Original entry on oeis.org

1, 0, 1, 1, 7, 11, 66, 127, 715, 1549, 8398, 19691, 104006, 258194, 1337220, 3467115, 17678835, 47440745, 238819350, 659060677, 3282060210, 9271024542, 45741281820, 131788178171, 644952073662, 1890110798926, 9183676536076, 27316119923002, 131873975875180, 397407983278484
Offset: 1

Views

Author

Gus Wiseman, Nov 24 2022

Keywords

Examples

			The a(1) = 1 through a(6) = 11 ordered trees:
  o  .  (oo)  (ooo)  (oooo)   (ooooo)
                     ((o)oo)  ((o)ooo)
                     ((oo)o)  ((oo)oo)
                     ((ooo))  ((ooo)o)
                     (o(o)o)  ((oooo))
                     (o(oo))  (o(o)oo)
                     (oo(o))  (o(oo)o)
                              (o(ooo))
                              (oo(o)o)
                              (oo(oo))
                              (ooo(o))
		

Crossrefs

For equality we have A000891, unordered A185650.
Odd-indexed terms are A065097.
The unordered version is A358581.
The opposite is the same, unordered A358582.
The non-strict version is A358586, unordered A358583.
A000108 counts ordered rooted trees, unordered A000081.
A001263 counts ordered rooted trees by nodes and leaves, unordered A055277.
A080936 counts ordered rooted trees by nodes and height, unordered A034781.
A090181 counts ordered rooted trees by nodes and internals, unord. A358575.
A358590 counts square ordered trees, unordered A358589 (ranked by A358577).

Programs

  • Mathematica
    aot[n_]:=If[n==1,{{}},Join@@Table[Tuples[aot/@c],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[Select[aot[n],Count[#,{},{0,Infinity}]>Count[#,[_],{0,Infinity}]&]],{n,10}]
  • PARI
    a(n) = if(n==1, 1, n--; (binomial(2*n,n)/(n+1) - if(n%2, binomial(n, (n-1)/2)^2 / n))/2) \\ Andrew Howroyd, Jan 13 2024

Formula

From Andrew Howroyd, Jan 13 2024: (Start)
a(n) = Sum_{k=1..floor((n-1)/2)} A001263(n-1, k) for n >= 2.
a(2*n) = (A000108(2*n-1) - A000891(n-1))/2 for n >= 1;
a(2*n+1) = A000108(2*n)/2 for n >= 1. (End)

Extensions

a(16) onwards from Andrew Howroyd, Jan 13 2024

A358583 Number of rooted trees with n nodes, at least half of which are leaves.

Original entry on oeis.org

1, 1, 1, 3, 4, 13, 20, 67, 110, 383, 663, 2346, 4217, 15118, 27979, 101092, 191440, 695474, 1341974, 4893067, 9589567, 35055011, 69612556, 254923825, 511987473, 1877232869, 3807503552, 13972144807, 28585315026, 104955228432, 216381073935, 794739865822
Offset: 1

Views

Author

Gus Wiseman, Nov 23 2022

Keywords

Examples

			The a(1) = 1 through a(6) = 13 trees:
  o  (o)  (oo)  (ooo)   (oooo)   (ooooo)
                ((oo))  ((ooo))  ((oooo))
                (o(o))  (o(oo))  (o(ooo))
                        (oo(o))  (oo(oo))
                                 (ooo(o))
                                 (((ooo)))
                                 ((o)(oo))
                                 ((o(oo)))
                                 ((oo(o)))
                                 (o((oo)))
                                 (o(o)(o))
                                 (o(o(o)))
                                 (oo((o)))
		

Crossrefs

For equality we have A185650 aerated, ranked by A358578.
The strict case is A358581.
The opposite version is A358584, strict A358582.
The ordered version is A358586, strict A358585.
A000081 counts rooted trees, ordered A000108.
A055277 counts rooted trees by nodes and leaves, ordered A001263.
A358575 counts rooted trees by nodes and internal nodes, ordered A090181.
A358589 counts square rooted trees, ranked by A358577, ordered A358590.

Programs

  • Mathematica
    art[n_]:=If[n==1,{{}},Join@@Table[Select[Tuples[art/@c],OrderedQ],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[Select[art[n],Count[#,{},{0,Infinity}]>=Count[#,[_],{0,Infinity}]&]],{n,1,10}]
  • PARI
    \\ See A358584 for R(n).
    seq(n) = {my(A=R(n)); vector(n, n, my(u=Vecrev(A[n]/y)); vecsum(u[(n-1)\2+1..#u]))} \\ Andrew Howroyd, Dec 31 2022

Formula

A358581(n) + A358584(n) = A000081(n).
A358582(n) + A358583(n) = A000081(n).
a(n) = Sum_{k=floor((n-1)/2)+1..n} A055277(n, k). - Andrew Howroyd, Dec 31 2022

Extensions

Terms a(19) and beyond from Andrew Howroyd, Dec 31 2022

A358728 Number of n-node rooted trees whose node-height is less than their number of leaves.

Original entry on oeis.org

0, 0, 0, 1, 1, 5, 10, 30, 76, 219, 582, 1662, 4614, 13080, 36903, 105098, 298689, 852734, 2434660, 6964349, 19931147, 57100177, 163647811, 469290004, 1346225668, 3863239150, 11089085961, 31838349956, 91430943515, 262615909503, 754439588007, 2167711283560
Offset: 1

Views

Author

Gus Wiseman, Nov 29 2022

Keywords

Comments

Node-height is the number of nodes in the longest path from root to leaf.

Examples

			The a(1) = 0 through a(7) = 10 trees:
  .  .  .  (ooo)  (oooo)  (ooooo)   (oooooo)
                          ((oooo))  ((ooooo))
                          (o(ooo))  (o(oooo))
                          (oo(oo))  (oo(ooo))
                          (ooo(o))  (ooo(oo))
                                    (oooo(o))
                                    ((o)(ooo))
                                    ((oo)(oo))
                                    (o(o)(oo))
                                    (oo(o)(o))
		

Crossrefs

These trees are ranked by A358727.
For internals instead of node-height we have A358581, ordered A358585.
The case of equality is A358589 (square trees), ranked by A358577.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height, ordered A080936.
A055277 counts rooted trees by nodes and leaves, ordered A001263.

Programs

  • Mathematica
    art[n_]:=If[n==1,{{}},Join@@Table[Select[Tuples[art/@c],OrderedQ],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[Select[art[n],Depth[#]-1
    				
  • PARI
    \\ Needs R(n,f) defined in A358589.
    seq(n) = {Vec(R(n, (h,p)->sum(j=h+1, n-1, polcoef(p,j,y))), -n)} \\ Andrew Howroyd, Jan 01 2023

Extensions

Terms a(19) and beyond from Andrew Howroyd, Jan 01 2023

A358723 Number of n-node rooted trees of edge-height equal to their number of leaves.

Original entry on oeis.org

0, 1, 0, 2, 1, 6, 7, 26, 43, 135, 276, 755, 1769, 4648, 11406, 29762, 75284, 195566, 503165, 1310705, 3402317, 8892807, 23231037, 60906456, 159786040, 420144405, 1105673058, 2914252306, 7688019511, 20304253421, 53667498236, 141976081288, 375858854594, 995728192169
Offset: 1

Views

Author

Gus Wiseman, Nov 29 2022

Keywords

Comments

Edge-height (A109082) is the number of edges in the longest path from root to leaf.

Examples

			The a(1) = 0 through a(7) = 7 trees:
  .  (o)  .  ((oo))  ((o)(o))  (((ooo)))  (((o))(oo))
             (o(o))            ((o(oo)))  (((o)(oo)))
                               ((oo(o)))  ((o)((oo)))
                               (o((oo)))  ((o)(o(o)))
                               (o(o(o)))  ((o(o)(o)))
                               (oo((o)))  (o((o)(o)))
                                          (o(o)((o)))
		

Crossrefs

For internals instead of leaves: A011782, ranked by A209638.
For internals instead of edge-height: A185650 aerated, ranked by A358578.
For node-height: A358589 (square trees), ranked by A358577, ordered A358590.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height, ordered A080936.
A055277 counts rooted trees by nodes and leaves, ordered A001263.
A358575 counts rooted trees by nodes and internals, ordered A090181.

Programs

  • Mathematica
    art[n_]:=If[n==1,{{}},Join@@Table[Select[Tuples[art/@c],OrderedQ],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[Select[art[n],Count[#,{},{-2}]==Depth[#]-2&]],{n,1,10}]
  • PARI
    \\ Needs R(n,f) defined in A358589.
    seq(n) = {Vec(R(n, (h,p)->polcoef(p,h-1,y)), -n)} \\ Andrew Howroyd, Jan 01 2023

Extensions

Terms a(19) and beyond from Andrew Howroyd, Jan 01 2023
Previous Showing 11-20 of 20 results.