cp's OEIS Frontend

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.

Showing 1-10 of 10 results.

A358730 Positions of first appearances in A358729 (number of nodes minus node-height).

Original entry on oeis.org

1, 4, 8, 16, 27, 54, 81, 162, 243, 486, 729, 1458, 2187, 4374, 6561, 13122, 19683, 39366, 59049
Offset: 1

Views

Author

Gus Wiseman, Dec 01 2022

Keywords

Comments

First differs from A334198 in having 13122 instead of 12005.
Node-height is the number of nodes in the longest path from root to leaf.
After initial terms, this appears to become A038754.

Examples

			The terms together with their corresponding rooted trees begin:
      1: o
      4: (oo)
      8: (ooo)
     16: (oooo)
     27: ((o)(o)(o))
     54: (o(o)(o)(o))
     81: ((o)(o)(o)(o))
    162: (o(o)(o)(o)(o))
    243: ((o)(o)(o)(o)(o))
    486: (o(o)(o)(o)(o)(o))
    729: ((o)(o)(o)(o)(o)(o))
		

Crossrefs

Positions of first appearances in A358729.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height.
A055277 counts rooted trees by nodes and leaves.
MG differences: A358580, A358724, A358726, A358729.

Programs

  • Mathematica
    MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    rd=Table[Count[MGTree[n],_,{0,Infinity}]-(Depth[MGTree[n]]-1),{n,10000}];
    Table[Position[rd,k][[1,1]],{k,Union[rd]}]

A196050 Number of edges in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

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

Views

Author

Emeric Deutsch, Sep 27 2011

Keywords

Comments

The Matula-Goebel number of a rooted tree is 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.
a(n) is, for n >= 2, the number of prime function prime(.) = A000040(.) operations in the complete reduction of n. See the W. Lang link with a list of the reductions for n = 2..100, where a curly bracket notation {.} is used for prime(.). - Wolfdieter Lang, Apr 03 2018
From Gus Wiseman, Mar 23 2019: (Start)
Every positive integer has a unique factorization (encoded by A324924) into factors q(i) = prime(i)/i, i > 0. For example:
11 = q(1) q(2) q(3) q(5)
50 = q(1)^3 q(2)^2 q(3)^2
360 = q(1)^6 q(2)^3 q(3)
In this factorization, a(n) is the number of factors counted with multiplicity. For example, a(11) = 4, a(50) = 7, a(360) = 10.
(End)
From Antti Karttunen, Oct 23 2023: (Start)
Totally additive with a(prime(n)) = 1 + a(n).
Number of iterations of A366385 (or equally, of A366387) needed to reach 1.
(End)

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.
		

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

Formula

a(1)=0; if n = prime(t) (the t-th prime), then a(n)=1 + a(t); if n = r*s (r,s>=2), then a(n)=a(r)+a(s). The Maple program is based on this recursive formula.
a(n) = A061775(n) - 1.
a(n) = A109129(n) + A366388(n) = A109082(n) + A358729(n). - Antti Karttunen, Oct 23 2023

A358552 Node-height of the rooted tree with Matula-Goebel number n. Number of nodes in the longest path from root to leaf.

Original entry on oeis.org

1, 2, 3, 2, 4, 3, 3, 2, 3, 4, 5, 3, 4, 3, 4, 2, 4, 3, 3, 4, 3, 5, 4, 3, 4, 4, 3, 3, 5, 4, 6, 2, 5, 4, 4, 3, 4, 3, 4, 4, 5, 3, 4, 5, 4, 4, 5, 3, 3, 4, 4, 4, 3, 3, 5, 3, 3, 5, 5, 4, 4, 6, 3, 2, 4, 5, 4, 4, 4, 4, 5, 3, 4, 4, 4, 3, 5, 4, 6, 4, 3, 5, 5, 3, 4, 4, 5, 5, 4, 4, 4, 4, 6, 5, 4, 3, 5, 3, 5, 4, 5, 4, 4, 4, 4, 3, 4, 3
Offset: 1

Views

Author

Gus Wiseman, Nov 26 2022

Keywords

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.

Examples

			The Matula-Goebel number of ((ooo(o))) is 89, and it has node-height 4, so a(89) = 4.
		

Crossrefs

Positions of first appearances are A007097.
This statistic is counted by A034781, ordered A080936.
The ordered version is A358379(n) + 1.
A000081 counts rooted trees, ordered A000108.
A055277 counts rooted trees by nodes and leaves, ordered A001263.
Other statistics: A061775 (nodes), A109082 (edge-height), A109129 (leaves), A196050 (edges), A342507 (internals).

Programs

  • 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}]
  • 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

Formula

a(n) = A109082(n) + 1.
a(n) = A061775(n) - A358729(n). - Antti Karttunen, Oct 23 2023

Extensions

Data section extended up to a(108) by Antti Karttunen, Oct 23 2023

A358576 Matula-Goebel numbers of rooted trees whose node-height equals their number of internal (non-leaf) nodes.

Original entry on oeis.org

9, 15, 18, 21, 23, 30, 33, 35, 36, 39, 42, 46, 47, 49, 51, 57, 60, 61, 66, 70, 72, 73, 77, 78, 83, 84, 87, 91, 92, 93, 94, 95, 98, 102, 111, 113, 114, 119, 120, 122, 123, 129, 132, 133, 137, 140, 144, 146, 149, 151, 154, 156, 159, 166, 167, 168, 174, 177, 181
Offset: 1

Views

Author

Gus Wiseman, Nov 25 2022

Keywords

Comments

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.
Node-height is the number of nodes in the longest path from root to leaf.

Examples

			The terms together with their corresponding rooted trees begin:
   9: ((o)(o))
  15: ((o)((o)))
  18: (o(o)(o))
  21: ((o)(oo))
  23: (((o)(o)))
  30: (o(o)((o)))
  33: ((o)(((o))))
  35: (((o))(oo))
  36: (oo(o)(o))
  39: ((o)(o(o)))
  42: (o(o)(oo))
  46: (o((o)(o)))
  47: (((o)((o))))
  49: ((oo)(oo))
  51: ((o)((oo)))
  57: ((o)(ooo))
  60: (oo(o)((o)))
  61: ((o(o)(o)))
		

Crossrefs

The version for edge-height is A209638.
Square trees are A358577, counted by A358589, ordered A358590.
The version for leaves instead of height is A358578, counted by A185650.
These trees are counted by A358587, ordered A358588.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height.
A055277 counts rooted trees by leaves, ordered A001263.

Programs

  • Mathematica
    MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],Count[MGTree[#],[_],{0,Infinity}]==Depth[MGTree[#]]-1&]

Formula

A358552(a(n)) = A342507(a(n)).

A358724 Difference between the number of internal (non-leaf) nodes and the edge-height of the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 2, 0, 2, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 2, 1, 1, 0, 1, 2, 1, 0, 0, 2, 2, 0, 1, 0, 0, 1, 1, 0, 2, 0, 2, 1, 0, 0, 2, 1, 0, 1, 1, 0, 3, 0, 1, 1, 0, 0, 3, 0, 1, 1, 2, 0, 1
Offset: 1

Views

Author

Gus Wiseman, Nov 29 2022

Keywords

Comments

Edge-height (A109082) is the number of edges in the longest path from root to leaf.
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.

Examples

			The tree (o(o)((o))(oo)) with Matula-Goebel number 210 has edge-height 3 and 5 internal nodes, so a(210) = 2.
		

Crossrefs

Positions of 0's are A209638, complement A358725.
Positions of 1's are A358576, counted by A358587.
Other differences: A358580, A358726, A358729.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height, ordered A080936.
A055277 counts rooted trees by nodes and leaves, ordered A001263.

Programs

  • Mathematica
    MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Count[MGTree[n],[_],{0,Infinity}]-(Depth[MGTree[n]]-2),{n,100}]

Formula

a(n) = A342507(n) - A109082(n).

A358726 Difference between the node-height and the number of leaves in the rooted tree with Matula-Goebel number n.

Original entry on oeis.org

0, 1, 2, 0, 3, 1, 1, -1, 1, 2, 4, 0, 2, 0, 2, -2, 2, 0, 0, 1, 0, 3, 2, -1, 2, 1, 0, -1, 3, 1, 5, -3, 3, 1, 1, -1, 1, -1, 1, 0, 3, -1, 1, 2, 1, 1, 3, -2, -1, 1, 1, 0, -1, -1, 3, -2, -1, 2, 3, 0, 1, 4, -1, -4, 1, 2, 1, 0, 1, 0, 2, -2, 1, 0, 1, -2, 2, 0, 4, -1
Offset: 1

Views

Author

Gus Wiseman, Nov 29 2022

Keywords

Comments

Node-height is the number of nodes in the longest path from root to leaf.
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.

Examples

			The tree (oo(oo(o))) with Matula-Goebel number 148 has node-height 4 and 5 leaves, so a(148) = -1.
		

Crossrefs

Positions of first appearances are A007097 and latter terms of A000079.
Positions of 0's are A358577.
Other differences: A358580, A358724, A358729.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height, ordered A080936.
A055277 counts rooted trees by nodes and leaves, ordered A001263.

Programs

  • Mathematica
    MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[(Depth[MGTree[n]]-1)-Count[MGTree[n],{},{0,Infinity}],{n,1000}]

Formula

a(n) = A358552(n) - A109129(n).

A358725 Matula-Goebel numbers of rooted trees with a greater number of internal (non-leaf) vertices than edge-height.

Original entry on oeis.org

9, 15, 18, 21, 23, 25, 27, 30, 33, 35, 36, 39, 42, 45, 46, 47, 49, 50, 51, 54, 55, 57, 60, 61, 63, 65, 66, 69, 70, 72, 73, 75, 77, 78, 81, 83, 84, 85, 87, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100, 102, 103, 105, 108, 110, 111, 113, 114, 115, 117, 119, 120, 121
Offset: 1

Views

Author

Gus Wiseman, Nov 29 2022

Keywords

Comments

Edge-height (A109082) is the number of edges in the longest path from root to leaf.
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.

Examples

			The terms together with their corresponding trees begin:
   9: ((o)(o))
  15: ((o)((o)))
  18: (o(o)(o))
  21: ((o)(oo))
  23: (((o)(o)))
  25: (((o))((o)))
  27: ((o)(o)(o))
  30: (o(o)((o)))
  33: ((o)(((o))))
  35: (((o))(oo))
  36: (oo(o)(o))
  39: ((o)(o(o)))
  42: (o(o)(oo))
  45: ((o)(o)((o)))
  46: (o((o)(o)))
  47: (((o)((o))))
  49: ((oo)(oo))
  50: (o((o))((o)))
		

Crossrefs

Complement of A209638 (the case of equality).
These trees are counted by A316321.
Positions of positive terms in A358724.
The case of equality for node-height is A358576.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height, ordered A080936
A055277 counts rooted trees by nodes and leaves, ordered A001263.
Differences: A358580, A358724, A358726, A358729.

Programs

  • Mathematica
    MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],Count[MGTree[#],[_],{0,Infinity}]>Depth[MGTree[#]]-2&]

Formula

A342507(a(n)) > A109082(a(n)).

A358731 Matula-Goebel numbers of rooted trees whose number of nodes is one more than their node-height.

Original entry on oeis.org

4, 6, 7, 10, 13, 17, 22, 29, 41, 59, 62, 79, 109, 179, 254, 277, 293, 401, 599, 1063, 1418, 1609, 1787, 1913, 2749, 4397, 8527, 10762, 11827, 13613, 15299, 16519, 24859, 42043, 87803
Offset: 1

Views

Author

Gus Wiseman, Dec 01 2022

Keywords

Comments

These are paths with a single extra leaf growing from them.
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.
Node-height is the number of nodes in the longest path from root to leaf.

Examples

			The terms together with their corresponding rooted trees begin:
    4: (oo)
    6: (o(o))
    7: ((oo))
   10: (o((o)))
   13: ((o(o)))
   17: (((oo)))
   22: (o(((o))))
   29: ((o((o))))
   41: (((o(o))))
   59: ((((oo))))
   62: (o((((o)))))
   79: ((o(((o)))))
  109: (((o((o)))))
  179: ((((o(o)))))
  254: (o(((((o))))))
  277: (((((oo)))))
  293: ((o((((o))))))
  401: (((o(((o))))))
  599: ((((o((o))))))
		

Crossrefs

These trees are counted by A289207.
Positions of 1's in A358729.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height.
A055277 counts rooted trees by nodes and leaves.
MG differences: A358580, A358724, A358726, A358729.

Programs

  • Mathematica
    MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[1000],Count[MGTree[#],_,{0,Infinity}]==Depth[MGTree[#]]&]

A366386 Excess of n when n is factored into factors q(i) = prime(i)/i: a(n) = A196050(n) - A324923(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 1, 2, 2, 1, 0, 2, 1, 2, 2, 3, 1, 3, 2, 2, 2, 1, 2, 3, 3, 2, 4, 3, 1, 3, 0, 4, 2, 2, 2, 4, 2, 3, 3, 3, 1, 3, 2, 2, 4, 3, 2, 4, 4, 4, 2, 3, 3, 5, 3, 4, 3, 2, 1, 4, 3, 1, 4, 5, 3, 3, 2, 3, 4, 3, 2, 5, 2, 3, 5, 4, 2, 4, 1, 4, 6, 2, 2, 4, 2, 3, 3, 3, 3, 5, 3, 4, 2, 3, 3, 5, 3, 5, 4, 5, 2, 3, 4, 4, 4, 4, 3, 6
Offset: 1

Views

Author

Antti Karttunen, Oct 23 2023

Keywords

Crossrefs

Cf. A007097 (positions of 0's), A358731 (of 1's).
Cf. also A046660, A358729.

Programs

  • PARI
    A006530(n) = if(1==n, n, my(f=factor(n)); f[#f~, 1]);
    A366386(n) = { my(lista = List([]), gpf, i); while(n > 1, gpf=A006530(n); i = primepi(gpf); n /= gpf; n *= i; listput(lista,i)); #lista - #Set(lista); };

Formula

a(n) = A196050(n) - A324923(n).
a(n) <= A358729(n).

A358727 Matula-Goebel numbers of rooted trees with greater number of leaves (width) than node-height.

Original entry on oeis.org

8, 16, 24, 28, 32, 36, 38, 42, 48, 49, 53, 54, 56, 57, 63, 64, 72, 76, 80, 81, 84, 96, 98, 104, 106, 108, 112, 114, 120, 126, 128, 131, 133, 136, 140, 144, 147, 148, 152, 156, 159, 160, 162, 168, 171, 172, 178, 180, 182, 184, 189, 190, 192, 196, 200, 204, 208
Offset: 1

Views

Author

Gus Wiseman, Dec 01 2022

Keywords

Comments

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.
Node-height is the number of nodes in the longest path from root to leaf.

Examples

			The terms together with their corresponding rooted trees begin:
   8: (ooo)
  16: (oooo)
  24: (ooo(o))
  28: (oo(oo))
  32: (ooooo)
  36: (oo(o)(o))
  38: (o(ooo))
  42: (o(o)(oo))
  48: (oooo(o))
  49: ((oo)(oo))
  53: ((oooo))
  54: (o(o)(o)(o))
  56: (ooo(oo))
  57: ((o)(ooo))
  63: ((o)(o)(oo))
  64: (oooooo)
  72: (ooo(o)(o))
  76: (oo(ooo))
		

Crossrefs

Positions of negative terms in A358726.
These trees are counted by A358728.
Differences: A358580, A358724, A358726, A358729.
A000081 counts rooted trees, ordered A000108.
A034781 counts rooted trees by nodes and height, ordered A080936.
A055277 counts rooted trees by nodes and leaves, ordered A001263.

Programs

  • Mathematica
    MGTree[n_]:=If[n==1,{},MGTree/@Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[1000],Depth[MGTree[#]]-1
    				
Showing 1-10 of 10 results.