A196050 Number of edges in the rooted tree with Matula-Goebel number n.
0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 4, 4, 5, 4, 5, 5, 5, 5, 5, 6, 5, 6, 5, 5, 6, 5, 5, 6, 5, 6, 6, 5, 5, 6, 6, 5, 6, 5, 6, 7, 6, 6, 6, 6, 7, 6, 6, 5, 7, 7, 6, 6, 6, 5, 7, 6, 6, 7, 6, 7, 7, 5, 6, 7, 7, 6, 7, 6, 6, 8, 6, 7, 7, 6, 7, 8, 6, 6, 7, 7, 6, 7, 7, 6, 8, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 6, 7, 7, 7, 8, 6, 6, 8, 6, 8
Offset: 1
Keywords
Examples
a(7) = 3 because the rooted tree with Matula-Goebel number 7 is the rooted tree Y. a(2^m) = m because the rooted tree with Matula-Goebel number 2^m is the star tree with m edges.
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. Göbel, 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.
- Wolfdieter Lang, Complete prime function reduction for n = 2..100.
- 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
Crossrefs
Programs
-
Haskell
import Data.List (genericIndex) a196050 n = genericIndex a196050_list (n - 1) a196050_list = 0 : g 2 where g x = y : g (x + 1) where y = if t > 0 then a196050 t + 1 else a196050 r + a196050 s 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: r := proc (n) options operator, arrow: op(1, factorset(n)) end proc: s := proc (n) options operator, arrow: n/r(n) end proc: if n = 1 then 0 elif bigomega(n) = 1 then 1+a(pi(n)) else a(r(n))+a(s(n)) end if end proc: seq(a(n), n = 1 .. 110);
-
Mathematica
a[1] = 0; a[n_?PrimeQ] := a[n] = 1 + a[PrimePi[n]]; a[n_] := Total[#[[2]] * a[#[[1]] ]& /@ FactorInteger[n]]; Array[a, 110] (* Jean-François Alcover, Nov 16 2017 *) difac[n_]:=If[n==1,{},With[{i=PrimePi[FactorInteger[n][[1,1]]]},Sort[Prepend[difac[n*i/Prime[i]],i]]]]; Table[Length[difac[n]],{n,100}] (* Gus Wiseman, Mar 23 2019 *)
-
PARI
a(n) = my(f=factor(n)); [self()(primepi(p))+1 |p<-f[,1]]*f[,2]; \\ Kevin Ryde, May 28 2021
-
Python
from functools import lru_cache from sympy import isprime, primepi, factorint @lru_cache(maxsize=None) def A196050(n): if n == 1 : return 0 if isprime(n): return 1+A196050(primepi(n)) return sum(e*A196050(p) for p, e in factorint(n).items()) # Chai Wah Wu, Mar 19 2022
Comments