A358580
Difference between the number of leaves and the number of internal (non-leaf) nodes in the rooted tree with Matula-Goebel number n.
Original entry on oeis.org
1, 0, -1, 1, -2, 0, 0, 2, -1, -1, -3, 1, -1, 1, -2, 3, -1, 0, 1, 0, 0, -2, -2, 2, -3, 0, -1, 2, -2, -1, -4, 4, -3, 0, -1, 1, 0, 2, -1, 1, -2, 1, 0, -1, -2, -1, -3, 3, 1, -2, -1, 1, 2, 0, -4, 3, 1, -1, -2, 0, -1, -3, 0, 5, -2, -2, 0, 1, -2, 0, -1, 2, -1, 1, -3
Offset: 1
The Matula-Goebel number of ((ooo(o))) is 89, and it has 4 leaves and 3 internal nodes, so a(89) = 1.
Positions of nonnegative terms are counted by
A358583, nonpositive
A358584.
A034781 counts trees by nodes and height.
-
MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
Table[Count[MGTree[n],{},{0,Infinity}]-Count[MGTree[n],[_],{0,Infinity}],{n,100}]
A358590
Number of square ordered rooted trees with n nodes.
Original entry on oeis.org
1, 0, 1, 0, 6, 5, 36, 84, 309, 890, 3163, 9835, 32979, 108252, 360696, 1192410, 3984552, 13276769, 44371368, 148402665, 497072593, 1665557619, 5586863093, 18750662066, 62968243731, 211565969511, 711187790166, 2391640404772, 8045964959333, 27077856222546
Offset: 1
The a(1) = 1 through a(6) = 5 ordered trees:
o . (oo) . ((o)oo) ((o)(o)o)
((oo)o) ((o)(oo))
((ooo)) ((o)o(o))
(o(o)o) ((oo)(o))
(o(oo)) (o(o)(o))
(oo(o))
For internals instead of height we have
A000891, unordered
A185650 aerated.
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.
-
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}]
-
\\ R(n,f) enumerates trees by height(h), nodes(x) and leaves(y).
R(n,f) = {my(A=O(x*x^n), Z=0); for(h=1, n, my(p = A); A = x*(y - 1 + 1/(1 - A + O(x^n))); Z += f(h, A-p)); Z}
seq(n) = {Vec(R(n, (h,p)->polcoef(p,h,y)), -n)} \\ Andrew Howroyd, Jan 01 2023
A358586
Number of ordered rooted trees with n nodes, at least half of which are leaves.
Original entry on oeis.org
1, 1, 1, 4, 7, 31, 66, 302, 715, 3313, 8398, 39095, 104006, 484706, 1337220, 6227730, 17678835, 82204045, 238819350, 1108202513, 3282060210, 15195242478, 45741281820, 211271435479, 644952073662, 2971835602526, 9183676536076, 42217430993002, 131873975875180, 604834233372884
Offset: 1
The a(1) = 1 through a(5) = 7 ordered trees:
o (o) (oo) (ooo) (oooo)
((o)o) ((o)oo)
((oo)) ((oo)o)
(o(o)) ((ooo))
(o(o)o)
(o(oo))
(oo(o))
Odd-indexed terms appear to be
A065097.
The opposite is the same, unordered
A358584.
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.
-
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,1,10}]
-
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
A358587
Number of n-node rooted trees of height equal to the number of internal (non-leaf) nodes.
Original entry on oeis.org
0, 0, 0, 0, 1, 4, 14, 41, 111, 282, 688, 1627, 3761, 8540, 19122, 42333, 92851, 202078, 436916, 939359, 2009781, 4281696, 9087670, 19223905, 40544951, 85284194, 178956984, 374691171, 782936761, 1632982372, 3400182458, 7068800357, 14674471611, 30422685030
Offset: 1
The a(5) = 1 through a(7) = 14 trees:
((o)(o)) ((o)(oo)) ((o)(ooo))
(o(o)(o)) ((oo)(oo))
(((o)(o))) (o(o)(oo))
((o)((o))) (oo(o)(o))
(((o))(oo))
(((o)(oo)))
((o)((oo)))
((o)(o(o)))
((o(o)(o)))
(o((o)(o)))
(o(o)((o)))
((((o)(o))))
(((o)((o))))
((o)(((o))))
For leaves instead of height we have
A185650 aerated, ranked by
A358578.
A358575 counts rooted trees by nodes and internal nodes, ordered
A090181.
-
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}]==Depth[#]-1&]],{n,1,10}]
-
\\ Needs R(n,f) defined in A358589.
seq(n) = {Vec(R(n, (h,p)->polcoef(subst(p, x, x/y), -h, y)), -n)} \\ Andrew Howroyd, Jan 01 2023
A358581
Number of rooted trees with n nodes, most of which are leaves.
Original entry on oeis.org
1, 0, 1, 1, 4, 5, 20, 28, 110, 169, 663, 1078, 4217, 7169, 27979, 49191, 191440, 345771, 1341974, 2477719, 9589567, 18034670, 69612556, 132984290, 511987473, 991391707, 3807503552, 7460270591, 28585315026, 56595367747, 216381073935, 432396092153
Offset: 1
The a(1) = 1 through a(7) = 20 trees:
o . (oo) (ooo) (oooo) (ooooo) (oooooo)
((ooo)) ((oooo)) ((ooooo))
(o(oo)) (o(ooo)) (o(oooo))
(oo(o)) (oo(oo)) (oo(ooo))
(ooo(o)) (ooo(oo))
(oooo(o))
(((oooo)))
((o)(ooo))
((o(ooo)))
((oo)(oo))
((oo(oo)))
((ooo(o)))
(o((ooo)))
(o(o)(oo))
(o(o(oo)))
(o(oo(o)))
(oo((oo)))
(oo(o)(o))
(oo(o(o)))
(ooo((o)))
A358575 counts rooted trees by nodes and internal nodes, ordered
A090181.
-
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}]
-
\\ See A358584 for R(n).
seq(n) = {my(A=R(n)); vector(n, n, my(u=Vecrev(A[n]/y)); vecsum(u[n\2+1..#u]))} \\ Andrew Howroyd, Dec 31 2022
A000235
Number of n-node rooted trees of height 3.
Original entry on oeis.org
0, 0, 0, 1, 3, 8, 18, 38, 76, 147, 277, 509, 924, 1648, 2912, 5088, 8823, 15170, 25935, 44042, 74427, 125112, 209411, 348960, 579326, 958077, 1579098, 2593903, 4247768, 6935070, 11290627, 18330973, 29684082, 47946852, 77258764, 124198083
Offset: 1
- N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
-
# For Maple program see link.
with(combstruct):
ZL:= proc(m) local i; [T0, {seq(T||i=Prod(Z, Set(T||(i+1))), i=0..m-1), T||m=Z}, unlabeled] end: A000235:= n-> count(ZL(3), size=n)-count(ZL(2), size=n): seq(A000235(n), n=1..36); # Zerinvary Lajos, Sep 23 2007
-
m = 36; Rest @ CoefficientList[ Series[x*Product[(1-x^k)^(-PartitionsP[k-1]), {k, 1, m}], {x, 0, m}], x] - PartitionsP[Range[0, m-1]] (* Jean-François Alcover, Jul 05 2011, after Christian G. Bower *)
A227819
Number T(n,k) of n-node rooted identity trees of height k; triangle T(n,k), n>=1, 0<=k<=n-1, read by rows.
Original entry on oeis.org
1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 2, 1, 0, 0, 0, 2, 3, 1, 0, 0, 0, 2, 5, 4, 1, 0, 0, 0, 2, 8, 9, 5, 1, 0, 0, 0, 1, 12, 18, 14, 6, 1, 0, 0, 0, 1, 17, 34, 33, 20, 7, 1, 0, 0, 0, 1, 23, 61, 72, 54, 27, 8, 1, 0, 0, 0, 0, 32, 108, 149, 132, 82, 35, 9, 1, 0, 0, 0, 0, 41, 187, 301, 303, 221, 118, 44, 10, 1
Offset: 1
: T(6,4) = 3 : T(11,3) = 1 :
: o o o : o :
: / \ | | : /( )\ :
: o o o o : o o o o :
: | / \ | : /| | | :
: o o o o : o o o o :
: | | / \ : | | :
: o o o o : o o :
: | | | : :
: o o o : :
Triangle T(n,k) begins:
1;
0, 1;
0, 0, 1;
0, 0, 1, 1;
0, 0, 0, 2, 1;
0, 0, 0, 2, 3, 1;
0, 0, 0, 2, 5, 4, 1;
0, 0, 0, 2, 8, 9, 5, 1;
0, 0, 0, 1, 12, 18, 14, 6, 1;
0, 0, 0, 1, 17, 34, 33, 20, 7, 1;
0, 0, 0, 1, 23, 61, 72, 54, 27, 8, 1;
0, 0, 0, 0, 32, 108, 149, 132, 82, 35, 9, 1;
Largest n with T(n,k)>0 is
A038093(k).
-
b:= proc(n, i, k) option remember; `if`(n=0, 1, `if`(i<1 or k<1, 0,
add(binomial(b((i-1)$2, k-1), j)*b(n-i*j, i-1, k), j=0..n/i)))
end:
T:= (n, k)-> b((n-1)$2, k) -`if`(k=0, 0, b((n-1)$2, k-1)):
seq(seq(T(n, k), k=0..n-1), n=1..15);
-
Drop[Transpose[Map[PadRight[#,15]&,Table[f[n_]:=Nest[ CoefficientList[ Series[ Product[(1+x^i)^#[[i]],{i,1,Length[#]}],{x,0,15}],x]&,{1},n]; f[m]-PadRight[f[m-1],Length[f[m]]],{m,1,15}]]],1]//Grid (* Geoffrey Critzer, Aug 01 2013 *)
A358379
Edge-height (or depth) of the n-th standard ordered rooted tree.
Original entry on oeis.org
0, 1, 2, 1, 3, 2, 2, 1, 2, 3, 2, 2, 3, 2, 2, 1, 4, 2, 3, 3, 3, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 1, 3, 4, 2, 2, 3, 3, 3, 3, 2, 3, 2, 2, 3, 2, 2, 2, 4, 2, 3, 3, 3, 2, 2, 2, 2, 3, 2, 2, 3, 2, 2, 1, 3, 3, 4, 4, 3, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 2, 3, 3, 3, 2, 2
Offset: 1
The standard ordered rooted tree ranking begins:
1: o 10: (((o))o) 19: (((o))(o))
2: (o) 11: ((o)(o)) 20: (((o))oo)
3: ((o)) 12: ((o)oo) 21: ((o)((o)))
4: (oo) 13: (o((o))) 22: ((o)(o)o)
5: (((o))) 14: (o(o)o) 23: ((o)o(o))
6: ((o)o) 15: (oo(o)) 24: ((o)ooo)
7: (o(o)) 16: (oooo) 25: (o(oo))
8: (ooo) 17: ((((o)))) 26: (o((o))o)
9: ((oo)) 18: ((oo)o) 27: (o(o)(o))
For example, the 52nd ordered tree is (o((o))oo) so a(52) = 3.
The triangle counting trees by this statistic is
A080936, unordered
A034781.
Node-height is a(n) + 1, unordered version is
A358552.
A000108 counts ordered rooted trees.
A001263 counts ordered rooted trees by leaves.
-
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
srt[n_]:=If[n==1,{},srt/@stc[n-1]];
Table[Depth[srt[n]]-2,{n,100}]
A358575
Triangle read by rows where T(n,k) is the number of unlabeled n-node rooted trees with k = 0..n-1 internal (non-leaf) nodes.
Original entry on oeis.org
1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 4, 1, 0, 1, 4, 8, 6, 1, 0, 1, 5, 14, 18, 9, 1, 0, 1, 6, 21, 39, 35, 12, 1, 0, 1, 7, 30, 72, 97, 62, 16, 1, 0, 1, 8, 40, 120, 214, 212, 103, 20, 1, 0, 1, 9, 52, 185, 416, 563, 429, 161, 25, 1
Offset: 1
Triangle begins:
1
0 1
0 1 1
0 1 2 1
0 1 3 4 1
0 1 4 8 6 1
0 1 5 14 18 9 1
0 1 6 21 39 35 12 1
0 1 7 30 72 97 62 16 1
0 1 8 40 120 214 212 103 20 1
0 1 9 52 185 416 563 429 161 25 1
Column k = n - 2 appears to be
A002620.
Column k = 3 appears to be
A006578.
The version for height instead of internal nodes is
A034781.
-
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}]==k&]],{n,1,10},{k,0,n-1}]
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
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)))
A034781 counts rooted trees by nodes and height.
-
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&]
Comments