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.

A196055 The terminal Wiener index of the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 6, 6, 4, 4, 4, 8, 8, 8, 5, 12, 8, 10, 12, 10, 10, 5, 10, 15, 6, 10, 12, 16, 10, 12, 5, 20, 6, 10, 12, 18, 15, 15, 12, 18, 10, 19, 16, 12, 14, 12, 12, 24, 20, 14, 12, 19, 20, 21, 7, 26, 18, 12, 10, 21, 18, 6, 22, 30, 14, 14, 15, 20, 14, 22, 18, 28, 19, 18, 16, 26, 14, 22, 12, 28, 24, 12, 12, 30, 14, 19, 14, 21, 24, 24
Offset: 1

Views

Author

Emeric Deutsch, Sep 29 2011

Keywords

Comments

The terminal Wiener index of a connected graph is the sum of the distances between all pairs of nodes of degree 1.
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

			a(7)=6 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y (2+2+2=6).
		

Crossrefs

Programs

  • Maple
    with(numtheory): TW := proc (n) local r, s, LV, EPL, Tw: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: LV := proc (n) if n = 1 then 0 elif n = 2 then 1 elif bigomega(n) = 1 then LV(pi(n)) else LV(r(n))+LV(s(n)) end if end proc: EPL := proc (n) if n = 1 then 0 elif n = 2 then 1 elif bigomega(n) = 1 then EPL(pi(n))+LV(pi(n)) else EPL(r(n))+EPL(s(n)) end if end proc: Tw := proc (n) if n = 1 then 0 elif bigomega(n) = 1 then Tw(pi(n)) else Tw(r(n))+Tw(s(n))+EPL(r(n))*LV(s(n))+EPL(s(n))*LV(r(n)) end if end proc: if n = 1 then 0 elif bigomega(n) = 1 and bigomega(pi(n)) = 1 then TW(pi(n))+LV(pi(n)) elif bigomega(n) = 1 then TW(pi(n))+EPL(n) else Tw(r(n))+Tw(s(n))+EPL(r(n))*LV(s(n))+EPL(s(n))*LV(r(n)) end if end proc; seq(TW(n), n = 1 .. 90);

Formula

Let LV(m) and EPL(m) denote the number of leaves and the external path length, respectively, of the rooted tree with Matula number m (see A109129 and A196048, where LV(m) and EPL(m) are obtained recursively). a(1)=0; if n=p(t) (=the t-th prime) and t is prime, then a(n) = a(t) + LV(t); if n=p(t) (=the t-th prime) and t is not prime, then a(n) = a(t) + LV(t) + EPL(t). Now assume that n is not prime; it can be written n=rs, where r is prime and s >= 2. If s is prime, then a(n) = a(r) - EPL(r) + a(s) - EPL(s) + EPL(r)*LV(s) + EPL(s)*LV(r); if s is not prime, then a(n) = a(r) - EPL(r) + a(s) + EPL(r)*LV(s) + EPL(s)*LV(r); the Maple program is based on this recursive formula.
If m > 2 then a(2^m) = m(m-1) because the rooted tree with Matula-Goebel number 2^m is a star with m edges and the vertices of each of the binomial(m,2) pairs of nodes of degree 1 are at distance 2.

A184157 The sum of the even distances in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

0, 0, 2, 2, 4, 4, 6, 6, 10, 10, 10, 8, 8, 8, 16, 12, 8, 14, 12, 18, 18, 16, 14, 14, 28, 14, 24, 12, 18, 24, 16, 20, 28, 18, 24, 20, 14, 14, 24, 28, 14, 22, 12, 24, 34, 24, 24, 22, 30, 40, 24, 22, 20, 30, 40, 18, 28, 24, 18, 34, 20, 28, 36, 30, 36, 36, 14, 30, 34, 32, 28, 28, 22, 20, 50, 18, 42, 32, 24, 40
Offset: 1

Views

Author

Emeric Deutsch, Oct 15 2011

Keywords

Comments

The Matula-Goebel number of a rooted tree is 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.
a(n) + A184158(n) = A196051(n) (= the Wiener index of the rooted tree with Matula-Goebel number n).

Examples

			a(7)=6 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y with 3 distances equal to 2.
		

References

  • O. Ivanciuc, T. Ivanciuc, D. J. Klein, W. A. Seitz, and A. T. Balaban, Wiener index extension by counting even/odd graph distances, J. Chem. Inf. Comput. Sci., 41, 2001, 536-549.

Crossrefs

Programs

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

Formula

a(n) is the value at x=1 of the derivative of the even part of the Wiener polynomial W(n)=W(n,x) of the rooted tree with Matula number n. W(n) is obtained recursively in A196059. The Maple program is based on the above.

A184158 The sum of the odd distances in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

0, 1, 2, 2, 6, 6, 3, 3, 10, 10, 10, 10, 10, 10, 19, 4, 10, 17, 4, 14, 14, 19, 17, 14, 28, 17, 24, 17, 14, 26, 19, 5, 28, 14, 28, 24, 14, 14, 26, 18, 17, 24, 17, 28, 38, 24, 26, 18, 18, 35, 28, 24, 5, 34, 44, 24, 18, 26, 14, 33, 24, 28, 31, 6, 40, 40, 14, 18, 38, 38, 18, 31, 24, 24, 52, 24, 37, 36, 28, 22
Offset: 1

Views

Author

Emeric Deutsch, Oct 15 2011

Keywords

Comments

The Matula-Goebel number of a rooted tree is 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.
a(n) + A184157(n) = A196051(n) (= the Wiener index of the rooted tree with Matula-Goebel number n).

Examples

			a(7)=3 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y with 3 distances equal to 1.
		

References

  • O. Ivanciuc, T. Ivanciuc, D. J. Klein, W. A. Seitz, and A. T. Balaban, Wiener index extension by counting even/odd graph distances, J. Chem. Inf. Comput. Sci., 41, 2001, 536-549.

Crossrefs

Programs

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

Formula

a(n) is the value at x=1 of the derivative of the odd part of the Wiener polynomial W(n)=W(n,x) of the rooted tree with Matula number n. W(n) is obtained recursively in A196059. The Maple program is based on the above.

A198340 The overall Wiener index of the rooted tree having Matula-Goebel number n.

Original entry on oeis.org

0, 1, 6, 6, 21, 21, 24, 24, 56, 56, 56, 67, 67, 67, 126, 80, 67, 161, 80, 154, 154, 126, 161, 197, 252, 161, 354, 188, 154, 333, 126, 240, 252, 154, 311, 440, 197, 197, 333, 414, 161, 411, 188, 311, 683, 354, 333, 545, 384, 636, 311, 411, 240, 921, 462, 510
Offset: 1

Views

Author

Emeric Deutsch, Dec 04 2011

Keywords

Comments

The overall Wiener index of any connected graph G is defined as the sum of the Wiener indices of all the subgraphs of G. The Wiener index of a connected graph is the sum of the distances between all unordered pairs of vertices in the graph.
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

			a(4)=6 because the rooted tree with Matula-Goebel number 4 is V; each of the 3 one-vertex subtrees has Wiener index 0, each of the 2 one-edge subtrees has Wiener index 1, and the tree V itself has Wiener index 4; 0+0+0+1+1+4=6.
		

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.
  • D. Bonchev, The overall Wiener index - a new tool for characterization of molecular topology, J. Chem. Inf. Comput. Sci., 2001, 41, 582-592.

Crossrefs

Programs

  • Maple
    m2union := proc (x, y) sort([op(x), op(y)]) end proc: with(numtheory); MRST := 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, seq(ithprime(mrst[pi(n)][i]), i = 1 .. nops(mrst[pi(n)]))] else [seq(seq(mrst[r(n)][i]*mrst[s(n)][j], i = 1 .. nops(mrst[r(n)])), j = 1 .. nops(mrst[s(n)]))] end if end proc: MNRST := 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 [] elif bigomega(n) = 1 then m2union(mrst[pi(n)], mnrst[pi(n)]) else m2union(mnrst[r(n)], mnrst[s(n)]) end if end proc: MST := proc (n) m2union(mrst[n], mnrst[n]) end proc: for n to 2000 do mrst[n] := MRST(n): mnrst[n] := MNRST(n): mst[n] := MST(n) end do: W := proc (n) local u, v, E, PL: u := proc (n) options operator, arrow: op(1, factorset(n)) end proc: v := proc (n) options operator, arrow: n/u(n) end proc: E := proc (n) if n = 1 then 0 elif bigomega(n) = 1 then 1+E(pi(n)) else E(u(n))+E(v(n)) end if end proc: PL := proc (n) if n = 1 then 0 elif bigomega(n) = 1 then 1+E(pi(n))+PL(pi(n)) else PL(u(n))+PL(v(n)) end if end proc: if n = 1 then 0 elif bigomega(n) = 1 then W(pi(n))+PL(pi(n))+1+E(pi(n)) else W(u(n))+W(v(n))+PL(u(n))*E(v(n))+PL(v(n))*E(u(n)) end if end proc: OW := proc (n) options operator, arrow: add(W(MST(n)[j]), j = 1 .. nops(MST(n))) end proc: seq(OW(n), n = 1 .. 60);

Formula

A198339(n) gives the sequence of the Matula-Goebel numbers of all the subtrees of the rooted tree with Matula-Goebel number n. A196051(k) is the Wiener number of the rooted tree with Matula-Goebel number k.

A184186 Irregular triangle read by rows: row n is the overall Wiener index vector of the rooted tree having Matula-Goebel number n (n>=2).

Original entry on oeis.org

1, 2, 4, 2, 4, 3, 8, 10, 3, 8, 10, 3, 12, 9, 3, 12, 9, 4, 12, 20, 20, 4, 12, 20, 20, 4, 12, 20, 20, 4, 16, 29, 18, 4, 16, 29, 18, 4, 16, 29, 18, 5, 16, 30, 40, 35, 4, 24, 36, 16, 4, 16, 29, 18, 5, 20, 49, 56, 31, 4, 24, 36, 16, 5, 20, 39, 58, 32, 5, 20, 39
Offset: 2

Views

Author

Emeric Deutsch, Dec 04 2011

Keywords

Comments

Component i (i>=1) of the overall Wiener index (number) vector of a graph G is defined as the sum of the Wiener numbers of all i-edge subgraphs of G (see the Bonchev reference, p. 583).
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.
Number of entries in row n = 1st entry in row n = number of edges of the corresponding tree = A196050(n).
Last entry in row n = the Wiener index of the corresponding tree = A196051(n).
Sum of entries in row n = the overall Wiener index of the corresponding tree = A198340(n).
The Maple program yields row n with the command OWV(n) for n<=3000 (adjustable).

Examples

			Row n=5 is 3,8,10 because the rooted tree with Matula-Goebel number 5 is the path tree on 4 vertices; each of the three 1-edge subtrees has Wiener index 1, each of the two 2-edge subtrees has Wiener index 4 and the given 3-edge tree itself has Wiener index 10.
Triangle starts (n>=2):
1;
2,4;
2,4;
3,8,10;
3,8,10;
3,12,9;
3,12,9;
4,12,20,20;
		

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.
  • D. Bonchev, The overall Wiener index - a new tool for characterization of molecular topology, J. Chem. Inf. Comput. Sci., 2001, 41, 582-592.

Crossrefs

Programs

  • Maple
    m2union := proc (x, y) sort([op(x), op(y)]) end proc: with(numtheory); MRST := 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, seq(ithprime(mrst[pi(n)][i]), i = 1 .. nops(mrst[pi(n)]))] else [seq(seq(mrst[r(n)][i]*mrst[s(n)][j], i = 1 .. nops(mrst[r(n)])), j = 1 .. nops(mrst[s(n)]))] end if end proc: MNRST := 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 [] elif bigomega(n) = 1 then m2union(mrst[pi(n)], mnrst[pi(n)]) else m2union(mnrst[r(n)], mnrst[s(n)]) end if end proc: MST := proc (n) m2union(mrst[n], mnrst[n]) end proc: for n to 3000 do mrst[n] := MRST(n): mnrst[n] := MNRST(n): mst[n] := MST(n) end do: E := 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 elif bigomega(n) = 1 then 1+E(pi(n)) else E(r(n))+E(s(n)) end if end proc: W := proc (n) local u, v, E, PL: u := proc (n) options operator, arrow: op(1, factorset(n)) end proc: v := proc (n) options operator, arrow: n/u(n) end proc: E := proc (n) if n = 1 then 0 elif bigomega(n) = 1 then 1+E(pi(n)) else E(u(n))+E(v(n)) end if end proc: PL := proc (n) if n = 1 then 0 elif bigomega(n) = 1 then 1+E(pi(n))+PL(pi(n)) else PL(u(n))+PL(v(n)) end if end proc: if n = 1 then 0 elif bigomega(n) = 1 then W(pi(n))+PL(pi(n))+1+E(pi(n)) else W(u(n))+W(v(n))+PL(u(n))*E(v(n))+PL(v(n))*E(u(n)) end if end proc: OWV := proc (n) local i, c, g, k: for i from 0 to E(n) do c[i] := 0 end do: g := MST(n): for k to nops(g) do c[E(g[k])] := c[E(g[k])]+W(g[k]) end do: seq(c[i], i = 1 .. E(n)) end proc:

Formula

A198339(n) gives the sequence of the Matula-Goebel numbers of all the subtrees of the rooted tree with Matula-Goebel number n. A196051(k) is the Wiener number of the rooted tree with Matula-Goebel number k. A196050(k) is equal to the number of edges of the rooted tree with Matula-Goebel number k. In the Maple program we take the sum of the Wiener indices of all the subtrees, grouped according to number of edges.
Showing 1-5 of 5 results.