the numerical semigroup tree

APR 27, 2026

inkhaven


See the appendix for a crash course in numerical semigroups and a table of notation.

A numerical semigroup is a cofinite submonoid of the natural numbers1 under addition. The set of numerical semigroups can be arranged into a rooted tree T\mathcal{T}, where the vertices of depth gg are exactly the numerical semigroups of genus gg. This tree was first described by Rosales in their 1991 thesis Semigrupos numéricos. We explain how T\mathcal{T} can be used to enumerate numerical semigroups by genus, and also discuss some interesting applications.

constructing the tree


Here's how to construct the tree: Make a directed graph with numerical semigroups as vertices, and add the edge STS \rightarrow T if and only if S=T{F(T)}S = T\cup \{F(T)\}. We'll call this graph T\mathcal{T}.

We do have to show T\mathcal{T} is actually a rooted tree. To do so, we need to establish that for every numerical semigroup SS, there is a unique (directed) path from N\mathbb{N} to SS. (Note that N\mathbb{N} is the only candidate for the root, since it has no incoming edges.) The idea is that you can add F(S)F(S) to SS to get another numerical semigroup that is one step closer to N\mathbb{N}.

Lemma. Let SS be a numerical semigroup. Then S{F(S)}S \cup \{F(S)\} is a numerical semigroup.

Proof. The set S{F(S)}S \cup \{F(S)\} is clearly cofinite and contains zero. To show that S{F(S)}S \cup \{F(S)\} is closed under addition, it suffices to note that for all nonzero sSs \in S, we have s+F(S)Ss + F(S) \in S by definition of F(S)F(S). So S{F(S)}S \cup \{F(S)\} is a numerical semigroup. \blacksquare

If we rinse and repeat the "add the Frobenius number" process, we eventually fill in all the gaps of SS. This means we have a path to N\mathbb{N}, which clearly has length gg. It's also obvious that this path is unique, since any numerical semigroup has exactly one incoming edge. We sum up all of this in the following proposition:

Proposition. Let T\mathcal{T} be the directed graph whose vertices are numerical semigroups, which has the edge STS \rightarrow T if and only if S=T{F(T)}S = T\cup \{F(T)\}. Then T\mathcal{T} is a rooted tree with root vertex N\mathbb{N}. Furthermore, the set of vertices of T\mathcal{T} with depth gg is exactly the set of numerical semigroups with genus gg.

For the rest of the post, we'll call this tree T\mathcal{T} the numerical semigroup tree.

what do the children look like?


In establishing the fact that T\mathcal{T} is indeed a rooted tree, we showed that every numerical semigroup has exactly one parent. In particular, we know that we move up the tree by adding in the Frobenius number. But a numerical semigroup may have multiple children, and understanding what these children look like is the key to using T\mathcal{T} to enumerate numerical semigroups. It turns out that we move down the tree by removing minimal generators that are larger than the Frobenius number.

Lemma. Let TT be a numerical semigroup, and let S=T{F(T)}S = T \cup \{F(T)\}. Then F(T)F(T) is a minimal generator of SS.

Proof. It is clear that F(T)F(T) is not a sum of two nonzero elements of TT, so it also cannot be a sum of two nonzero elements of SS. But F(T)SF(T) \in S, so it must be a minimal generator of SS. \blacksquare

Lemma. Let SS be a numerical semigroup, and let sSs\in S be a minimal generator greater than F(S)F(S). Then S{s}S \setminus \{s\} is a numerical semigroup with Frobenius number ss.

Proof. It is obvious that 0S{s}0 \in S \setminus \{s\}, and that S{s}S \setminus \{s\} is cofinite. Let a,bS{s}a, b \in S \setminus \{s\}. It is obvious that a+bS{s}a+b \in S \setminus \{s\} if either aa or bb is zero, so suppose they are both nonzero. Since these are also elements of SS, we have that a+bSa+b \in S. But ss is a minimal generator of SS, so it is not the sum of two nonzero elements of SS; that is, a+bsa+b \neq s. Therefore, S{s}S \setminus \{s\} is closed under addition. So S{s}S \setminus \{s\} is a numerical semigroup. Since ss is greater than F(S)F(S), we know that SS contains all natural numbers greater than ss, and we conclude that S{s}S \setminus \{s\} has Frobenius number ss. \blacksquare

Together, these lemmas say that the direct children of a numerical semigroup SS are exactly the numerical semigroups that can be obtained by removing a minimal generator greater than F(S)F(S).2 So if you know all the numerical semigroups of genus gg (i.e., those with depth gg), you can compute all the numerical semigroups of genus g+1g+1.

This makes it relatively simple to compute all the numerical semigroups of genus gg by doing a breadth-first search, and in 2008, Bras-Amorós ran such a search of the tree up to genus 50. A more recent paper by Fromentin and Hivert uses a depth-first search and other optimizations to compute the numerical semigroups up to genus 67. But you do eventually run into computational limits, because the number of numerical semigroups grows exponentially with genus.

related cool results


The numerical semigroup tree has been used to do some pretty cool things.

As we mentioned, the tree is generally useful for computing numerical semigroups, so related algorithms have been used to collect data related to outstanding conjectures. For example, the paper by Fromentin and Hivert mentioned above confirms Wilf's conjecture up to genus 60, a major conjecture in numerical semigroup theory. Later that year, Delgado, Eliahou, and Fromentin verified Wilf's conjecture up to genus 100. To support these efforts, there continue to be advances in the computational efficiency through approaches like the method of seeds by Bras-Amorós and Fernández-González and the Bras-Amorós' unleaved tree method.

Also, the fact that the tree organizes numerical semigroups at all means that it can act a framework to study numerical semigroups with respect to different invariants. For example, García-Sánchez, Marín-Aragón, and Robles-Pérez studied numerical semigroups of small multiplicity via the numerical semigroup tree in 2018, counting numerical semigroups of fixed multiplicity and genus. In 2025, Chappelon, Ramírez Alfonsín, and Stamate used the tree to count numerical semigroups of a given genus and type (another numerical semigroup invariant). In both cases, the authors considered the number of numerical semigroups with respect to some invariant as a function of the genus.

One last cool result: Earlier, I offhandedly mentioned that the number of numerical semigroups grows exponentially with genus, but this is a nontrivial result proven by Zhai in 2011. Before this result, it was unproven whether the number of numerical semigroups of genus gg increased with gg at all, though it seemed true on a heuristic level. Using the numerical semigrouup tree, Zhai proved that the number of numerical semigroups exhibits Fibonacci-like growth, confirming a conjecture of Bras-Amorós.

appendix


Here's a refresher of some definitions. If you've seen numerical semigroups before, you can skip to the end for a table of notation.

A numerical semigroup is a cofinite submonoid of the natural numbers under addition, which is a lot of word salad to say the following:

Definition (Numerical semigroup). Let SNS \subseteq \mathbb{N}. We say that SS is a numerical semigroup if

  1. The complement NS\mathbb{N} \setminus S is finite,
  2. The set SS is closed under addition; that is, x,ySx, y\in S implies x+ySx+y \in S, and
  3. The element 0S0 \in S.

We have some special names for a elements with respect to a numerical semigroup SS. The smallest nonzero element of SS is called the multiplicity, denoted m(S)m(S). The elements of NS\mathbb{N} \setminus S are called gaps, the greatest of which is called the Frobenius number, denoted F(S)F(S). The number of gaps is called the genus, denoted g(S)g(S).

We can generate numerical semigroups similarly to how we generate vector spaces. The numerical semigroup generated by the positive integers x1,,xnx_{1}, \dots, x_n, denoted x1,,xn\langle x_{1},\dots, x_n\rangle, is the set of nonnegative linear combinations of the xix_i's; that is,

x1,xn={a1x1++anxn:aiN}.\langle x_{1}\dots, x_{n}\rangle = \{a_1x_{1}+\cdots + a_{n}x_{n}:a_{i}\in \mathbb{N}\}.

The xix_{i}'s are called generators. Every numerical semigroup SS has a set of minimal generators, which is the unique set of generators XX with the property that no proper subset of XX generates SS. The relevant piece of theory for us is the following: if we write S=S{0}S^{*}= S\setminus \{0\}, the set of minimal generators of SS is

X={sS:sa+b for all a,bS}.X= \{s \in S^*:s \neq a+b \text{ for all } a, b \in S^*\}.

That is, the minimal generators are the nonzero elements of SS that are not the sum of two nonzero elements of SS.

This is enough theory to get you through the post, but if you want more information, I would recommend the wonderful monograph Numerical Semigroups by J.C. Rosales and P.A. García-Sánchez.

Table of Notation


In the following, SS is a numerical semigroup.

SymbolDefinition
m(S)m(S)the multiplicity of SS
g(S)g(S)the genus of SS
F(S)F(S)the Frobenius number of SS

footnotes


  1. 00 is a natural number, do not argue with me.

  2. For convenience, define F(N)=1F(\mathbb{N}) = -1.

kaylee kim


made with


back to top