On the enumeration of the set of numerical semigroups with fixed Frobenius number and fixed number of second kind gaps

We study how certain invariants of numerical semigroups relate to the number of second kind gaps. Furthermore, given two fixed non-negative integers F and k, we provide an algorithm to compute all the numerical semigroups whose Frobenius number is F and which have exactly k second kind gaps.


Introduction
If a 1 , . . . , a e are positive integers such that gcd(a 1 , . . . , a e ) = 1, then a classical problem in additive number theory is the Frobenius problem: what is the greatest integer F which is not an element of the set a 1 N + . . . + a e N? Although this problem is solved when e = 2 (see [19]), it is well known that it is not possible to find a polynomial formula in order to compute F if e ≥ 3 (see [5]). Therefore, many efforts have been made to obtain partial results or to develop algorithms to get the answer of this question (for instance, see [11]).
Before continuing, let us recall some definitions and notations used in numerical semigroups.
Let Z and N be the set of integers and the set of non-negative integers respectively. A numerical semigroup is a subset S of N which is closed under addition, 0 ∈ S, and N \ S is finite.
The elements of N \ S are called the gaps of S, and its cardinality, denoted by g(S), is the genus of S.
The Frobenius number of S, denoted by F(S), is the greatest integer that does not belong to S.
The conductor of S, denoted by c(S), is the least integer c such that c+n ∈ S for all n ∈ N. Note that c(S) ∈ S and c(S) = F(S) + 1.
The pseudo-Frobenius numbers of S are the elements of the set PF(S) = x ∈ Z \ S | x + s ∈ S for all s ∈ S \ {0} (see [15]). Moreover, the cardinality of PF(S), denoted by t(S), is the type of S (see [8]).
We denote by N(S) = {s ∈ S | s < F(S)} (whose elements are known as small elements of S). It is clear that the sets H(S) = {F(S) − s | s ∈ N(S)} and L(S) = {x ∈ N \ S | F(S) − x ∈ N \ S} (equivalently, L(S) = {x ∈ N \ S | F(S) − x / ∈ N(S)}) are subsets of N \ S and, in addition, N = S · ∪ H(S) · ∪ L(S) (that is, S, H(S), and L(S) define a partition of N). Following the notation in [9] (see also [2]), the elements of H(S) and L(S) are the first and second kind gaps of S, respectively. Moreover, we denote by n(S) and l(S) the cardinality of N(S) (or H(S)) and L(S), respectively. Now, let A be a non-empty subset of N. Then we denote by A the submonoid of (N, +) generated by A, that is, A = λ 1 a 1 + · · · + λ n a n | n ∈ N \ {0}, a 1 , . . . , a n ∈ A, λ 1 , . . . , λ n ∈ N .

It is well known that A is a numerical semigroup if and only if gcd(A) = 1.
On the other hand, if S is a numerical semigroup and S = A , then we say that A is a system of generators of S. In addition, if S = B for any subset B A, then we say that A is a minimal system of generators of S. In [17] it is shown that each numerical semigroup has a unique minimal system of generators and that such a system is finite. We denote by msg(S) the minimal system of generators of S and by e(S) the cardinality of msg(S), that is called the embedding dimension of S.
Let l ∈ N. We say that a numerical semigroup S is an l-semigroup if l(S) = l. Our main purpose in this work is to give an algorithm which enables us to build all the l-semigroups with a fixed Frobenius number.
Let us summarize the content of this work. In Section 2 we show that the concepts of 0-semigroup and 1-semigroup coincide with the concepts of symmetric numerical semigroup and pseudo-symmetric numerical semigroup, respectively. These two classes of semigroups are of interest and have been widely studied (for instance, see [10] and [1]). Moreover, as it is shown in [16], they define a partition of the family of irreducible numerical semigroups.
In Section 4 we prove that, if l is an even number (odd number, respectively), then any l-semigroup with Frobenius number F can be obtained from a symmetric (pseudo-symmetric, respectively) numerical semigroup with Frobe-nius number F after removing l 2 ( l−1 2 , respectively) elements greater than F 2 and less than F . At last, in Section 5, we give an algorithm that enables us to compute all the l-semigroups with a fixed Frobenius number.
We end this introduction with a brief comment on Wilf's conjecture. Showing an algorithm to solve the Frobenius problem (among other purposes), in [20], Wilf conjectured that, if S is a numerical semigroup, then g(S) c(S) ≤ 1 − 1 e(S) . At present, this conjecture is open and its resolution is one of the most important problems in numerical semigroup theory (for instance, see the survey [6]). In Section 6 we show the above inequality in terms of the second king gaps and recover some known results about it.

0-semigroups and 1-semigroups
A numerical semigroup S is irreducible if it cannot be expressed as the intersection of two numerical semigroups which contain S properly. This concept was introduced in [16], where it is shown that a numerical semigroup S is irreducible if and only if S is maximal (with respect to the set inclusion) in the set of numerical semigroups with Frobenius number equal to F(S). From the results in [1] and [8], it is deduced in [16] that the family of irreducible numerical semigroups is the union of two well known families, namely the symmetric and the pseudo-symmetric numerical semigroups. Moreover, a numerical semigroup is symmetric (pseudo-symmetric, respectively) if it is irreducible and its Frobenius number is odd (even, respectively).
The following result is Corollary 4.5 of [17]. The next result has an easy proof and, therefore, we omit it. As a direct consequence of Lemmas 2.1 and 2.2, we have the following result. From Lemma 2.1 we also deduce a useful result that will be used several times in Section 6.  As an immediate consequence of Proposition 2.3 and Lemma 2.5, we have the next result.  Therefore, the set of almost symmetric numerical semigroups is exactly the set of (t − 1)-semigroups with type t. In particular, and as it is well known, every irreducible numerical semigroup is almost symmetric.

2-semigroups and 3-semigroups
We begin this section studying the numerical semigroups S such that l(S) = 2.
For that we need to introduce several concepts and results. If F is a positive integer, then we denote by S (F ) the set of all numerical semigroups with Frobenius number F .
Lemma 3.1. Let S be a numerical semigroup with Frobenius number F .
is a numerical semigroup that is irreducible and with Frobenius number F .
The next result has an immediate proof.   In the following result we show how to obtain all the l-semigroups when we know the (l − 2)-semigroups set. 2. There exist T ∈ S (F ) and x ∈ msg(T ) such that l(T ) = l−2, F 2 < x < F , and S = T \ {x}.
Let us observe that, as a consequence of Lemma 3.3 and Propositions 2.3 and 3.5, if Q is a numerical semigroup with l(Q) = 2, then there exist a symmetric numerical semigroup P and a number x ∈ msg(P ) such that x < F(P ) and Q = P \ {x}. Now, using the study about URSY-semigroups made in [14], we obtain information about the pseudo-Frobenius numbers of a 2-semigroup.
Recalling that a numerical semigroup S is an URSY-semigroup if there exists a symmetric numerical semigroup T and an x ∈ msg(T ) such that S = T \ {x}, then we can assert that every 2-semigroup is an URSY-semigroup. However, the converse is not true. For example, 2, 5 \ {5} = 2, 7 is an URSY-semigroup and l( 2, 7 ) = 0.
The next result can be easily deduced from Theorem 2.2 of [14]. Recall that, if S is a numerical semigroup, then m(S) = min(S \ {0}) is known as the multiplicity of S. The following result is obtained from Lemmas 2.3 and 2.7 of [14] and the proof of Proposition 3.5.
An immediate consequence of the above proposition is the next result. Let us illustrate the previous results with an example.
Now our purpose is to study the numerical semigroups S such that l(S) = 3. As a consequence of Lemma 3.3 and Propositions 2.3 and 3.5, we have that, if Q is a 3-semigroup, then there exists a pseudo-symmetric numerical semigroup P and an x ∈ msg(P ) such that F(P ) = F(Q), x < F(P ), and Q = P \ {x}.
We use the study made in [13] in order to obtain results about the pseudo-Frobenius numbers of the 3-semigroups.
Let us recall that a numerical semigroup S is an URPSY-semigroup if there exists a pseudo-symmetric numerical semigroup T and an x ∈ msg(T ) such that S = T \ {x}.
The following result can be deduced from Proposition 23 of [13].
The next result is deduced from Lemmas 25, 26, and 27 of [13]. As a direct consequence of the above proposition, we have the following result.   Remark 3.14. Having in mind Remark 2.7, it is clear that, in the above corollary, the case c corresponds to the 3-numerical semigroups which are almost symmetric.
In the next example we illustrate the above results. Now, let T be a numerical semigroup with l(T ) = 2n. We define the following sequence of numerical semigroups (recalling item 2 of Lemma 3.1).
Then, by applying Lemma 3.4, we have that T = T 0 T 1 · · · T n and l(T n ) = 0. Moreover, from Proposition 2.3, T n is a symmetric numerical semigroup. Finally, A = T n \ T ⊂ x ∈ T n F(Tn) 2 < x < F(T n ) and #(A) = n.
Let us illustrate the previous result with an example.   The following result has an immediate proof.  At this point, our purpose is to show an algorithm to compute [θ(I), I]. For that we need the concept of (rooted) tree.
A graph G is a pair (V, E) where V is a non-empty set (whose elements are called vertices of G) and E is a subset of {(v, w) ∈ V × V | v = w} (whose elements are called edges of G).
A path (of length n) connecting the vertices x and y of G is a sequence of different edges (v 0 , v 1 ), (v 1 , v 2 ), . . . , (v n−1 , v n ) such that v 0 = x and v n = y.
We say that a graph G is a (directed rooted) tree if there exists a vertex r (known as the root of G) such that, for any other vertex x of G, there exists a unique path connecting x and r. If (x, y) is an edge of the tree, then we say that x is a child of y (see [18]).    is a tree with root I. Moreover, if P is a vertex of such a tree, then its children set is P \ {x} x ∈ msg(P ), F(I) 2 < x < F(I) and h(P ) < x .
We are now ready to describe an algorithm which allows us to compute [θ(I), I]. If (x, y) is an ordered pair, then we denote by π 1 (x, y) = x.  (2) n := n + 1.
We depict in Figure 1 the tree G [θ(I), I] corresponding to this example. By the way, the number which appears over each edge (Q, P ) is the minimal generator x of P such that Q = P \ {x}. Note that x = h(Q). 5, 7, 9, 11 7 9 11 ✏ ✏ ✏ ✏ ✏ ✶ ✻ ✐ 5, 9, 11, 12 5, 7, 11 5, 7, 9 5, 11, 12, 14, 18 5, 9, 12, 16 5, 9, 11, 17 5, 7, 16, 18 Let G be a tree with root r. The depth of a vertex x of G is the number of edges in the unique path connecting x and r. The n-level of G is the set of all vertices with depth equal to n. Lastly, the height of G is the maximum depth of any vertex of G. (See [18].) Let us observe that, in Example 4.11, we have a tree of height 4. Moreover, the n-level of such a tree is B n (for n = 0, 1, 2, 3, 4).
The following result is easy to prove.  Let us observe that, if n ∈ N, we can compute all the 2n-semigroups ((2n+1)semigroups, respectively) in two steps.
Note that there exist infinitely many irreducible numerical semigroups I such that #(I \ θ(I)) = n. Therefore, there exist infinitely many 2n-semigroups and infinitely many (2n + 1)-semigroups. In the next section, we provide an algorithm which allows us to build the finite set consisting of all k-semigroups which have a given prescribed Frobenius number F .

k-semigroups with a fixed Frobenius number
In [4] it is shown a rather efficient algorithmic process to compute all the irreducible numerical semigroups with a prescribed Frobenius number. Let us briefly describe the basic idea of the algorithm. Let Proposition 5.2. Let F be a positive integer. Then G(I(F )) is a tree with root C(F ). Moreover, if S ∈ I(F ), then the children set of S is (S \ {x})∪{F − x} Let us illustrate both of the above results with an example.
Example 5.3. We want to compute all the irreducible numerical semigroups with Frobenius number 11. For that, we build the tree G(I(11)) starting at its root C(11) = 6, 7, 8, 9, 10 and adding to the known vertices their children (that are given by Proposition 5.2). Thus we have the tree of Figure 2 (for more details see Example 2.10 of [4]  The next result gives us the conditions that must be satisfied by two nonnegative integers k and F in order to have at least one k-semigroup with Frobenius number F . As usual, if q is a rational number, then we denote by ⌊q⌋ = max{z ∈ Z | z ≤ q}.  We are now interested in determining all the irreducible numerical semigroups I such that the set [θ(I), I] contains at least one k-semigroup. The following result can be easily deduced from Proposition 4.12.
Proposition 5.6. Let I be an irreducible numerical semigroup and k ∈ N such that F(I) + k is an odd number and F(I) ≥ k + 1. Then [θ(I), I] contains at least one k-semigroup if and only if #(I \ θ(I)) ≥ k 2 .
We are ready to show an algorithm which allows us to compute all the ksemigroups with a fixed Frobenius number. (1) If F + k is even, then return ∅.
(2) If F < k + 1, then return ∅.  is a partition of the set of all k-semigroups with Frobenius number F (see [3]).
The next result is useful to carry out the step (3) in the previous algorithm.
Proposition 5.9. Let F be a positive integer.
Let us see an illustrative example of Algorithm 5.7.
Example 5.10. Let us suppose that we want to build all the 6-semigroups with Frobenius number 11. For that we use Algorithm 5.7.