OFFSET
1,2
COMMENTS
Edge-height is given by A109082 (see formula).
The Matula-Goebel number of a rooted tree is the product of primes indexed by the Matula-Goebel numbers of the branches of its root, which gives a bijective correspondence between positive integers and unlabeled rooted trees.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..100000
FORMULA
a(n) = A109082(n) + 1.
EXAMPLE
The Matula-Goebel number of ((ooo(o))) is 89, and it has node-height 4, so a(89) = 4.
MATHEMATICA
MGTree[n_]:=If[n==1, {}, MGTree/@If[n==1, {}, Flatten[Cases[FactorInteger[n], {p_, k_}:>Table[PrimePi[p], {k}]]]]];
Table[Depth[MGTree[n]]-1, {n, 100}]
PROG
(PARI) A358552(n) = { my(v=factor(n)[, 1], d=0); while(#v, d++; v=fold(setunion, apply(p->factor(primepi(p))[, 1]~, v))); (1+d); }; \\ (after Kevin Ryde in A109082) - Antti Karttunen, Oct 23 2023
(Python)
from functools import lru_cache
from sympy import isprime, primepi, primefactors
@lru_cache(maxsize=None)
def A358552(n):
if n == 1 : return 1
if isprime(n): return 1+A358552(primepi(n))
return max(A358552(p) for p in primefactors(n)) # Chai Wah Wu, Apr 15 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 26 2022
EXTENSIONS
Data section extended up to a(108) by Antti Karttunen, Oct 23 2023
STATUS
approved