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

A212618 Sum of the distances between all unordered pairs of vertices of degree 2 in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 0, 0, 4, 4, 4, 0, 0, 0, 10, 0, 0, 2, 0, 1, 1, 10, 2, 0, 20, 2, 6, 0, 1, 6, 10, 0, 20, 1, 4, 2, 0, 0, 6, 1, 2, 0, 0, 4, 13, 6, 6, 0, 0, 14, 4, 0, 0, 6, 35, 0, 1, 6, 1, 6, 2, 20, 2, 0, 13, 13, 0, 0, 13, 1, 1, 2, 0, 2, 24, 0, 10, 3, 4, 1, 12, 6, 6, 0, 10, 0, 14, 4, 0, 13, 2, 2, 35, 13
Offset: 1

Views

Author

Emeric Deutsch, May 22 2012

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

			a(11)=4 because the rooted tree with Matula-Goebel number 11 is the path tree A - B - C - D - E; the vertices of degree 2 are B, C, and D; we have dist(B,C)+dist(B,D)+dist(C,D) = 1+2+1 = 4.
a(987654321) = 68, as given by the Maple program; the reader can verify this on the rooted tree of Fig. 2 of the Deutsch reference.
		

Crossrefs

Programs

  • Maple
    k := 2: 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 0 elif bigomega(n) = 1 and bigomega(pi(n)) = k-1 then sort(expand(x+x*g(pi(n)))) elif bigomega(n) = 1 and bigomega(pi(n)) = k then sort(expand(-x+x*g(pi(n)))) elif bigomega(n) = 1 and bigomega(pi(n)) <> k-1 and bigomega(pi(n)) <> k then sort(expand(x*g(pi(n)))) elif bigomega(s(n)) = k-1 then sort(expand(1+g(r(n))+g(s(n)))) elif bigomega(s(n)) = k then sort(expand(-1+g(r(n))+g(s(n)))) else sort(g(r(n))+g(s(n))) end if end proc; with(numtheory): a := 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 and bigomega(pi(n)) = k-1 then a(pi(n))+subs(x = 1, diff(g(pi(n)), x)) elif bigomega(n) = 1 and bigomega(pi(n)) = k then a(pi(n))-subs(x = 1, diff(g(pi(n)), x)) elif bigomega(n) = 1 and bigomega(pi(n)) <> k and bigomega(pi(n)) <> k-1 then a(pi(n)) elif bigomega(s(n)) = k-1 then a(r(n))+a(s(n))+subs(x = 1, diff(g(r(n))*g(s(n)), x))+subs(x = 1, diff(g(r(n)), x))+subs(x = 1, diff(g(s(n)), x)) elif bigomega(s(n)) = k then a(r(n))+a(s(n))+subs(x = 1, diff(g(r(n))*g(s(n)), x))-subs(x = 1, diff(g(r(n)), x))-subs(x = 1, diff(g(s(n)), x)) else a(r(n))+a(s(n))+subs(x = 1, diff(g(r(n))*g(s(n)), x)) end if end proc: seq(a(n), n = 1 .. 120);
  • Mathematica
    k = 2;
    r[n_] := FactorInteger[n][[1, 1]];
    s[n_] := n/r[n];
    g[n_] := Which[n == 1, 0,
      PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] == k - 1,
      Expand[x + x*g[PrimePi[n]]] ,
      PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] == k,
      Expand[-x + x*g[PrimePi[n]]],
      PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] != k - 1 &&
      PrimeOmega[PrimePi[n]] != k, Expand[x*g[PrimePi[n]]],
      PrimeOmega[s[n]] == k - 1, Expand[1 + g[r[n]] + g[s[n]]],
      PrimeOmega[s[n]] == k, Expand[-1 + g[r[n]] + g[s[n]]], True,
      g[r[n]] + g[s[n]]];
    a[n_] := Which[n == 1, 0,
       PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] == k - 1,
       a[PrimePi[n]] + (D[g[PrimePi[n]], x] /. x -> 1),
       PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] == k,
       a[PrimePi[n]] - (D[g[PrimePi[n]], x] /. x -> 1),
       PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] != k &&
        PrimeOmega[PrimePi[n]] != k - 1, a[PrimePi[n]],
       PrimeOmega[s[n]] == k - 1,
       a[r[n]] + a[s[n]] + (D[g[r[n]]*g[s[n]], x] /. x -> 1) +
        (D[g[r[n]], x] /. x -> 1) + (D[g[s[n]], x] /. x -> 1) ,
        PrimeOmega[s[n]] == k,
       a[r[n]] + a[s[n]] + (D[g[r[n]]*g[s[n]], x] /. x -> 1) -
        (D[g[r[n]], x] /. x -> 1) - (D[g[s[n]], x] /. x -> 1), True,
       a[r[n]] + a[s[n]] + (D[g[r[n]]*g[s[n]], x] /. x -> 1) ];
    Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Jun 19 2024, after Maple code *)

Formula

We give recurrence formulas for the more general case of vertices of degree k (k>=2). Let bigomega(n) denote the number of prime divisors of n, counted with multiplicities. Let g(n)=g(n,k,x) be the generating polynomial of the vertices of degree k of the rooted tree with Matula-Goebel number n with respect to level. We have a(1) = 0; if n = prime(t) and bigomega(t)=k-1 then a(n) = a(t)+[dg(t)/dx]{x=1}; if n = prime(t) and bigomega(t)=k, then a(n) = a(t)-[dg(t)/dx]{x=1}; if n = prime(t) and bigomega(t) =/ k and =/ k-1, then a(n)= a(t); if n = r*s with r prime, s>=2, bigomega(s)=k-1, then a(n) = a(r) + a(s) + [d[g(r)g(s)]/dx]{x=1} +[dg(r)/dx]{x=1} +[dg(s)/dx]{x=1}; if n = r*s with r prime, s>=2, bigomega(s) =k, then a(n) = a(r) + a(s) + [d[g(r)g(s)]/dx]{x=1} - [dg(r)/dx]{x=1} - [dg(s)/dx]{x=1}; if n = r*s with r prime, s>=2, bigomega(s) != k-1 and != k, then a(n) = a(r) + a(s) + [d[g(r)g(s)]/dx]_{x=1}.

A212619 Sum of the distances between all unordered pairs of vertices of degree 3 in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, May 22 2012

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

			a(28)=1 because the rooted tree with Matula-Goebel number 28 is obtained by joining the trees I, I, and Y at  their roots; it has 2 vertices of degree 3 (the root and the center of Y), the distance between them is 1.
a(987654321) = 22, as given by the Maple program; the reader can verify this on the rooted tree of Fig. 2 of the Deutsch reference.
		

Crossrefs

Programs

  • Maple
    k := 3: 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 0 elif bigomega(n) = 1 and bigomega(pi(n)) = k-1 then sort(expand(x+x*g(pi(n)))) elif bigomega(n) = 1 and bigomega(pi(n)) = k then sort(expand(-x+x*g(pi(n)))) elif bigomega(n) = 1 and bigomega(pi(n)) <> k-1 and bigomega(pi(n)) <> k then sort(expand(x*g(pi(n)))) elif bigomega(s(n)) = k-1 then sort(expand(1+g(r(n))+g(s(n)))) elif bigomega(s(n)) = k then sort(expand(-1+g(r(n))+g(s(n)))) else sort(g(r(n))+g(s(n))) end if end proc; with(numtheory): a := 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 and bigomega(pi(n)) = k-1 then a(pi(n))+subs(x = 1, diff(g(pi(n)), x)) elif bigomega(n) = 1 and bigomega(pi(n)) = k then a(pi(n))-subs(x = 1, diff(g(pi(n)), x)) elif bigomega(n) = 1 and bigomega(pi(n)) <> k and bigomega(pi(n)) <> k-1 then a(pi(n)) elif bigomega(s(n)) = k-1 then a(r(n))+a(s(n))+subs(x = 1, diff(g(r(n))*g(s(n)), x))+subs(x = 1, diff(g(r(n)), x))+subs(x = 1, diff(g(s(n)), x)) elif bigomega(s(n)) = k then a(r(n))+a(s(n))+subs(x = 1, diff(g(r(n))*g(s(n)), x))-subs(x = 1, diff(g(r(n)), x))-subs(x = 1, diff(g(s(n)), x)) else a(r(n))+a(s(n))+subs(x = 1, diff(g(r(n))*g(s(n)), x)) end if end proc: seq(a(n), n = 1 .. 120);
  • Mathematica
    k = 3;
    r[n_] := FactorInteger[n][[1, 1]];
    s[n_] := n/r[n];
    g[n_] := Which[n == 1, 0, PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] == k - 1, Expand[x + x*g[PrimePi[n]]], PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] == k, Expand[-x + x*g[PrimePi[n]]], PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] != k - 1 && PrimeOmega[PrimePi[n]] != k,  Expand[x*g[PrimePi[n]]], PrimeOmega[s[n]] == k - 1, Expand[1 + g[r[n]] + g[s[n]]], PrimeOmega[s[n]] == k, Expand[-1 + g[r[n]] + g[s[n]]], True, g[r[n]] + g[s[n]]];
    a[n_] := Which[n == 1, 0, PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] == k - 1, a[PrimePi[n]] + (D[g[PrimePi[n]], x] /. x -> 1), PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] == k, a[PrimePi[n]] - (D[g[PrimePi[n]], x] /. x -> 1), PrimeOmega[n] == 1 && PrimeOmega[PrimePi[n]] != k && PrimeOmega[PrimePi[n]] != k - 1, a[PrimePi[n]], PrimeOmega[s[n]] == k - 1, a[r[n]] + a[s[n]] + (D[g[r[n]]*g[s[n]], x] /. x -> 1) + (D[g[r[n]], x] /. x -> 1) + (D[g[s[n]], x] /. x -> 1), PrimeOmega[s[n]] == k, a[r[n]] + a[s[n]] + (D[g[r[n]]*g[s[n]], x] /. x -> 1) - (D[g[r[n]], x] /. x -> 1) - (D[g[s[n]], x] /. x -> 1), True, a[r[n]] + a[s[n]] + (D[g[r[n]]*g[s[n]], x] /. x -> 1)];
    Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Jun 19 2024, after Maple code *)

Formula

We give recurrence formulas for the more general case of vertices of degree k (k>=2). Let bigomega(n) denote the number of prime divisors of n, counted with multiplicities. Let g(n)=g(n,k,x) be the generating polynomial of the vertices of degree k of the rooted tree with Matula-Goebel number n with respect to level. We have a(1)=0; if n = prime(t) and bigomega(t) = k-1 then a(n) = a(t) +[dg(t)/dx]{x=1}; if n = prime(t) and bigomega(t) =k, then a(n) = a(t) - [dg(t)/dx]{x=1}; if n = prime(t) and bigomega(t) != k and != k-1, then a(n) = a(t); if n = r*s with r prime, s>=2, bigomega(s) =k-1, then a(n) = a(r) + a(s) + [d[g(r)g(s)]/dx]{x=1} +[dg(r)/dx]{x=1} +[dg(s)/dx]{x=1}; if n = r*s with r prime, s>=2, bigomega(s) =k, then a(n) = a(r) + a(s) + [d[g(r)g(s)]/dx]{x=1} - [dg(r)/dx]{x=1} - [dg(s)/dx]{x=1}; if n = r*s with r prime, s>=2, bigomega(s) =/ k-1 and =/ k, then a(n) = a(r) + a(s) + [d[g(r)g(s)]/dx]_{x=1}.

A212628 Number of maximal independent vertex subsets in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

1, 2, 2, 2, 3, 3, 2, 2, 4, 4, 4, 3, 3, 3, 5, 2, 3, 5, 2, 4, 4, 5, 5, 3, 7, 5, 8, 3, 4, 6, 5, 2, 7, 4, 5, 5, 3, 3, 6, 4, 5, 5, 3, 5, 9, 8, 6, 3, 4, 8, 5, 5, 2, 9, 9, 3, 4, 6, 4, 6, 5, 7, 8, 2, 8, 8, 3, 4, 9, 6, 4, 5, 5, 5, 11, 3, 7, 8, 5, 4, 16, 6, 8, 5, 7, 5, 8, 5, 3, 10, 6, 8, 9, 9, 5, 3, 8, 5, 13, 8, 5, 6, 9, 5, 9, 3, 3, 9, 6, 10, 6, 3, 6, 5, 13, 6, 12, 5, 5, 6
Offset: 1

Views

Author

Emeric Deutsch, Jun 08 2012

Keywords

Comments

A vertex subset in a tree is said to be independent if no pair of vertices is connected by an edge. The empty set is considered to be independent. An independent vertex subset S of a tree is said to be maximal if every vertex that is not in S is joined by an edge to at least one vertex of S.
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.
Let A(n)=A(n,x), B(n)=B(n,x), C(n)=C(n,x) be the generating polynomial with respect to size of the maximal independent sets that contain the root, the maximal independent sets that do not contain the root, and the independent sets which are not maximal but become maximal if the root is removed, respectively. We have A(1)=x, B(1)=0, C(1)=1, A(t-th prime) = x[B(t) + C(t)], B(t-th prime) = A(t), C(t-th prime)=B(t), A(rs)=A(r)A(s)/x, B(rs)=B(r)B(s)+B(r)C(s)+B(s)C(r), C(rs)=C(r)C(s) (r,s>=2). The generating polynomial of the maximal independent vertex subsets with respect to size is P(n, x)=A(n,x)+B(n,x). Then a(n) = P(1,n). The Maple program is based on these relations.

Examples

			a(11)=4 because the rooted tree with Matula-Goebel number 11 is the path tree on 5 vertices R - A - B - C - D; the maximal independent vertex subsets are {R,C}, {A,C}, {A,D}, and {R,B,D}.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P := proc (n) local r, s, A, B, C: r := n -> op(1, factorset(n)): s := n -> n/r(n): A := proc (n) if n = 1 then x elif bigomega(n) = 1 then x*(B(pi(n))+C(pi(n))) else A(r(n))*A(s(n))/x end if end proc: B := proc (n) if n = 1 then 0 elif bigomega(n) = 1 then A(pi(n)) else sort(expand(B(r(n))*B(s(n))+B(r(n))*C(s(n))+B(s(n))*C(r(n)))) end if end proc: C := proc (n) if n = 1 then 1 elif bigomega(n) = 1 then B(pi(n)) else expand(C(r(n))*C(s(n))) end if end proc: if n = 1 then x else sort(expand(A(n)+B(n))) end if end proc: seq(subs(x = 1, P(n)), n = 1 .. 120);
    # For a more efficient calculation, the procedure P() could easily be simplified and optimized to yield A212628(n): remove "sort(expand...)" and replace x with 1 in appropriate places. - M. F. Hasler, Jan 06 2013
  • Mathematica
    r[n_] := FactorInteger[n][[1, 1]];
    s[n_] := n/r[n];
    A[n_] := Which[n == 1, x, PrimeOmega[n] == 1, x*(B[PrimePi[n]] + c[PrimePi[n]]), True, A[r[n]]*A[s[n]]/x];
    B[n_] := Which[n == 1, 0, PrimeOmega[n] == 1, A[PrimePi[n]], True, B[r[n]]*B[s[n]] + B[r[n]]*c[s[n]] + B[s[n]]*c[r[n]]];
    c[n_] := Which[n == 1, 1, PrimeOmega[n] == 1, B[PrimePi[n]], True, c[r[n]]*c[s[n]]];
    P[n_] := A[n] + B[n];
    a[n_] := CoefficientList[P[n], x] // Total;
    Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Jun 20 2024, after Maple code *)

Formula

a(n) = Sum_{k>=1} A212627(n,k).

A212629 Number of vertices in all maximal independent vertex subsets in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

1, 2, 3, 3, 6, 6, 4, 4, 9, 9, 9, 8, 8, 8, 14, 5, 8, 15, 5, 11, 11, 14, 15, 10, 22, 15, 25, 10, 11, 20, 14, 6, 22, 11, 17, 19, 10, 10, 20, 13, 15, 18, 10, 17, 33, 25, 20, 12, 13, 28, 17, 18, 6, 36, 32, 12, 13, 20, 11, 24, 19, 22, 29, 7, 31, 31, 10, 13, 33, 24, 13, 23, 18, 19, 45, 12, 26, 32
Offset: 1

Views

Author

Emeric Deutsch, Jun 08 2012

Keywords

Comments

A vertex subset in a tree is said to be independent if no pair of vertices is connected by an edge. The empty set is considered to be independent. An independent vertex subset S of a tree is said to be maximal if every vertex that is not in S is joined by an edge to at least one vertex of S.
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.
Let A(n)=A(n,x), B(n)=B(n,x), C(n)=C(n,x) be the generating polynomial with respect to size of the maximal independent sets that contain the root, the maximal independent sets that do not contain the root, and the independent sets which are not maximal but become maximal if the root is removed, respectively. We have: A(1)=x, B(1)=0, C(1)=1, A(t-th prime) = x[B(t) + C(t)], B(t-th prime) = A(t), C(t-th prime)=B(t), A(rs)=A(r)A(s)/x, B(rs)=B(r)B(s)+B(r)C(s)+B(s)C(r), C(rs)=C(r)C(s) (r,s>=2). The generating polynomial of the maximal independent vertex subsets with respect to size is P(n, x)=A(n,x)+B(n,x). Then a(n)=subs(x=1, dP(n,x)/dx). The Maple program is based on these relations.

Examples

			a(11)=9 because the rooted tree with Matula-Goebel number 11 is the path tree on 5 vertices R - A - B - C - D; the maximal independent vertex subsets are {R,C}, {A,C}, {A,D}, and {R,B,D}.
		

Crossrefs

Programs

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

Formula

a(n) = Sum(k*A212627(n,k), k>=1).

Extensions

Sequences A212618-A212632 edited by M. Marcus and M. F. Hasler, Jan 06 2013
Showing 1-4 of 4 results.