OFFSET
1,3
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.
LINKS
Emeric Deutsch, Tree statistics from Matula numbers, arXiv preprint arXiv:1111.4288 [math.CO], 2011.
F. Goebel, On a 1-1-correspondence between rooted trees and natural numbers, J. Combin. Theory, B 29 (1980), 141-143.
I. Gutman, B. Furtula and M. Petrovic, Terminal Wiener index, J. Math. Chem., 46. 2009, 522-531.
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 Rev. 10 (1968) 273.
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.
EXAMPLE
a(7)=6 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y (2+2+2=6).
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);
CROSSREFS
KEYWORD
nonn
AUTHOR
Emeric Deutsch, Sep 29 2011
STATUS
approved