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 14 results. Next

A127301 Matula-Goebel signatures for plane general trees encoded by A014486.

Original entry on oeis.org

1, 2, 4, 3, 8, 6, 6, 7, 5, 16, 12, 12, 14, 10, 12, 9, 14, 19, 13, 10, 13, 17, 11, 32, 24, 24, 28, 20, 24, 18, 28, 38, 26, 20, 26, 34, 22, 24, 18, 18, 21, 15, 28, 21, 38, 53, 37, 26, 37, 43, 29, 20, 15, 26, 37, 23, 34, 43, 67, 41, 22, 29, 41, 59, 31, 64, 48, 48, 56, 40, 48, 36
Offset: 0

Views

Author

Antti Karttunen, Jan 16 2007

Keywords

Comments

This sequence maps A000108(n) oriented (plane) rooted general trees encoded in range [A014137(n-1)..A014138(n)] of A014486 to A000081(n+1) distinct non-oriented rooted general trees, encoded by their Matula-Goebel numbers. The latter encoding is explained in A061773.
A005517 and A005518 give the minimum and maximum value occurring in each such range.
Primes occur at positions given by A057548 (not in order, and with duplicates), and similarly, semiprimes, A001358, occur at positions given by A057518, and in general, A001222(a(n)) = A057515(n).
If the signature-permutation of a Catalan automorphism SP satisfies the condition A127301(SP(n)) = A127301(n) for all n, then it preserves the non-oriented form of a general tree, which implies also that it is Łukasiewicz-word permuting, satisfying A129593(SP(n)) = A129593(n) for all n >= 0. Examples of such automorphisms include A072796, A057508, A057509/A057510, A057511/A057512, A057164, A127285/A127286 and A127287/A127288.
A206487(n) tells how many times n occurs in this sequence. - Antti Karttunen, Jan 03 2013

Examples

			A000081(n+1) distinct values occur each range [A014137(n-1)..A014138(n-1)]. As an example, A014486(5) = 44 (= 101100 in binary = A063171(5)), encodes the following plane tree:
.....o
.....|
.o...o
..\./.
...*..
Matula-Goebel encoding for this tree gives a code number A000040(1) * A000040(A000040(1)) = 2*3 = 6, thus a(5)=6.
Likewise, A014486(6) = 50 (= 110010 in binary = A063171(6)) encodes the plane tree:
.o
.|
.o...o
..\./.
...*..
Matula-Goebel encoding for this tree gives a code number A000040(A000040(1)) * A000040(1) = 3*2 = 6, thus a(6) is also 6, which shows these two trees are identical if one ignores their orientation.
		

Crossrefs

a(A014138(n)) = A007097(n+1), a(A014137(n)) = A000079(n+1) for all n.
a(|A106191(n)|) = A033844(n-1) for all n >= 1.
For standard instead of binary encoding we have A358506.
A000108 counts ordered rooted trees, unordered A000081.
A014486 lists binary encodings of ordered rooted trees.

Programs

  • Mathematica
    mgnum[t_]:=If[t=={},1,Times@@Prime/@mgnum/@t];
    binbalQ[n_]:=n==0||With[{dig=IntegerDigits[n,2]},And@@Table[If[k==Length[dig],SameQ,LessEqual][Count[Take[dig,k],0],Count[Take[dig,k],1]],{k,Length[dig]}]];
    bint[n_]:=If[n==0,{},ToExpression[StringReplace[StringReplace[ToString[IntegerDigits[n,2]/.{1->"{",0->"}"}],","->""],"} {"->"},{"]]];
    Table[mgnum[bint[n]],{n,Select[Range[0,1000],binbalQ]}] (* Gus Wiseman, Nov 22 2022 *)
  • Scheme
    (define (A127301 n) (*A127301 (A014486->parenthesization (A014486 n)))) ;; A014486->parenthesization given in A014486.
    (define (*A127301 s) (if (null? s) 1 (fold-left (lambda (m t) (* m (A000040 (*A127301 t)))) 1 s)))

Formula

A001222(a(n)) = A057515(n) for all n.

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)).

A358729 Difference between the number of nodes and the node-height of the rooted tree with Matula-Goebel number 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, 3, 1, 2, 3, 3, 2, 4, 3, 1, 3, 0, 4, 2, 2, 3, 4, 2, 3, 3, 3, 1, 4, 2, 2, 4, 3, 2, 4, 4, 4, 3, 3, 3, 5, 3, 4, 4, 2, 1, 4, 3, 1, 5, 5, 4, 3, 2, 3, 4, 4, 2, 5, 3, 3, 5, 4, 3, 4, 1, 4, 6, 2, 2, 5, 4, 3, 3, 3, 3, 5, 4, 4, 2, 3, 4, 5, 3, 5, 4, 5, 2, 4, 4, 4, 5, 4, 3, 6
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.
Because the number of distinct terminal subtrees of the rooted tree with Matula-Goebel number n, i.e., A317713(n) (= 1+A324923(n)), is always at least one larger than the depth of the same tree (= A109082(n)), it follows that a(n) >= A366386(n) for all n. - Antti Karttunen, Oct 23 2023

Examples

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

Crossrefs

Positions of 0's are A007097.
Positions of first appearances are A358730.
Positions of 1's are A358731.
Other differences: A358580, A358724, A358726.
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]]-1),{n,100}]
  • PARI
    A061775(n) = if(1==n, 1, if(isprime(n), 1+A061775(primepi(n)), {my(pfs,t,i); pfs=factor(n); pfs[,1]=apply(t->A061775(t),pfs[,1]); (1-bigomega(n)) + sum(i=1, omega(n), pfs[i,1]*pfs[i,2])}));
    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 program given in A109082 by Kevin Ryde, Sep 21 2020)
    A358729(n) = (A061775(n)-A358552(n)); \\ Antti Karttunen, Oct 23 2023

Formula

a(n) = A061775(n) - A358552(n).
a(n) = A196050(n) - A109082(n). - Antti Karttunen, Oct 23 2023

Extensions

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

A209636 Matula-numbers computed for rooted trees encoded by A071162/A071163.

Original entry on oeis.org

1, 2, 4, 3, 8, 6, 7, 5, 16, 12, 14, 10, 19, 13, 17, 11, 32, 24, 28, 20, 38, 26, 34, 22, 53, 37, 43, 29, 67, 41, 59, 31, 64, 48, 56, 40, 76, 52, 68, 44, 106, 74, 86, 58, 134, 82, 118, 62, 131, 89, 107, 71, 163, 101, 139, 79, 241, 157, 191, 109, 331, 179, 277
Offset: 0

Views

Author

Antti Karttunen, Mar 11 2012

Keywords

Comments

Sequence is injective: Any number occurs at most once, as each plane tree encoded by A071162/A071163 is mapped to a unique non-oriented rooted tree. See also A209637, A209638.
Sequence A209638 gives the same terms sorted into ascending order.

Crossrefs

Programs

  • PARI
    A209636(n) = { my(n=2*n, m=1); while(n >= 2, if(!(n%2),m*=2,m = prime(m)); n\=2); m; } \\ Antti Karttunen, May 25 2017
    
  • Python
    from sympy import prime
    def a(n):
        n = 2*n
        m = 1
        if n<2: return 1
        while n>1:
            if n%2==0:
                n//=2
                m*=2
            else:
                n=(n - 1)//2
                m=prime(m)
        return m
    print([a(n) for n in range(101)]) # Indranil Ghosh, May 25 2017, translated from Antti Karttunen's SCHEME code
  • Scheme
    (define (A209636 n) (let loop ((n (* 2 n)) (m 1)) (cond ((< n 2) m) ((even? n) (loop (/ n 2) (* m 2))) (else (loop (/ (- n 1) 2) (A000040 m))))))
    

Formula

a(n) = A127301(A071163(n)) = A209637(A054429(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).

A209637 Matula-numbers computed for rooted trees encoded by A071162 when interpreted in once-halved bit-tuple format.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 6, 8, 11, 17, 13, 19, 10, 14, 12, 16, 31, 59, 41, 67, 29, 43, 37, 53, 22, 34, 26, 38, 20, 28, 24, 32, 127, 277, 179, 331, 109, 191, 157, 241, 79, 139, 101, 163, 71, 107, 89, 131, 62, 118, 82, 134, 58, 86, 74, 106, 44, 68, 52, 76, 40, 56, 48
Offset: 0

Views

Author

Antti Karttunen, Mar 11 2012

Keywords

Comments

Sequence A209638 gives the same terms sorted into ascending order.

References

  • Mueller, Szymanski, Knop and Trinajstic, A Comparison between the Matula Numbers and Bit-tuple Notation for Rooted Trees J. Chem. Inf. Comput. Sci. 1995, 35, pp. 211--213.

Programs

  • Python
    from sympy import prime
    from mpmath import log
    def a054429(n): return 3*(2**int(log(n, 2))) - (n + 1)
    def a209636(n):
        n = 2*n
        m = 1
        if n<2: return 1
        while n>1:
            if n%2==0:
                n/=2
                m*=2
            else:
                n=(n - 1)/2
                m=prime(m)
        return m
    def a(n): return 1 if n==0 else a209636(a054429(n)) # Indranil Ghosh, May 26 2017

Formula

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)).

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

A243494 A243493 sorted into ascending order, with duplicates removed.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 14, 16, 20, 22, 23, 24, 26, 28, 31, 32, 34, 37, 39, 40, 44, 46, 47, 48, 52, 56, 61, 62, 64, 68, 74, 76, 78, 80, 86, 88, 89, 92, 94, 96, 101, 104, 109, 112, 113, 118, 122, 123, 124
Offset: 0

Views

Author

Antti Karttunen, Jun 07 2014

Keywords

Crossrefs

Subsequences: A000079, A007097.
Showing 1-10 of 14 results. Next