A196051 The Wiener index of the rooted tree with Matula-Goebel number n.
0, 1, 4, 4, 10, 10, 9, 9, 20, 20, 20, 18, 18, 18, 35, 16, 18, 31, 16, 32, 32, 35, 31, 28, 56, 31, 48, 29, 32, 50, 35, 25, 56, 32, 52, 44, 28, 28, 50, 46, 31, 46, 29, 52, 72, 48, 50, 40, 48, 75, 52, 46, 25, 64, 84, 42, 46, 50, 32, 67, 44, 56, 67, 36, 76, 76, 28, 48, 72, 70, 46, 59, 46, 44, 102, 42, 79, 68, 52, 62, 88, 50, 48, 62, 79, 46, 75, 71, 40, 92, 71, 67, 84, 72, 71, 54, 75, 65, 104, 96
Offset: 1
Keywords
Examples
a(7)=9 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y (1+1+1+2+2+2=9). a(2^m) = m^2 because the rooted tree with Matula-Goebel number 2^m is a star with m edges and we have m distances 1 and m(m-1)/2 distances 2; m + m(m-1)=m^2.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- 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 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.
- Index entries for sequences related to Matula-Goebel numbers
Programs
-
Haskell
import Data.List (genericIndex) a196051 n = genericIndex a196051_list (n - 1) a196051_list = 0 : g 2 where g x = y : g (x + 1) where y | t > 0 = a196051 t + a196047 t + a196050 t + 1 | otherwise = a196051 r + a196051 s + a196047 r * a196050 s + a196047 s * a196050 r 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, E, PL: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: E := proc (n) 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: PL := proc (n) if n = 1 then 0 elif bigomega(n) = 1 then 1+E(pi(n))+PL(pi(n)) else PL(r(n))+PL(s(n)) end if end proc: if n = 1 then 0 elif bigomega(n) = 1 then a(pi(n))+PL(pi(n))+1+E(pi(n)) else a(r(n))+a(s(n))+PL(r(n))*E(s(n))+PL(s(n))*E(r(n)) end if end proc: seq(a(n), n = 1 .. 100);
-
Mathematica
r[n_] := FactorInteger[n][[1, 1]]; s[n_] := n/r[n]; e[n_] := Which[n == 1, 0, PrimeOmega[n] == 1, 1 + e[PrimePi[n]], True, e[r[n]] + e[s[n]]]; PL[n_] := Which[n == 1, 0, PrimeOmega[n] == 1, 1 + e[PrimePi[n]] + PL[PrimePi[n]], True, PL[r[n]] + PL[s[n]]]; a[n_] := Which[n == 1, 0, PrimeOmega[n] == 1, a[PrimePi[n]] + PL[PrimePi[n]] + 1 + e[PrimePi[n]], True, a[r[n]] + a[s[n]] + PL[r[n]]*e[s[n]] + PL[s[n]]*e[r[n]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 25 2024, after Maple code *)
Formula
a(1)=0; if n = prime(t) (the t-th prime), then a(n)=a(t)+PL(t)+E(t)+1; if n=rs (r,s>=2), then a(n)=a(r)+a(s)+PL(r)E(s)+PL(s)E(r); PL(m) and E(m) denote the path length and the number of edges of the rooted tree with Matula number m (see A196047, A196050). The Maple program is based on this recursive formula.
Comments