%I #23 Jun 21 2024 07:34:51
%S 0,0,0,0,1,1,0,0,2,2,2,2,2,2,3,0,2,4,0,3,3,3,4,3,4,4,6,4,3,5,3,0,4,3,
%T 4,6,3,3,5,4,4,6,4,4,7,6,5,4,4,6,4,6,0,9,5,6,4,5,3,7,6,4,8,0,6,6,3,4,
%U 7,7,4,8,6,6,8,6,5,8,4,5,12,5,6,9,5,6,6,5,4,10,6,8,5,7,5,5,6,8,8,8,6,6,9,8,9,4,6,12,5,7
%N The Wiener polarity index of the rooted tree with Matula-Goebel number n.
%C The Wiener polarity index of a connected graph G is the number of unordered pairs {i,j} of vertices of G such that the distance between i and j is 3.
%C 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.
%D H. Deng, H. Xiao and F. Tang, On the extremal Wiener polarity index of trees with a given diameter, MATCH, Commun. Math. Comput. Chem., 63, 2010, 257-264.
%D W. Du, X. Li and Y. Shi, Algorithms and extremal problem on Wiener polarity index, MATCH, Commun. Math. Comput. Chem., 62, 2009, 235-244.
%H Emeric Deutsch, <a href="http://arxiv.org/abs/1111.4288">Tree statistics from Matula numbers</a>, arXiv preprint arXiv:1111.4288 [math.CO], 2011.
%H F. Goebel, <a href="http://dx.doi.org/10.1016/0095-8956(80)90049-0">On a 1-1-correspondence between rooted trees and natural numbers</a>, J. Combin. Theory, B 29 (1980), 141-143.
%H I. Gutman and A. Ivic, <a href="http://dx.doi.org/10.1016/0012-365X(95)00182-V">On Matula numbers</a>, Discrete Math., 150, 1996, 131-142.
%H I. Gutman and Yeong-Nan Yeh, <a href="http://www.emis.de/journals/PIMB/067/3.html">Deducing properties of trees from their Matula numbers</a>, Publ. Inst. Math., 53 (67), 1993, 17-22.
%H D. W. Matula, <a href="http://www.jstor.org/stable/2027327">A natural rooted tree enumeration by prime factorization</a>, SIAM Rev. 10 (1968) 273.
%H <a href="/index/Mat#matula">Index entries for sequences related to Matula-Goebel numbers</a>
%F a(n) is the coefficient of x^3 in the Wiener polynomial of the rooted tree with Matula-Goebel number n. The coefficients of these Wiener polynomials are given in A196059. The Maple program is based on the above.
%e a(7)=0 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y with no pair of vertices at distance 3.
%e a(11) = 2 because the rooted tree with Matula-Goebel number 7 is a path on 5 vertices, say a, b, c, d, e, with each of the pairs {a,d} and {b,e} at distance 3.
%p 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: coeff(WP(n), x, 3) end proc: seq(a(n), n = 1 .. 110);
%t r[n_] := FactorInteger[n][[1, 1]];
%t s[n_] := n/r[n];
%t R[n_] := Which[n == 1, 0, PrimeOmega[n] == 1, x*R[PrimePi[n]] + x, True, R[r[n]] + R[s[n]]];
%t 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]]];
%t a[n_] := Coefficient[WP[n], x, 3];
%t Table[a[n], {n, 1, 110}] (* _Jean-François Alcover_, Jun 21 2024, after Maple code *)
%Y Cf. A196059
%K nonn
%O 1,9
%A _Emeric Deutsch_, Oct 12 2011