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-10 of 48 results. Next

A109082 Depth of rooted tree having Matula-Goebel number n.

Original entry on oeis.org

0, 1, 2, 1, 3, 2, 2, 1, 2, 3, 4, 2, 3, 2, 3, 1, 3, 2, 2, 3, 2, 4, 3, 2, 3, 3, 2, 2, 4, 3, 5, 1, 4, 3, 3, 2, 3, 2, 3, 3, 4, 2, 3, 4, 3, 3, 4, 2, 2, 3, 3, 3, 2, 2, 4, 2, 2, 4, 4, 3, 3, 5, 2, 1, 3, 4, 3, 3, 3, 3, 4, 2, 3, 3, 3, 2, 4, 3, 5, 3, 2, 4, 4, 2, 3, 3, 4, 4, 3, 3, 3, 3, 5, 4, 3, 2, 4, 2, 4, 3
Offset: 1

Views

Author

Keith Briggs, Aug 17 2005

Keywords

Comments

Another term for depth is height.
Starting with n, a(n) is the number of times one must take the product of prime indices (A003963) to reach 1. - Gus Wiseman, Mar 27 2019

Examples

			a(7) = 2 because the rooted tree with Matula-Goebel number 7 is the 3-edge rooted tree Y of height 2.
		

Crossrefs

A left inverse of A007097.
Cf. A000081, A000720, A001222, A109129, A112798, A196050, A290822, A317713, A320325, A324927 (positions of 2), A324928 (positions of 3), A325032.
This statistic is counted by A034781, ordered A080936.
The ordered version is A358379.
For node-height instead of edge-height we have A358552.

Programs

  • Maple
    with(numtheory): a := proc(n) option remember; if n = 1 then 0 elif isprime(n) then 1+a(pi(n)) else max((map (p->a(p), factorset(n)))[]) end if end proc: seq(a(n), n = 1 .. 100); # Emeric Deutsch, Sep 16 2011
  • Mathematica
    a [n_] := a[n] = If[n == 1, 0, If[PrimeQ[n], 1+a[PrimePi[n]], Max[Map[a, FactorInteger[n][[All, 1]]]]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, May 06 2014, after Emeric Deutsch *)
  • PARI
    a(n) = my(v=factor(n)[,1],d=0); while(#v,d++; v=fold(setunion, apply(p->factor(primepi(p))[,1]~, v))); d; \\ Kevin Ryde, Sep 21 2020
    
  • Python
    from functools import lru_cache
    from sympy import isprime, primepi, primefactors
    @lru_cache(maxsize=None)
    def A109082(n):
        if n == 1 : return 0
        if isprime(n): return 1+A109082(primepi(n))
        return max(A109082(p) for p in primefactors(n)) # Chai Wah Wu, Mar 19 2022

Formula

a(1)=0; if n is the t-th prime, then a(n) = 1 + a(t); if n is composite, n=t*s, then a(n) = max(a(t),a(s)). The Maple program is based on this.
a(A007097(n)) = n.
a(n) = A358552(n) - 1. - Gus Wiseman, Nov 27 2022

Extensions

Edited by Emeric Deutsch, Sep 16 2011

A000065 -1 + number of partitions of n.

Original entry on oeis.org

0, 0, 1, 2, 4, 6, 10, 14, 21, 29, 41, 55, 76, 100, 134, 175, 230, 296, 384, 489, 626, 791, 1001, 1254, 1574, 1957, 2435, 3009, 3717, 4564, 5603, 6841, 8348, 10142, 12309, 14882, 17976, 21636, 26014, 31184, 37337, 44582, 53173, 63260, 75174, 89133, 105557, 124753
Offset: 0

Views

Author

Keywords

Comments

a(n+1) is the number of noncongruent n-dimensional integer-sided simplices with diameter n. - Sascha Kurz, Jul 26 2004
Also, the number of partitions of n into parts each less than n.
Also, the number of distinct types of equation which can be derived from the equation [n,0,0] not including itself. (Ince)
Also, the number of rooted trees on n+1 nodes with height exactly 2.
Also, the number of partitions (of any positive integer) whose sum + length is <= n. Example: a(5) = 6 counts 4, 3, 21, 2, 11, 1. Proof: Given a partition of n other than the all 1s partition, subtract 1 from each part and then drop the zeros. This is a bijection to the partitions with sum + length <= n. - David Callan, Nov 29 2007
Number of graphs with n vertices of treewidth n-2. Reason: The complement of a graph with n vertices and treewidth >= n-2 cannot have P3 or K3 as a subgraph (Chlebı́ková 2002, Theorem 10), so every component of it is a star. - Martín Muñoz, Dec 31 2023

Examples

			G.f. = x^2 + 2*x^3 + 4*x^4 + 6*x^5 + 10*x^6 + 14*x^7 + 21*x^8 + 29*x^9 + ...
		

References

  • E. L. Ince, Ordinary Differential Equations, Dover Publications, New York, 1944, p. 498; MR0010757.
  • 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).

Crossrefs

A000041 - 1. A column of A058716. A diagonal of A263294.
Column h=2 of A034781.

Programs

  • Magma
    [NumberOfPartitions(n)-1: n in [0..50]]; // Vincenzo Librandi, Aug 25 2013
  • Maple
    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:A:=n -> count(ZL(2),size=n)-count(ZL(1),size=n): seq(A(n),n=1..46); # Zerinvary Lajos, Dec 05 2007
    ZL :=[S, {S = Set(Cycle(Z),1 < card)}, unlabelled]: seq(combstruct[count](ZL, size=n), n=0..45); # Zerinvary Lajos, Mar 25 2008
  • Mathematica
    nn=40;CoefficientList[Series[Product[1/(1-x^i),{i,1,nn}]-1/(1-x),{x,0,nn}],x]  (* Geoffrey Critzer, Oct 28 2012 *)
    PartitionsP[Range[0,50]]-1 (* Harvey P. Dale, Aug 24 2013 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( 1 / eta(x + x*O(x^n)), n) - 1)};
    
  • PARI
    {a(n) = if( n<0, 0, numbpart(n) - 1)};
    

Formula

a(n) = A026820(n,n-1) for n>1. - Reinhard Zumkeller, Jan 21 2010
G.f.: x*G(0)/(x-1) where G(k) = 1 - 1/(1-x^(k+1))/(1-x/(x-1/G(k+1) )); (recursively defined continued fraction). - Sergei N. Gladkovskii, Jan 23 2013
G.f.: Sum_{k>=2} x^k / Product_{j=1..k} (1 - x^j). - Ilya Gutkovskiy, Sep 07 2021

A080936 Triangle read by rows: T(n,k) is the number of Dyck paths of semilength n and height k (1 <= k <= n).

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 7, 5, 1, 1, 15, 18, 7, 1, 1, 31, 57, 33, 9, 1, 1, 63, 169, 132, 52, 11, 1, 1, 127, 482, 484, 247, 75, 13, 1, 1, 255, 1341, 1684, 1053, 410, 102, 15, 1, 1, 511, 3669, 5661, 4199, 1975, 629, 133, 17, 1, 1, 1023, 9922, 18579, 16017, 8778, 3366, 912, 168, 19, 1
Offset: 1

Views

Author

Henry Bottomley, Feb 25 2003

Keywords

Comments

Sum of entries in row n is A000108(n) (the Catalan numbers).
From Gus Wiseman, Nov 16 2022: (Start)
Also the number of unlabeled ordered rooted trees with n nodes and height k. For example, row n = 5 counts the following trees:
(oooo) ((o)oo) (((o))o) ((((o))))
((oo)o) (((o)o))
((ooo)) (((oo)))
(o(o)o) ((o(o)))
(o(oo)) (o((o)))
(oo(o))
((o)(o))
(End)

Examples

			T(3,2)=3 because we have UUDDUD, UDUUDD, and UUDUDD, where U=(1,1) and D=(1,-1). The other two Dyck paths of semilength 3, UDUDUD and UUUDDD, have heights 1 and 3, respectively. - _Emeric Deutsch_, Jun 08 2011
Triangle starts:
  1;
  1,  1;
  1,  3,   1;
  1,  7,   5,   1;
  1, 15,  18,   7,  1;
  1, 31,  57,  33,  9,  1;
  1, 63, 169, 132, 52, 11, 1;
		

References

  • N. G. de Bruijn, D. E. Knuth, and S. O. Rice, The average height of planted plane trees, in: Graph Theory and Computing (ed. T. C. Read), Academic Press, New York, 1972, pp. 15-22.

Crossrefs

T(2n,n) gives A268316.
Counting by leaves instead of height gives A001263.
The unordered version is A034781.
The height statistic is ranked by A358379, unordered A109082.

Programs

  • Maple
    f := proc (k) options operator, arrow:
       sum(binomial(k-i, i)*(-z)^i, i = 0 .. floor((1/2)*k))
    end proc:
    h := proc (k) options operator, arrow:
       z^k/(f(k)*f(k+1))
    end proc:
    T := proc (n, k) options operator, arrow:
       coeff(series(h(k), z = 0, 25), z, n)
    end proc:
    for n to 11 do seq(T(n, k), k = 1 .. n) end do; # yields sequence in triangular form Emeric Deutsch, Jun 08 2011
    # second Maple program:
    b:= proc(x, y, k) option remember; `if`(y>min(k, x) or y<0, 0,
          `if`(x=0, 1, b(x-1, y-1, k)+ b(x-1, y+1, k)))
        end:
    T:= (n, k)-> b(2*n, 0, k) -`if`(k=0, 0, b(2*n, 0, k-1)):
    seq(seq(T(n, k), k=1..n), n=1..14);  # Alois P. Heinz, Aug 06 2012
  • Mathematica
    b[x_, y_, k_] := b[x, y, k] = If[y > Min[k, x] || y<0, 0, If[x == 0, 1, b[x-1, y-1, k] + b[x-1, y+1, k]]]; T[n_, k_] := b[2*n, 0, k] - If[k == 0, 0, b[2*n, 0, k-1] ]; Table[Table[T[n, k], {k, 1, n}], {n, 1, 14}] // Flatten (* Jean-François Alcover, Feb 26 2015, after Alois P. Heinz *)
    aot[n_]:=If[n==1,{{}},Join@@Table[Tuples[aot/@c],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[Select[aot[n],Depth[#]-2==k&]],{n,1,9},{k,1,n-1}] (* Gus Wiseman, Nov 16 2022 *)

Formula

T(n, k) = A080934(n, k) - A080934(n, k-1).
The g.f. for Dyck paths of height k is h(k) = z^k/(f(k)*f(k+1)), where f(k) are Fibonacci type polynomials defined by f(0)=f(1)=1, f(k)=f(k-1)-z*f(k-2) or by f(k) = Sum_{i=0..floor(k/2)} binomial(k-i,i)*(-z)^i. Incidentally, the g.f. for Dyck paths of height at most k is H(k) = f(k)/f(k+1). - Emeric Deutsch, Jun 08 2011
For all n >= 1 and floor((n+1)/2) <= k <= n we have: T(n,k) = 2*(2*k+3)*(2*k^2+6*k+1-3*n)*(2*n)!/((n-k)!*(n+k+3)!). - Gheorghe Coserea, Dec 06 2015
T(n, k) = Sum_{i=1..k-1} (-1)^(i+1) * (Sum_{j=1..n} (Sum_{x=0..n} (-1)^(j+x) * binomial(x+2n-2j+1,x))) * a(k-i); a(1)=1, a(0)=0. - Tim C. Flowers, May 14 2018

A185650 a(n) is the number of rooted trees with 2n vertices n of whom are leaves.

Original entry on oeis.org

1, 2, 8, 39, 214, 1268, 7949, 51901, 349703, 2415348, 17020341, 121939535, 885841162, 6511874216, 48359860685, 362343773669, 2736184763500, 20805175635077, 159174733727167, 1224557214545788, 9467861087020239, 73534456468877012, 573484090227222260
Offset: 1

Views

Author

Stepan Orevkov, Aug 29 2013

Keywords

Examples

			From _Gus Wiseman_, Nov 27 2022: (Start)
The a(1) = 1 through a(3) = 8 rooted trees:
  (o)  ((oo))  (((ooo)))
       (o(o))  ((o)(oo))
               ((o(oo)))
               ((oo(o)))
               (o((oo)))
               (o(o)(o))
               (o(o(o)))
               (oo((o)))
(End)
		

Crossrefs

The ordered version is A000891, ranked by A358579.
This is the central column of A055277.
These trees are ranked by A358578.
For height = internals we have A358587.
Square trees are counted by A358589.
A000081 counts rooted trees, ordered A000108.
A055277 counts rooted trees by nodes and leaves, ordered A001263.
A358575 counts rooted trees by nodes and internals, ordered A090181.

Programs

  • Mathematica
    terms = 23;
    m = 2 terms;
    T[, ] = 0;
    Do[T[x_, z_] = z x - x + x Exp[Sum[Series[1/k T[x^k, z^k], {x, 0, j}, {z, 0, j}], {k, 1, j}]] // Normal, {j, 1, m}];
    cc = CoefficientList[#, z]& /@ CoefficientList[T[x, z] , x];
    Table[cc[[2n+1, n+1]], {n, 1, terms}] (* Jean-François Alcover, Sep 14 2018 *)
    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}]==n/2&]],{n,2,10,2}] (* Gus Wiseman, Nov 27 2022 *)
  • PARI
    \\ here R is A055277 as vector of polynomials
    R(n) = {my(A = O(x)); for(j=1, n, A = x*(y - 1  + exp( sum(i=1, j, 1/i * subst( subst( A + x * O(x^(j\i)), x, x^i), y, y^i) ) ))); Vec(A)};
    {my(A=R(2*30)); vector(#A\2, k, polcoeff(A[2*k],k))} \\ Andrew Howroyd, May 21 2018

Extensions

Terms a(20) and beyond from Andrew Howroyd, May 21 2018

A342507 Number of internal nodes in rooted tree with Matula-Goebel number n.

Original entry on oeis.org

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

Views

Author

François Marques, Mar 14 2021

Keywords

Comments

The label f(T) for a rooted tree T is 1 if T has 1 node, otherwise f(T) = Product_{T_i} prime(f(T_i)) where the T_i are the subtrees obtained by deleting the root and the edges adjacent to it. (Cf. A061773 for illustration.)

Examples

			a(7) = 2 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y.
a(2^m) = 1 because the rooted tree with Matula-Goebel number 2^m is the star tree with m edges.
		

Crossrefs

Other statistics are: A061775 (nodes), A109082 (edge-height), A109129 (leaves), A196050 (edges), A358552 (node-height).
An ordered version is A358553.
Positions of first appearances are A358554.
A000081 counts rooted trees, ordered A000108.
A358575 counts rooted trees by nodes and internals.

Programs

  • Mathematica
    MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Count[MGTree[n],[_],{0,Infinity}],{n,100}] (* Gus Wiseman, Nov 28 2022 *)
  • PARI
    A342507(n) = if( n==1, 0, my(f=factor(n)); 1+sum(k=1,matsize(f)[1],A342507(primepi(f[k,1]))*f[k,2]));

Formula

a(1)=0 and a(n) = A061775(n) - A109129(n) for n > 1.

A358577 Matula-Goebel numbers of "square" rooted trees, i.e., whose height equals their number of leaves.

Original entry on oeis.org

1, 4, 12, 14, 18, 19, 21, 27, 40, 52, 60, 68, 70, 74, 78, 86, 89, 90, 91, 92, 95, 100, 102, 105, 107, 111, 117, 119, 122, 129, 130, 134, 135, 138, 146, 150, 151, 153, 161, 163, 169, 170, 175, 176, 181, 183, 185, 195, 201, 206, 207, 215, 219, 221, 225, 227, 230
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:
   1: o
   4: (oo)
  12: (oo(o))
  14: (o(oo))
  18: (o(o)(o))
  19: ((ooo))
  21: ((o)(oo))
  27: ((o)(o)(o))
  40: (ooo((o)))
  52: (oo(o(o)))
  60: (oo(o)((o)))
  68: (oo((oo)))
  70: (o((o))(oo))
  74: (o(oo(o)))
  78: (o(o)(o(o)))
  86: (o(o(oo)))
  89: ((ooo(o)))
  90: (o(o)(o)((o)))
		

Crossrefs

Internals instead of leaves: A358576, counted by A358587, ordered A358588.
Internals instead of height: A358578, counted by A185650, ordered A358579.
These trees are counted by A358589, ordered A358590.
A000081 counts rooted trees, ordered A000108.
A034781 counts trees by nodes and height.
A055277 counts 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}]==Depth[MGTree[#]]-1&]

Formula

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

A358552 Node-height of the rooted tree with Matula-Goebel number n. Number of nodes in the longest path from root to leaf.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 26 2022

Keywords

Comments

Edge-height is given by A109082 (see formula).
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 Matula-Goebel number of ((ooo(o))) is 89, and it has node-height 4, so a(89) = 4.
		

Crossrefs

Positions of first appearances are A007097.
This statistic is counted by A034781, ordered A080936.
The ordered version is A358379(n) + 1.
A000081 counts rooted trees, ordered A000108.
A055277 counts rooted trees by nodes and leaves, ordered A001263.
Other statistics: A061775 (nodes), A109082 (edge-height), A109129 (leaves), A196050 (edges), A342507 (internals).

Programs

  • Mathematica
    MGTree[n_]:=If[n==1,{},MGTree/@If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]];
    Table[Depth[MGTree[n]]-1,{n,100}]
  • PARI
    A358552(n) = { my(v=factor(n)[, 1], d=0); while(#v, d++; v=fold(setunion, apply(p->factor(primepi(p))[, 1]~, v))); (1+d); }; \\ (after Kevin Ryde in A109082) - Antti Karttunen, Oct 23 2023
    
  • Python
    from functools import lru_cache
    from sympy import isprime, primepi, primefactors
    @lru_cache(maxsize=None)
    def A358552(n):
        if n == 1 : return 1
        if isprime(n): return 1+A358552(primepi(n))
        return max(A358552(p) for p in primefactors(n)) # Chai Wah Wu, Apr 15 2024

Formula

a(n) = A109082(n) + 1.
a(n) = A061775(n) - A358729(n). - Antti Karttunen, Oct 23 2023

Extensions

Data section extended up to a(108) by Antti Karttunen, Oct 23 2023

A358578 Matula-Goebel numbers of rooted trees whose number of leaves equals their number of internal (non-leaf) nodes.

Original entry on oeis.org

2, 6, 7, 18, 20, 21, 26, 34, 37, 43, 54, 60, 63, 67, 70, 78, 88, 91, 92, 95, 102, 111, 116, 119, 122, 129, 142, 146, 151, 162, 164, 173, 180, 181, 189, 200, 201, 202, 210, 227, 234, 236, 239, 245, 260, 264, 269, 273, 276, 278, 285, 306, 308, 314, 322, 333, 337
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:
   2: (o)
   6: (o(o))
   7: ((oo))
  18: (o(o)(o))
  20: (oo((o)))
  21: ((o)(oo))
  26: (o(o(o)))
  34: (o((oo)))
  37: ((oo(o)))
  43: ((o(oo)))
  54: (o(o)(o)(o))
  60: (oo(o)((o)))
  63: ((o)(o)(oo))
  67: (((ooo)))
  70: (o((o))(oo))
  78: (o(o)(o(o)))
  88: (ooo(((o))))
  91: ((oo)(o(o)))
		

Crossrefs

These trees are counted by A185650, ordered A358579.
Height instead of leaves: A358576, counted by A358587, ordered A358588.
Height instead of internals: A358577, counted by A358589, ordered A358590.
Positions of 0's in A358580.
A000081 counts rooted trees, ordered A000108.
A034781 counts trees by nodes and height.
A055277 counts 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}]&]

Formula

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

A358589 Number of square rooted trees with n nodes.

Original entry on oeis.org

1, 0, 1, 0, 3, 2, 11, 17, 55, 107, 317, 720, 1938, 4803, 12707, 32311, 85168, 220879, 581112, 1522095, 4014186, 10568936, 27934075, 73826753, 195497427, 517927859, 1373858931, 3646158317, 9684878325, 25737819213, 68439951884, 182070121870, 484583900955, 1290213371950
Offset: 1

Views

Author

Gus Wiseman, Nov 23 2022

Keywords

Comments

We say that a tree is square if it has the same height as number of leaves.

Examples

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

Crossrefs

For internals instead of height we have A185650 aerated, ranked by A358578.
These trees are ranked by A358577.
For internals instead of leaves we have A358587, ranked by A358576.
The ordered version is 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 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}]==Depth[#]-1&]],{n,1,10}]
  • PARI
    \\ 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  + exp( sum(i=1, n-1, 1/i * subst( subst( A + O(x*x^((n-1)\i)), x, x^i), y, y^i) ) )); Z += f(h, A-p)); Z}
    seq(n) = {Vec(R(n, (h,p)->polcoef(p,h,y)), -n)} \\ Andrew Howroyd, Jan 01 2023

Extensions

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

A358576 Matula-Goebel numbers of rooted trees whose node-height equals their number of internal (non-leaf) nodes.

Original entry on oeis.org

9, 15, 18, 21, 23, 30, 33, 35, 36, 39, 42, 46, 47, 49, 51, 57, 60, 61, 66, 70, 72, 73, 77, 78, 83, 84, 87, 91, 92, 93, 94, 95, 98, 102, 111, 113, 114, 119, 120, 122, 123, 129, 132, 133, 137, 140, 144, 146, 149, 151, 154, 156, 159, 166, 167, 168, 174, 177, 181
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.
Node-height is the number of nodes in the longest path from root to leaf.

Examples

			The terms together with their corresponding rooted trees begin:
   9: ((o)(o))
  15: ((o)((o)))
  18: (o(o)(o))
  21: ((o)(oo))
  23: (((o)(o)))
  30: (o(o)((o)))
  33: ((o)(((o))))
  35: (((o))(oo))
  36: (oo(o)(o))
  39: ((o)(o(o)))
  42: (o(o)(oo))
  46: (o((o)(o)))
  47: (((o)((o))))
  49: ((oo)(oo))
  51: ((o)((oo)))
  57: ((o)(ooo))
  60: (oo(o)((o)))
  61: ((o(o)(o)))
		

Crossrefs

The version for edge-height is A209638.
Square trees are A358577, counted by A358589, ordered A358590.
The version for leaves instead of height is A358578, counted by A185650.
These trees are counted by A358587, ordered A358588.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height.
A055277 counts rooted trees by 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}]==Depth[MGTree[#]]-1&]

Formula

A358552(a(n)) = A342507(a(n)).
Showing 1-10 of 48 results. Next