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-6 of 6 results.

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

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jun 22 2001

Keywords

Comments

Let p(1)=2, ... denote the primes. The label f(T) for a rooted tree T is 1 if T has 1 node, otherwise f(T) = Product p(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).
Each n occurs A000081(n) times.

Examples

			a(4) = 3 because the rooted tree corresponding to the Matula-Goebel number 4 is "V", which has one root-node and two leaf-nodes, three in total.
See also the illustrations in A061773.
		

Crossrefs

One more than A196050.
Sum of entries in row n of irregular table A214573.
Number of entries in row n of irregular tables A182907, A206491, A206495 and A212620.
One less than the number of entries in row n of irregular tables A184187, A193401 and A193403.
Cf. A005517 (the position of the first occurrence of n).
Cf. A005518 (the position of the last occurrence of n).
Cf. A091233 (their difference plus one).
Cf. A214572 (Numbers k such that a(k) = 8).

Programs

  • Haskell
    import Data.List (genericIndex)
    a061775 n = genericIndex a061775_list (n - 1)
    a061775_list = 1 : g 2 where
       g x = y : g (x + 1) where
          y = if t > 0 then a061775 t + 1 else a061775 u + a061775 v - 1
              where t = a049084 x; u = a020639 x; v = x `div` u
    -- Reinhard Zumkeller, Sep 03 2013
    
  • Maple
    with(numtheory): a := proc (n) local u, v: u := n-> op(1, factorset(n)): v := n-> n/u(n): if n = 1 then 1 elif isprime(n) then 1+a(pi(n)) else a(u(n))+a(v(n))-1 end if end proc: seq(a(n), n = 1..108); # Emeric Deutsch, Sep 19 2011
  • Mathematica
    a[n_] := Module[{u, v}, u = FactorInteger[#][[1, 1]]&; v = #/u[#]&; If[n == 1, 1, If[PrimeQ[n], 1+a[PrimePi[n]], a[u[n]]+a[v[n]]-1]]]; Table[a[n], {n, 108}] (* Jean-François Alcover, Jan 16 2014, after Emeric Deutsch *)
  • PARI
    A061775(n) = if(1==n, 1, if(isprime(n), 1+A061775(primepi(n)), {my(pfs,t,i); pfs=factor(n); pfs[,1]=apply(t->A061775(t),pfs[,1]); (1-bigomega(n)) + sum(i=1, omega(n), pfs[i,1]*pfs[i,2])}));
    for(n=1, 10000, write("b061775.txt", n, " ", A061775(n)));
    \\ Antti Karttunen, Aug 16 2014
    
  • Python
    from functools import lru_cache
    from sympy import isprime, factorint, primepi
    @lru_cache(maxsize=None)
    def A061775(n):
        if n == 1: return 1
        if isprime(n): return 1+A061775(primepi(n))
        return 1+sum(e*(A061775(p)-1) for p, e in factorint(n).items()) # Chai Wah Wu, Mar 19 2022

Formula

a(1) = 1; if n = p_t (= the t-th prime), then a(n) = 1+a(t); if n = uv (u,v>=2), then a(n) = a(u)+a(v)-1.
a(n) = A091238(A091204(n)). - Antti Karttunen, Jan 2004
a(n) = A196050(n)+1. - Antti Karttunen, Aug 16 2014

Extensions

More terms from David W. Wilson, Jun 25 2001
Extended by Emeric Deutsch, Sep 19 2011

A238416 Triangle read by rows: T(n,k) is the number of trees with n vertices having k vertices of degree 2 (n>=2, 0 <= k <= n - 2).

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 2, 0, 1, 2, 3, 2, 3, 0, 1, 4, 4, 7, 3, 4, 0, 1, 5, 9, 10, 12, 5, 5, 0, 1, 10, 15, 25, 20, 22, 6, 7, 0, 1, 14, 31, 46, 54, 38, 34, 9, 8, 0, 1, 26, 57, 103, 111, 114, 65, 53, 11, 10, 0, 1, 42, 114, 204, 267, 250, 212, 108, 76, 15, 12, 0, 1, 78, 219, 440, 583, 644, 502, 383, 167, 110, 18, 14, 0, 1
Offset: 2

Views

Author

Emeric Deutsch, Mar 05 2014

Keywords

Comments

Sum of entries in row n is A000055(n) (number of trees with n vertices).
T(n,0) = A000014(n) (= number of series-reduced trees with n vertices).
The author knows of no formula for T(n,k). The entries have been obtained in the following manner, explained for row n = 7. In A235111 we find that the 11 (=A000055(7)) trees with 7 vertices have M-indices 25, 27, 30, 35, 36, 40, 42, 48, 49, 56, and 64 (the M-index of a tree t is the smallest of the Matula numbers of the rooted trees isomorphic, as a tree, to t). Making use of the formula in A182907 for the degree sequence polynomial, from these Matula numbers one obtains that these trees have 5, 3, 3, 3, 2, 2, 1, 1, 1, 0, and 0 degree-2 vertices, respectively; the frequencies of 0, 1, 2, 3, 4, and 5 are 2, 3, 2, 3, 0, and 1, respectively. See the Maple program.

Examples

			Row n=4 is T(4,0)=1,T(4,1)=0; T(4,2)=1; indeed, the star S[4] has no degree-2 vertex and the path P[4] has 2 degree-2 vertices.
Triangle starts:
1;
0, 1;
1, 0, 1;
1, 1, 0, 1;
2, 1, 2, 0, 1;
2, 3, 2, 3, 0, 1;
4, 4, 7, 3, 4, 0, 1;
5, 9, 10, 12, 5, 5, 0, 1.
		

Crossrefs

Programs

  • Maple
    MI := [25, 27, 30, 35, 36, 40, 42, 48, 49, 56, 64]: with(numtheory): g := proc (n) local r, s: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: if n = 1 then 1 elif bigomega(n) = 1 then sort(expand(g(pi(n))+x^bigomega(pi(n))*(x-1)+x)) else sort(expand(g(r(n))+g(s(n))-x^bigomega(r(n))-x^bigomega(s(n))+x^bigomega(n))) end if end proc: a := proc (n) options operator, arrow: coeff(g(n), x, 2) end proc: G := add(x^a(MI[q]), q = 1 .. 11): seq(coeff(G, x, j), j = 0 .. 5);
  • PARI
    EulerMT(u)={my(n=#u, p=x*Ser(u), vars=variables(p)); Vec(exp( sum(i=1, n, substvec(p + O(x*x^(n\i)), vars, apply(v->v^i,vars))/i ))-1)}
    T(n)={my(u=[1]); for(n=2, n, u=concat([1], EulerMT(u) + (y-1)*u)); my(r=x*Ser(u), v=Vec(-x + r*(1 + x*(1-y)) + (substvec(r,[x,y],[x^2,y^2])*(1 - x*(1-y)) - r^2*(1 + x*(1-y)))/2)); [Vecrev(p) | p<-v]}
    { my(A=T(10)); for(n=1, #A, print(A[n])) } \\ Andrew Howroyd, Dec 20 2020

Formula

G.f.: -x + R(x,y)*(1 + x*(1-y)) + (R(x^2,y^2)*(1 - x*(1-y)) - R(x,y)^2*(1 + x*(1-y)))/2 where R(x,y) satisfies R(x,y) = x*(R(x,y)*(y-1) + exp(Sum_{k>0} R(x^k,y^k)/k)). - Andrew Howroyd, Dec 20 2020

A190174 Number of vertices of even degree in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Dec 09 2011

Keywords

Comments

The Matula-Goebel number of a rooted tree can be defined in the following recursive manner: to the one-vertex tree there corresponds the number 1; to a tree T with root degree 1 there corresponds the t-th prime number, where t is the Matula-Goebel number of the tree obtained from T by deleting the edge emanating from the root; to a tree T with root degree m>=2 there corresponds the product of the Matula-Goebel numbers of the m branches of T.
The degree sequences of the rooted trees with Matula-Goebel number n are given in A182907.

Examples

			a(5)=2 because the rooted tree with Matula-Goebel number 5 is the path tree on 4 vertices and the vertex degrees are 1,1,2,2;
a(7)=0 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y having vertices of degree 1,1,1,3.
		

Crossrefs

Programs

  • Maple
    with(numtheory): g := proc (n) local r, s: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: if n = 1 then 1 elif bigomega(n) = 1 then sort(expand(g(pi(n))+x^bigomega(pi(n))*(x-1)+x)) else sort(expand(g(r(n))+g(s(n))-x^bigomega(r(n))-x^bigomega(s(n))+x^bigomega(n))) end if end proc: a := proc (n) options operator, arrow: (1/2)*subs(x = 1, g(n))+(1/2)*subs(x = -1, g(n)) end proc: seq(a(n), n = 1 .. 110);
  • Mathematica
    r[n_] := FactorInteger[n][[1, 1]];
    s[n_] := n/r[n];
    g[n_] = Which[n == 1, 1, PrimeOmega[n] == 1, g[PrimePi[n]] + x^PrimeOmega[PrimePi[n]]*(x - 1) + x , True, g[r[n]] + g[s[n]] - x^PrimeOmega[r[n]] - x^PrimeOmega[s[n]] + x^PrimeOmega[n]];
    a[n_] := (1/2)(g[n] /. x -> 1) + (1/2)(g[n] /. x -> -1);
    Table[a[n], {n, 1, 110}] (* Jean-François Alcover, Jun 20 2024, after Maple code *)

Formula

For a graph with degree sequence a,b,c,..., define the degree sequence polynomial to be x^a + x^b + x^c + ... . The degree sequence polynomial g(n)=g(n,x) of the rooted tree with Matula-Goebel number n can be obtained recursively in the following way: g(1)=1; if n=prime(t), then g(n)=g(t)+x^G(t)*(x-1)+x; if n=r*s (r,s>=2), then g(n)=g(r)+g(s)-x^G(r)-x^G(s)+x^G(n); G(m) is the number of prime divisors of m counted with multiplicities. Clearly, a(n)=(1/2)*(g(n,1) + g(n,-1)).

A190175 The Goebel-Matula numbers of the rooted trees having only vertices of odd degree.

Original entry on oeis.org

2, 7, 8, 28, 32, 43, 53, 98, 112, 128, 172, 212, 227, 263, 311, 343, 392, 443, 448, 512, 577, 602, 688, 742, 848, 908, 1052, 1193, 1244, 1372, 1423, 1568, 1619, 1772, 1792, 1993, 2048, 2107, 2308, 2311, 2408, 2539, 2597, 2752, 2939, 2968, 3178, 3209, 3392, 3632, 3682, 3698, 3779
Offset: 1

Views

Author

Emeric Deutsch, Oct 30 2011, Dec 09 2011

Keywords

Comments

The Matula-Goebel number of a rooted tree can be defined in the following recursive manner: to the one-vertex tree there corresponds the number 1; to a tree T with root degree 1 there corresponds the t-th prime number, where t is the Matula-Goebel number of the tree obtained from T by deleting the edge emanating from the root; to a tree T with root degree m>=2 there corresponds the product of the Matula-Goebel numbers of the m branches of T.

Examples

			7 is in the sequence because the rooted tree with Matula-Goebel number 7 is the rooted tree Y with vertices of degree 1,1,1,3.
15 is not in the sequence because the rooted tree with Matula-Goebel number 15 is the path tree ABRCDE, rooted at R; it has 2 vertices of degree 1 and 4 vertices of degree 2.
		

Crossrefs

Programs

  • Maple
    with(numtheory): g := proc (n) local r, s: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: if n = 1 then 1 elif bigomega(n) = 1 then sort(expand(g(pi(n))+x^bigomega(pi(n))*(x-1)+x)) else sort(expand(g(r(n))+g(s(n))-x^bigomega(r(n))-x^bigomega(s(n))+x^bigomega(n))) end if end proc: a := proc (n) options operator, arrow: (1/2)*subs(x = 1, g(n))+(1/2)*subs(x = -1, g(n)) end proc: A := {}: for n to 4000 do if a(n) = 0 then A := `union`(A, {n}) else  end if end do: A;
  • Mathematica
    r[n_] := FactorInteger[n][[1, 1]];
    s[n_] := n/r[n];
    g[n_] := Which[n == 1, 1, PrimeOmega[n] == 1, g[PrimePi[n]] + x^PrimeOmega[PrimePi[n]]*(x - 1) + x, True, g[r[n]] + g[s[n]] - x^PrimeOmega[r[n]] - x^PrimeOmega[s[n]] + x^PrimeOmega[n]];
    a[n_] := (1/2)(g[n] /. x -> 1) + (1/2)(g[n] /. x -> -1);
    A = {};
    Do[If[a[n] == 0, A = Union[A, {n}]], {n, 1, 4000}];
    A (* Jean-François Alcover, Jun 20 2024, after Maple code *)

Formula

The number of vertices of even degree of the rooted trees with Matula-Goebel number n is A190174(n). The number n is in the sequence if and only if A190174(n)=0.
In A182907 one can find the generating polynomial g(n)=g(n,x) of the vertices of the rooted tree having Matula-Goebel number n, according to degree. We look for those values of n for which the polynomial g(n,x) is odd, i.e. satisfies g(n,-x)=-g(n,x).

A198323 Matula-Goebel number of rooted trees that have only vertices of degree 1 and of maximal degree.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 19, 22, 25, 28, 31, 32, 33, 43, 53, 55, 62, 64, 93, 98, 121, 127, 128, 131, 152, 155, 172, 227, 254, 256, 311, 341, 343, 381, 383, 443, 512, 602, 635, 709, 719, 848, 908, 961, 1024, 1397, 1418, 1444, 1619, 1772, 1993, 2048, 2107, 2127, 2939, 3064, 3178, 3209, 3545, 3671, 3698, 3937
Offset: 1

Views

Author

Emeric Deutsch, Oct 29 2011

Keywords

Comments

The Matula-Goebel number of a rooted tree can be defined in the following recursive manner: to the one-vertex tree there corresponds the number 1; to a tree T with root degree 1 there corresponds the t-th prime number, where t is the Matula-Goebel number of the tree obtained from T by deleting the edge emanating from the root; to a tree T with root degree m>=2 there corresponds the product of the Matula-Goebel numbers of the m branches of T.

Examples

			7 is in the sequence because the rooted tree with Matula-Goebel number 7 is the rooted tree Y, having 3 vertices of degree 1 and 1 vertex of degree 3.
15, 22, and 31 are in the sequence because the corresponding rooted trees are path trees on 6 vertices (with different roots); they have 2 vertices of degree 1 and 4 vertices of degree 2.
		

Crossrefs

Cf. A182907.

Formula

In A182907 one can find the generating polynomial g(n,x) of the vertices of the rooted tree having Matula-Goebel number n, according to degree. We look for those values of n for which the polynomial g(n) = g(n,x) has at most 2 terms.

A258123 Irregular triangle read by rows: T(n,k) is the number of trees with n vertices that have k vertices of maximum degree (n, k>=1).

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 2, 0, 1, 4, 1, 0, 1, 8, 2, 0, 0, 1, 15, 6, 1, 0, 0, 1, 32, 11, 3, 0, 0, 0, 1, 68, 25, 10, 2, 0, 0, 0, 1, 156, 47, 25, 6, 0, 0, 0, 0, 1, 361, 105, 58, 24, 2, 0, 0, 0, 0, 1, 869, 227, 124, 69, 11, 0, 0, 0, 0, 0, 1, 2105, 556, 256, 185, 52, 4, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Emeric Deutsch, Aug 19 2015

Keywords

Comments

Sum of entries in row n = A000055(n) = number of trees with n vertices.

Examples

			Triangle starts:
1;
0,1;
1;
1,1;
2,0,1;
4,1,0,1;
8,2,0,0,1;
Row 4 is 1,1; indeed, the star S(4) has degree sequence (0,0,0,1) and the path P(4) has degree sequence (1,1,2,2).
		

Crossrefs

Formula

No formula for T(n,k) or generating function is known to the author. Row 5, for example, has been obtained in the following manner. The 3 trees with 5 vertices have M-indices 9,12,16 (the M-index of a tree T is the smallest of the Matula numbers of the rooted trees isomorphic (as a tree) to T; see A235111). In A182907 one finds the degree sequence (and the degree sequence polynomial) of a rooted tree with known Matula number. To the Matula numbers 9, 12, 16, there correspond the degree sequence polynomials 3x^2 + 2x, x^3 + x^2 + 3x, x^4 + 4x, respectively. From here, number of vertices of maximum degree are 3, 1, and 1, respectively. In other words, 2 trees have 1 vertex of maximum degree, 0 trees have 2 vertices of maximum degree, and 1 tree has 3 vertices of maximum degree; this leads us to row 5: 2, 0, 1.
Showing 1-6 of 6 results.