the numerical semigroup tree
APR 27, 2026
inkhaven
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 , where the vertices of depth are exactly the numerical semigroups of genus . This tree was first described by Rosales in their 1991 thesis Semigrupos numéricos. We explain how 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 if and only if . We'll call this graph .
We do have to show is actually a rooted tree. To do so, we need to establish that for every numerical semigroup , there is a unique (directed) path from to . (Note that is the only candidate for the root, since it has no incoming edges.) The idea is that you can add to to get another numerical semigroup that is one step closer to .
Lemma. Let be a numerical semigroup. Then is a numerical semigroup.
Proof. The set is clearly cofinite and contains zero. To show that is closed under addition, it suffices to note that for all nonzero , we have by definition of . So is a numerical semigroup.
If we rinse and repeat the "add the Frobenius number" process, we eventually fill in all the gaps of . This means we have a path to , which clearly has length . 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 be the directed graph whose vertices are numerical semigroups, which has the edge if and only if . Then is a rooted tree with root vertex . Furthermore, the set of vertices of with depth is exactly the set of numerical semigroups with genus .
For the rest of the post, we'll call this tree the numerical semigroup tree.
what do the children look like?
In establishing the fact that 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 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 be a numerical semigroup, and let . Then is a minimal generator of .
Proof. It is clear that is not a sum of two nonzero elements of , so it also cannot be a sum of two nonzero elements of . But , so it must be a minimal generator of .
Lemma. Let be a numerical semigroup, and let be a minimal generator greater than . Then is a numerical semigroup with Frobenius number .
Proof. It is obvious that , and that is cofinite. Let . It is obvious that if either or is zero, so suppose they are both nonzero. Since these are also elements of , we have that . But is a minimal generator of , so it is not the sum of two nonzero elements of ; that is, . Therefore, is closed under addition. So is a numerical semigroup. Since is greater than , we know that contains all natural numbers greater than , and we conclude that has Frobenius number .
Together, these lemmas say that the direct children of a numerical semigroup are exactly the numerical semigroups that can be obtained by removing a minimal generator greater than .2 So if you know all the numerical semigroups of genus (i.e., those with depth ), you can compute all the numerical semigroups of genus .
This makes it relatively simple to compute all the numerical semigroups of genus 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 increased with 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 . We say that is a numerical semigroup if
- The complement is finite,
- The set is closed under addition; that is, implies , and
- The element .
We have some special names for a elements with respect to a numerical semigroup . The smallest nonzero element of is called the multiplicity, denoted . The elements of are called gaps, the greatest of which is called the Frobenius number, denoted . The number of gaps is called the genus, denoted .
We can generate numerical semigroups similarly to how we generate vector spaces. The numerical semigroup generated by the positive integers , denoted , is the set of nonnegative linear combinations of the 's; that is,
The 's are called generators. Every numerical semigroup has a set of minimal generators, which is the unique set of generators with the property that no proper subset of generates . The relevant piece of theory for us is the following: if we write , the set of minimal generators of is
That is, the minimal generators are the nonzero elements of that are not the sum of two nonzero elements of .
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, is a numerical semigroup.
| Symbol | Definition |
|---|---|
| the multiplicity of | |
| the genus of | |
| the Frobenius number of |