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-5 of 5 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

A202853 Triangle read by rows: T(n,k) is the number of k-matchings of the rooted tree having Matula-Goebel number n (n>=1, k>=0).

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Feb 14 2012

Keywords

Comments

The entries in row n are the coefficients of the matching-generating polynomial of the rooted tree having Matula-Goebel number n (see the MathWorld link).
A k-matching in a graph is a set of k edges, no two of which have a vertex in common.
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.
After activating the Maple program, the command m(n) will yield the matching-generating polynomial of the rooted tree corresponding to the Matula-Goebel number n.

Examples

			T(11,2)=3 because the rooted tree corresponding to n=11 is a path abcde on 5 vertices. We have three 2-matchings:  (ab,cd), (ab,de), and (bc,de).
Triangle starts:
  1;
  1,1;
  1,2;
  1,2;
  1,3,1;
  1,3,1;
  ...
		

References

  • C. D. Godsil, Algebraic Combinatorics, Chapman & Hall, New York, 1993.

Crossrefs

Cf. A206483 (matching number), A193404 (row sums), A347967 (end-most each row), A193403.
Cf. A202854 (palindromic rows).

Programs

  • Maple
    with(numtheory): N := 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 1+N(pi(n)) else N(r(n))+N(s(n))-1 end if end proc: M := 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 [0, 1] elif bigomega(n) = 1 then [x*M(pi(n))[2], M(pi(n))[1]+M(pi(n))[2]] else [M(r(n))[1]*M(s(n))[2]+M(r(n))[2]*M(s(n))[1], M(r(n))[2]*M(s(n))[2]] end if end proc: m := proc (n) options operator, arrow: sort(expand(M(n)[1]+M(n)[2])) end proc: for n to 35 do seq(coeff(m(n), x, j), j = 0 .. degree(m(n))) end do; # yields sequence in triangular form
  • Mathematica
    r[n_] := FactorInteger[n][[1, 1]];
    s[n_] := n/r[n];
    V[n_] := Which[n == 1, 1, PrimeOmega[n] == 1, 1 + V[PrimePi[n]], True, V[r[n]] + V[s[n]] - 1];
    M[n_] := Which[n == 1, {0, 1}, PrimeOmega[n] == 1, {x*M[PrimePi[n]][[2]], M[PrimePi[n]][[1]] + M[PrimePi[n]][[2]]}, True, {M[r[n]][[1]]* M[s[n]][[2]] + M[r[n]][[2]]*M[s[n]][[1]], M[r[n]][[2]]*M[s[n]][[2]]}];
    m[n_] := Total[M[n]];
    T[n_] := CoefficientList[m[n], x];
    Table[T[n], {n, 1, 35}] // Flatten (* Jean-François Alcover, Jun 24 2024, after Maple code *)

Formula

Define b(n) (c(n)) to be the generating polynomials of the matchings of the rooted tree with Matula-Goebel number n that contain (do not contain) the root, with respect to the size of the matching (a k-matching has size k). We have the following recurrence for the pair M(n)=[b(n),c(n)]. M(1)=[0,1]; if n=prime(t) (=the t-th prime), then M(n)=[xc(t),b(t)+c(t)]; if n=r*s (r,s,>=2), then M(n)=[b(r)c(s)+c(r)b(s), c(r)c(s)]. Then m(n)=b(n)+c(n) is the generating polynomial of the matchings of the rooted tree with respect to the size of the matchings (called the matching-generating polynomial). T(n,k) is the coefficient of x^k in the polynomial m(n). [The actual matching polynomial is obtained by the substitution x = -1/x^2, followed by multiplication by x^N(n), where N(n) is the number of vertices of the rooted tree.]

A193401 Triangle read by rows: row n contains the coefficients (of the increasing powers of the variable) of the characteristic polynomial of the Laplacian matrix of the rooted tree having Matula-Göbel number n.

Original entry on oeis.org

0, 1, 0, -2, 1, 0, 3, -4, 1, 0, 3, -4, 1, 0, -4, 10, -6, 1, 0, -4, 10, -6, 1, 0, -4, 9, -6, 1, 0, -4, 9, -6, 1, 0, 5, -20, 21, -8, 1, 0, 5, -20, 21, -8, 1, 0, 5, -20, 21, -8, 1, 0, 5, -18, 20, -8, 1, 0, 5, -18, 20, -8, 1, 0, 5, -18, 20, -8, 1, 0, -6, 35, -56, 36, -10, 1, 0, 5, -16, 18, -8, 1, 0, 5, -18, 20, -8, 1
Offset: 1

Views

Author

Emeric Deutsch, Feb 09 2012

Keywords

Comments

Row n contains 1+A061775(n) entries (= 1+ number of vertices of the rooted tree).
The Matula-Göbel 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-Göbel 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-Göbel numbers of the m branches of T.

Examples

			Row 4 is 0, 3, -4, 1 because the rooted tree having Matula-Goebel number 4 is V; the Laplacian matrix is [2,-1,-1; -1,1,0; -1,0,1], having characteristic polynomial x^3 - 4x^2 +3x
Triangle starts:
0, 1;
0, -2, 1;
0, 3, -4, 1;
0, 3, -4, 1;
0, -4, 10, -6, 1;
0, -4, 10, -6, 1;
0, -4, 9, -6, 1;
0, -4, 9, -6, 1;
		

Crossrefs

Programs

  • Maple
    with(numtheory): with(linalg): with(LinearAlgebra): DA := proc (d) local aa: aa := proc (i, j) if d[i, j] = 1 then 1 else 0 end if end proc: Matrix(RowDimension(d), RowDimension(d), aa) end proc: AL := proc (a) local ll: ll := proc (i, j) if i = j then add(a[i, k], k = 1 .. RowDimension(a)) else -a[i, j] end if end proc: Matrix(RowDimension(a), RowDimension(a), ll) end proc: V := 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 1+V(pi(n)) else V(r(n))+V(s(n))-1 end if end proc: d := proc (n) local r, s, C, a: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: C := proc (A, B) local c: c := proc (i, j) options operator, arrow: A[1, i]+B[1, j+1] end proc: Matrix(RowDimension(A), RowDimension(B)-1, c) end proc: a := proc (i, j) if i = 1 and j = 1 then 0 elif 2 <= i and 2 <= j then dd[pi(n)][i-1, j-1] elif i = 1 then 1+dd[pi(n)][1, j-1] elif j = 1 then 1+dd[pi(n)][i-1, 1] else  end if end proc: if n = 1 then Matrix(1, 1, [0]) elif bigomega(n) = 1 then Matrix(V(n), V(n), a) else Matrix(blockmatrix(2, 2, [dd[r(n)], C(dd[r(n)], dd[s(n)]), Transpose(C(dd[r(n)], dd[s(n)])), SubMatrix(dd[s(n)], 2 .. RowDimension(dd[s(n)]), 2 .. RowDimension(dd[s(n)]))])) end if end proc: for n to 1000 do dd[n] := d(n) end do: for n from 1 to 18 do seq(coeff(CharacteristicPolynomial(AL(DA(d(n))), x), x, k), k = 0 .. V(n)) end do; # yields triangle in triangular form

Formula

Let T be a rooted tree with root b. If b has degree 1, then let A be the rooted tree with root c, obtained from T by deleting the edge bc emanating from the root. If b has degree >=2, then A is obtained (not necessarily in a unique way) by joining at b two trees B and C, rooted at b. It is straightforward to express the distance matrix of T in terms of the entries of the distance matrix of A (resp. of B and C). Making use of this, the Maple program (improvable!) finds recursively the distance matrices of the rooted trees with Matula-Göbel numbers 1..1000 (upper limit can be altered), then switches (easily) to the Laplacian matrices and finds the coefficients of their characteristic polynomials.

A193402 The Matula-Göbel numbers of the rooted trees such that 2 is an eigenvalue of the Laplacian matrix.

Original entry on oeis.org

2, 5, 6, 15, 18, 22, 23, 26, 31, 41, 45, 54, 55, 65, 66, 69, 78, 93, 94, 103, 122, 123, 135, 137, 158, 162, 165, 166, 167, 195, 198, 202, 207, 211, 234, 235, 242, 253, 254, 279, 282, 283, 286, 299, 305, 309, 338, 341, 343, 358, 366, 369, 394, 395, 401, 403
Offset: 1

Views

Author

Emeric Deutsch, Feb 11 2012

Keywords

Comments

The Matula-Göbel 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-Göbel 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-Göbel numbers of the m branches of T.

Examples

			5 is in the sequence because the rooted tree with Matula-Göbel number 5 is the path on 4 vertices; the Laplacian matrix is [1,-1,0,0; -1,2,-1,0; 0,-1,2,-1;0,0,-1,1] with characteristic polynomial x(x-2)(x^2 -4x +2).
		

Crossrefs

Programs

  • Maple
    with(numtheory): with(linalg): with(LinearAlgebra): DA := proc (d) local aa: aa := proc (i, j) if d[i, j] = 1 then 1 else 0 end if end proc: Matrix(RowDimension(d), RowDimension(d), aa) end proc: AL := proc (a) local ll: ll := proc (i, j) if i = j then add(a[i, k], k = 1 .. RowDimension(a)) else -a[i, j] end if end proc: Matrix(RowDimension(a), RowDimension(a), ll) end proc: V := 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 1+V(pi(n)) else V(r(n))+V(s(n))-1 end if end proc: d := proc (n) local r, s, C, a: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: C := proc (A, B) local c: c := proc (i, j) options operator, arrow: A[1, i]+B[1, j+1] end proc: Matrix(RowDimension(A), RowDimension(B)-1, c) end proc: a := proc (i, j) if i = 1 and j = 1 then 0 elif 2 <= i and 2 <= j then dd[pi(n)][i-1, j-1] elif i = 1 then 1+dd[pi(n)][1, j-1] elif j = 1 then 1+dd[pi(n)][i-1, 1] else  end if end proc: if n = 1 then Matrix(1, 1, [0]) elif bigomega(n) = 1 then Matrix(V(n), V(n), a) else Matrix(blockmatrix(2, 2, [dd[r(n)], C(dd[r(n)], dd[s(n)]), Transpose(C(dd[r(n)], dd[s(n)])), SubMatrix(dd[s(n)], 2 .. RowDimension(dd[s(n)]), 2 .. RowDimension(dd[s(n)]))])) end if end proc: for n to 1000 do dd[n] := d(n) end do: S := {}: for n to 500 do if subs(x = 2, CharacteristicPolynomial(AL(DA(d(n))), x)) = 0 then S := `union`(S, {n}) else  end if end do: S;

Formula

Let T be a rooted tree with root b. If b has degree 1, then let A be the rooted tree with root c, obtained from T by deleting the edge bc emanating from the root. If b has degree >=2, then A is obtained (not necessarily in a unique way) by joining at b two trees B and C, rooted at b. It is straightforward to express the distance matrix of T in terms of the entries of the distance matrix of A (resp. of B and C). Making use of this, the Maple program (improvable!) finds recursively the distance matrices of the rooted trees with Matula-Göbel numbers 1..1000 (upper limit can be altered), then switches (easily) to the Laplacian matrices and finds their characteristic polynomials.

A206486 The total walk count in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

0, 2, 10, 10, 32, 32, 36, 36, 88, 88, 88, 106, 106, 106, 222, 140, 106, 284, 140, 268, 268, 222, 284, 370, 536, 284, 756, 330, 268, 708, 222, 490, 536, 268, 658, 1052, 370, 370, 708, 978, 284, 872, 330, 658, 1856, 756, 708, 1542, 798, 1712, 658, 872, 490, 2882, 1254
Offset: 1

Views

Author

Emeric Deutsch, Feb 20 2012

Keywords

Comments

The total walk count in a graph with n vertices is obtained by counting all walks of lengths 1,2,...,n-1. Some authors define it as 1/2 of the above.
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 Maple program yields a(n) by using the command TWC(n).

Examples

			a(3)=10 because the rooted tree with Matula-Goebel number 3 is the path a-b-c on 3 vertices and the walks are: ab, ba, bc, cb, abc, cba, aba, bab, bcb, and cbc.
		

References

  • F. Goebel, On a 1-1-correspondence between rooted trees and natural numbers, J. Combin. Theory, B 29 (1980), 141-143.
  • I. Gutman and A. Ivic, On Matula numbers, Discrete Math., 150, 1996, 131-142.
  • I. Gutman and Yeong-Nan Yeh, Deducing properties of trees from their Matula numbers, Publ. Inst. Math., 53 (67), 1993, 17-22.
  • D. W. Matula, A natural rooted tree enumeration by prime factorization, SIAM Review, 10, 1968, 273.
  • G. Ruecker and C. Ruecker, Walk counts, labyrinthicity, and complexity of acyclic and cyclic graphs and molecules, J. Chem. Inf. Comput. Sci., 40, 2000, 99-106.
  • G. Ruecker and C. Ruecker, Substructure, subgraph, and walk counts as measures of the complexity of graphs and molecules, J. Chem. Inf. Comput. Sci., 41, 2001, 1457-1462.
  • D. Bonchev and G. A. Buck, Quantitative measures of network complexity, in: Complexity in Chemistry, Biology, and Ecology, Springer, New York, pp. 191-235.

Crossrefs

Cf. A193403.

Programs

  • Maple
    with(numtheory); with(linalg): with(LinearAlgebra): V := 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 1+V(pi(n)) else V(r(n))+V(s(n))-1 end if end proc: d := proc (n) local r, s, C, a: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: C := proc (A, B) local c: c := proc (i, j) options operator, arrow: A[1, i]+B[1, j+1] end proc: Matrix(RowDimension(A), RowDimension(B)-1, c) end proc: a := proc (i, j) if i = 1 and j = 1 then 0 elif 2 <= i and 2 <= j then dd[pi(n)][i-1, j-1] elif i = 1 then 1+dd[pi(n)][1, j-1] elif j = 1 then 1+dd[pi(n)][i-1, 1] else  end if end proc: if n = 1 then Matrix(1, 1, [0]) elif bigomega(n) = 1 then Matrix(V(n), V(n), a) else Matrix(blockmatrix(2, 2, [dd[r(n)], C(dd[r(n)], dd[s(n)]), Transpose(C(dd[r(n)], dd[s(n)])), SubMatrix(dd[s(n)], 2 .. RowDimension(dd[s(n)]), 2 .. RowDimension(dd[s(n)]))])) end if end proc: for n to 10000 do dd[n] := d(n) end do: DA := proc (d) local aa: aa := proc (i, j) if d[i, j] = 1 then 1 else 0 end if end proc: Matrix(RowDimension(d), RowDimension(d), aa) end proc: TWC := proc (n) options operator, arrow: add(add((sum(DA(d(n))^k, k = 1 .. V(n)-1))[i, j], j = 1 .. V(n)), i = 1 .. V(n)) end proc; seq(TWC(n), n = 1 .. 55);

Formula

In A193403 it is shown how to find the adjacency matrix of a rooted tree with a given Matula-Goebel number. It is well-known that the (i,j)-entry in the k-th power of the adjacency matrix of a graph G gives the number of walks of length k in G from vertex i to vertex j. The Maple program (improvable) is based on the above facts.
Showing 1-5 of 5 results.