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.

A206491 Irregular triangle read by rows: T(n,k) is the number of root subtrees with k nodes in the rooted tree having Matula-Goebel number n.

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, May 08 2012

Keywords

Comments

A root subtree of a rooted tree G is a subtree of G containing the root.
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 = A061775(n).
Sum of entries in row n = A184160(n).
For the number of all subtrees of a given size, see A212620.

Examples

			Row 7 is 1,1,2,1 because the rooted tree with Matula-Goebel number 7 is Y; its five root subtrees have 1, 2, 3, 3, and 4 nodes.
		

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 Y-N. 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.

Crossrefs

Programs

  • Maple
    with(numtheory): 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: R := proc (n, k) 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 and k = 1 then 1 elif n = 1 and 1 < k then 0 elif bigomega(n) = 1 and k = 1 then 1 elif bigomega(n) = 1 then R(pi(n), k-1) else add(R(r(n), j)*R(s(n), k+1-j), j = 1 .. k) end if end proc: for n to 40 do seq(R(n, k), k = 1 .. V(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];
    R[n_, k_] := Which[n == 1 && k == 1, 1, n == 1 && 1 < k, 0, PrimeOmega[n] == 1 && k == 1, 1, PrimeOmega[n] == 1, R[PrimePi[n], k-1], True, Sum[R[r[n], j]*R[s[n], k+1-j], {j, 1, k}]];
    Table[R[n, k], {n, 1, 40}, {k, 1, V[n]}] // Flatten (* Jean-François Alcover, Oct 13 2024, after Emeric Deutsch *)

A184161 Number of subtrees in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

1, 3, 6, 6, 10, 10, 11, 11, 15, 15, 15, 17, 17, 17, 21, 20, 17, 25, 20, 24, 24, 21, 25, 30, 28, 25, 36, 28, 24, 34, 21, 37, 28, 24, 32, 44, 30, 30, 34, 41, 25, 40, 28, 32, 48, 36, 34, 55, 37, 45, 32, 40, 37, 64, 36, 49, 41, 34, 24, 59, 44, 28, 57, 70, 44, 44, 30, 37, 48, 53, 41, 81, 40, 44, 63, 49, 41, 56, 32, 74
Offset: 1

Views

Author

Emeric Deutsch, Oct 19 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

			a(4) = 6 because the rooted tree with Matula-Goebel number 4 is V; it has 6 subtrees (three 1-vertex subtrees, two 1-edge subtrees, and the tree itself).
		

Crossrefs

Cf. A184160 (subtrees containing the root), A184164 (numbers not occurring as terms).

Programs

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

Formula

Let b(n)=A184160(n) denote the number of those subtrees of the rooted tree with Matula-Goebel number n that contain the root. Then a(1)=1; if n=prime(t) (=the t=th prime), then a(n)=1+a(t)+b(t); if n=r*s (r,s,>=2), then a(n)=a(r)+a(s)+(b(r)-1)*(b(s)-1)-1. The Maple program is based on this recursive formula.

A328880 If n = Product (p_j^k_j) then a(n) = Product (a(pi(p_j)) + 1), where pi = A000720, with a(1) = 1.

Original entry on oeis.org

1, 2, 3, 2, 4, 6, 3, 2, 3, 8, 5, 6, 7, 6, 12, 2, 4, 6, 3, 8, 9, 10, 4, 6, 4, 14, 3, 6, 9, 24, 6, 2, 15, 8, 12, 6, 7, 6, 21, 8, 8, 18, 7, 10, 12, 8, 13, 6, 3, 8, 12, 14, 3, 6, 20, 6, 9, 18, 5, 24, 7, 12, 9, 2, 28, 30, 4, 8, 12, 24, 9, 6, 10, 14, 12, 6, 15, 42, 11, 8
Offset: 1

Views

Author

Ilya Gutkovskiy, Oct 29 2019

Keywords

Examples

			a(36) = 6 because 36 = 2^2 * 3^2 = prime(1)^2 * prime(2)^2 and (a(1) + 1) * (a(2) + 1) = (1 + 1) * (2 + 1) = 6.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := Times @@ (a[PrimePi[#[[1]]]] + 1 & /@ FactorInteger[n]); Table[a[n], {n, 1, 80}]
  • PARI
    a(n)={my(f=factor(n)[,1]); prod(i=1, #f, 1 + a(primepi(f[i])))} \\ Andrew Howroyd, Oct 29 2019

Formula

a(n) = a(prime(n)) - 1.

A184162 Number of chains in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

1, 3, 7, 5, 15, 9, 11, 7, 13, 17, 31, 11, 19, 13, 21, 9, 23, 15, 15, 19, 17, 33, 27, 13, 29, 21, 19, 15, 35, 23, 63, 11, 37, 25, 25, 17, 23, 17, 25, 21, 39, 19, 27, 35, 27, 29, 43, 15, 21, 31, 29, 23, 19, 21, 45, 17, 21, 37, 47, 25, 31, 65, 23, 13, 33, 39, 31, 27, 33, 27, 39, 19, 35, 25, 35, 19, 41, 27, 67, 23
Offset: 1

Views

Author

Emeric Deutsch, Oct 19 2011

Keywords

Comments

The vertices of a rooted tree can be regarded as a partially ordered set, where u<=v holds for two vertices u and v if and only if u lies on the unique path between v and the root. A chain is a nonempty set of pairwise comparable vertices.
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(5) = 15 because the rooted tree with Matula-Goebel number 5 is a path ABCD on 4 vertices and any nonempty subset of {A,B,C,D} is a chain.
		

Crossrefs

Cf. A109082 (height), A196056 (vertices at levels).
Cf. A184160 (antichains).

Programs

  • Haskell
    import Data.List (genericIndex)
    a184162 n = genericIndex a184162_list (n - 1)
    a184162_list = 1 : g 2 where
       g x = y : g (x + 1) where
         y = if t > 0 then 2 * a184162 t + 1 else a184162 r + a184162 s - 1
             where t = a049084 x; r = a020639 x; s = x `div` r
    -- Reinhard Zumkeller, Sep 03 2013
    
  • Maple
    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 1 elif bigomega(n) = 1 then 1+2*a(pi(n)) else a(r(n))+a(s(n))-1 end if end proc: seq(a(n), n = 1 .. 80);
  • Mathematica
    r[n_] := FactorInteger[n][[1, 1]];
    s[n_] := n/r[n];
    a[n_] := Which[n == 1, 1, PrimeOmega[n] == 1, 1 + 2*a[PrimePi[n]], True, a[r[n]] + a[s[n]] - 1];
    Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Jun 24 2024, after Maple code *)
  • PARI
    a(n) = my(f=factor(n)); [self()(primepi(p)) |p<-f[,1]] * f[,2]*2 + 1; \\ Kevin Ryde, Aug 25 2021

Formula

a(1)=1; if n=prime(t), then a(n)=1+2a(t); if n=r*s (r,s,>=2), then a(n)=a(r)+a(s)-1. The Maple program is based on this recursive formula.
a(n) = 1 + Sum_{k=1..A109082(n)} A196056(n,k)*2^k. - Kevin Ryde, Aug 25 2021

A198338 Irregular triangle read by rows: row n is the sequence of Matula numbers of the rooted subtrees of the rooted tree with Matula-Goebel number n. A root subtree of a rooted tree T is a subtree of T containing the root.

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Dec 04 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.
Number of entries in row n is A184160(n). Row n>=2 can be easily identified: it starts with the entry following the first occurrence of n-1 and it ends with the first occurrence of n.

Examples

			Row 4 is [1,2,2,4] because the rooted tree with Matula-Goebel number 4 is V and its root subtrees are *, |, |, and V.
Triangle starts:
1;
1,2;
1,2,3;
1,2,2,4;
1,2,3,5;
1,2,2,3,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.

Crossrefs

Cf. A198339.

Programs

  • Maple
    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 sort([1, seq(ithprime(mrst[pi(n)][i]), i = 1 .. nops(mrst[pi(n)]))]) else sort([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: for n to 1000 do mrst[n] := MRST(n) end do;

Formula

Row 1 is [1]; if n = p(t) (= the t-th prime), then row n is [1, p(a), p(b), ... ], where [a,b,...] is row t; if n=rs (r,s >=2), then row n consists of the numbers r[i]*s[j], where [r[1], r[2],...] is row r and [s[1], s[2], ...] is row s. The Maple program, based on this recursive procedure, yields row n (<=1000; adjustable) with the command MRST(n).
Showing 1-5 of 5 results.