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.
%I A196058 #30 Jun 27 2024 09:42:09 %S A196058 0,1,2,2,3,3,2,2,4,4,4,3,3,3,5,2,3,4,2,4,4,5,4,3,6,4,4,3,4,5,5,2,6,4, %T A196058 5,4,3,3,5,4,4,4,3,5,5,4,5,3,4,6,5,4,2,4,7,3,4,5,4,5,4,6,4,2,6,6,3,4, %U A196058 5,5,4,4,4,4,6,3,6,5,5,4,4,5,4,4,6,4,6,5,3,5,5,4,7,5,5,3,6,4,6,6,4,5,4,4,5,3,3,4,5,7,5,3,5,4,6,5,5,5,5,5 %N A196058 Diameter (i.e., largest distance between two vertices) of the rooted tree with Matula-Goebel number n. %C A196058 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. %H A196058 François Marques, <a href="/A196058/b196058.txt">Table of n, a(n) for n = 1..10000</a>. %H A196058 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 A196058 F. Göbel, <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 A196058 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 A196058 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 A196058 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 A196058 <a href="/index/Mat#matula">Index entries for sequences related to Matula-Goebel numbers</a> %F A196058 a(1)=0; if n=prime(t), then a(n)=max(a(t), 1+H(t)); if n=r*s (r,s,>=2), then a(n)=max(a(r), a(s), H(r)+H(s)), where H(m) is the height of the tree with Matula-Goebel number m (see A109082). The Maple program is based on this recursive formula. %F A196058 The Gutman et al. references contain a different recursive formula. %F A196058 a(n^k) = 2*A109082(n) for k > 1. - _François Marques_, Mar 13 2021 %e A196058 a(2^m) = 2 because the rooted tree with Matula-Goebel number 2^m is a star with m edges. %p A196058 with(numtheory): a := proc (n) local r, s, H: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: H := proc (n) if n = 1 then 0 elif bigomega(n) = 1 then 1+H(pi(n)) else max(H(r(n)), H(s(n))) end if end proc: if n = 1 then 0 elif bigomega(n) = 1 then max(a(pi(n)), 1+H(pi(n))) else max(a(r(n)), a(s(n)), H(r(n))+H(s(n))) end if end proc: seq(a(n), n = 1 .. 120); %t A196058 r[n_] := r[n] = FactorInteger[n][[1, 1]]; %t A196058 s[n_] := s[n] = n/r[n]; %t A196058 H[n_] := H[n] = Which[n == 1, 0, PrimeOmega[n] == 1, 1 + H[PrimePi[n]], True, Max[H[r[n]], H[s[n]]]]; %t A196058 a[n_] := a[n] = Which[n == 1, 0, PrimeOmega[n] == 1, Max[a[PrimePi[n]], 1 + H[PrimePi[n]]], True, Max[a[r[n]], a[s[n]], H[r[n]] + H[s[n]]]]; %t A196058 Table[a[n], {n, 1, 120}] (* _Jean-François Alcover_, Nov 13 2017, after _Emeric Deutsch_ *) %o A196058 (PARI) HD(n) = { if(n==1, return([0,0]), %o A196058 my(f=factor(n)~, h=0, d=0, hd); %o A196058 foreach(f, p, %o A196058 hd=HD(primepi(p[1])); %o A196058 hd[1]++; %o A196058 d=max(max(d,if(p[2]>1, 2*hd[1], hd[2])),h+hd[1]); %o A196058 h=max(h,hd[1]) %o A196058 ); %o A196058 return([h,d]) %o A196058 ) %o A196058 }; %o A196058 A196058(n)=HD(n)[2]; \\ _François Marques_, Mar 13 2021 %Y A196058 Cf. A109082. %K A196058 nonn %O A196058 1,3 %A A196058 _Emeric Deutsch_, Sep 30 2011