A342507 Number of internal nodes in rooted tree with Matula-Goebel number n.
0, 1, 2, 1, 3, 2, 2, 1, 3, 3, 4, 2, 3, 2, 4, 1, 3, 3, 2, 3, 3, 4, 4, 2, 5, 3, 4, 2, 4, 4, 5, 1, 5, 3, 4, 3, 3, 2, 4, 3, 4, 3, 3, 4, 5, 4, 5, 2, 3, 5, 4, 3, 2, 4, 6, 2, 3, 4, 4, 4, 4, 5, 4, 1, 5, 5, 3, 3, 5, 4, 4, 3, 4, 3, 6, 2, 5, 4, 5, 3, 5, 4, 5, 3, 5, 3, 5, 4, 3, 5, 4, 4, 6, 5, 4, 2, 6, 3, 6, 5
Offset: 1
Keywords
Examples
a(7) = 2 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y. a(2^m) = 1 because the rooted tree with Matula-Goebel number 2^m is the star tree with m edges.
Links
Crossrefs
Programs
-
Mathematica
MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]; Table[Count[MGTree[n],[_],{0,Infinity}],{n,100}] (* Gus Wiseman, Nov 28 2022 *)
-
PARI
A342507(n) = if( n==1, 0, my(f=factor(n)); 1+sum(k=1,matsize(f)[1],A342507(primepi(f[k,1]))*f[k,2]));
Comments