1 Introduction

If \(a_1,\ldots ,a_e\) are positive integers such that \(\gcd (a_1,\ldots ,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{\mathbb {N}}+\ldots +a_e{\mathbb {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\ge 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 \({\mathbb {Z}}\) and \({\mathbb {N}}\) be the set of integers and the set of non-negative integers respectively. A numerical semigroup is a subset S of \({\mathbb {N}}\) which is closed under addition, \(0 \in S\), and \({\mathbb {N}} \setminus S\) is finite.

The elements of \({\mathbb {N}}\setminus S\) are called the gaps of S, and its cardinality, denoted by \(\mathrm {g}(S)\), is the genus of S.

The Frobenius number of S, denoted by \(\mathrm {F}(S)\), is the greatest integer that does not belong to S.

The conductor of S, denoted by \(\mathrm {c}(S)\), is the least integer c such that \(c+n\in S\) for all \(n\in \mathbb {N}\). Note that \(\mathrm {c}(S)\in S\) and \(\mathrm {c}(S) = \mathrm {F}(S)+1\).

The pseudo-Frobenius numbers of S are the elements of the set \(\mathrm {PF}(S)= \big \{x\in {\mathbb {Z}} \setminus S \mid x+s\in S \text{ for } \text{ all } s\in S \setminus \{0\} \big \}\) (see [15]). Moreover, the cardinality of \(\mathrm {PF}(S)\), denoted by \(\mathrm {t}(S)\), is the type of S (see [8]).

We denote by \(\mathrm {N}(S)=\{s\in S \mid s<\mathrm {F}(S) \}\) (whose elements are known as small elements of S). It is clear that the sets \(\mathrm {H}(S)=\{\mathrm {F}(S)-s\mid s\in \mathrm {N}(S) \}\) and \(\mathrm {L}(S)=\{x \in {\mathbb {N}}\setminus S \mid \mathrm {F}(S)-x\in {\mathbb {N}}\setminus S\}\) (equivalently, \(\mathrm {L}(S)=\{x \in {\mathbb {N}}\setminus S \mid \mathrm {F}(S)-x\notin \mathrm {N}(S) \}\)) are subsets of \({\mathbb {N}}\setminus S\) and, in addition, (that is, S, H(S), and L(S) define a partition of \(\mathbb {N}\)). Following the notation in [9] (see also [2]), the elements of \(\mathrm {H}(S)\) and \(\mathrm {L}(S)\) are the first and second kind gaps of S, respectively. Moreover, we denote by \(\mathrm {n}(S)\) and \(\mathrm {l}(S)\) the cardinality of \(\mathrm {N}(S)\) (or \(\mathrm {H}(S)\)) and \(\mathrm {L}(S)\), respectively.

Now, let A be a non-empty subset of \({\mathbb {N}}\). Then we denote by \(\langle A \rangle \) the submonoid of \(({\mathbb {N}},+)\) generated by A, that is,

$$\begin{aligned} \langle A \rangle =\big \{\lambda _1a_1+\cdots +\lambda _na_n \mid n\in {\mathbb {N}}\setminus \{0\}, \ a_1,\ldots ,a_n\in A, \ \lambda _1,\ldots ,\lambda _n\in {\mathbb {N}}\big \}. \end{aligned}$$

It is well known that \(\langle A \rangle \) is a numerical semigroup if and only if \(\gcd (A)=1\). On the other hand, if S is a numerical semigroup and \(S=\langle A \rangle \), then we say that A is a system of generators of S. In addition, if \(S\not =\langle B \rangle \) for any subset \(B\subsetneq 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 \(\mathrm {msg}(S)\) the minimal system of generators of S and by \(\mathrm {e}(S)\) the cardinality of \(\mathrm {msg}(S)\), that is called the embedding dimension of S.

Let \(l\in {\mathbb {N}}\). We say that a numerical semigroup S is an l-semigroup if \(\mathrm {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 Sect. 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 [1, 10]). Moreover, as it is shown in [16], they define a partition of the family of irreducible numerical semigroups.

In Sect. 3 we relate the 2-semigroups (3-semigroups respectively) with the URSY-semigroups (URPSY-semigroups respectively), which were studied in [14] ([13] respectively). Moreover, as a consequence, we are able to obtain the pseudo-Frobenius numbers of the 2-semigroups and 3-semigroups.

In Sect. 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 Frobenius number F after removing \(\frac{l}{2}\) (\(\frac{l-1}{2}\), respectively) elements greater than \(\frac{F}{2}\) and less than F.

At last, in Sect. 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 \(\frac{\mathrm {g}(S)}{\mathrm {c}(S)}\le 1-\frac{1}{\mathrm {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 Sect. 6 we show the above inequality in terms of the second king gaps and recover some known results about it.

2 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 \(\mathrm {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].

Lemma 2.1

Let S be a numerical semigroup.

  1. 1.

    S is symmetric if and only if \(\mathrm {g}(S)=\frac{\mathrm {F}(S)+1}{2}\).

  2. 2.

    S is pseudo-symmetric if and only if \(\mathrm {g}(S)=\frac{\mathrm {F}(S)+2}{2}\).

The next result has an easy proof and, therefore, we omit it.

Lemma 2.2

If S is a numerical semigroup, then

  1. 1.

    \(\mathrm {g}(S)+\mathrm {n}(S)=\mathrm {F}(S)+1\);

  2. 2.

    \(\mathrm {g}(S)=\mathrm {n}(S)+\mathrm {l}(S)\);

  3. 3.

    \(\mathrm {g}(S)=\frac{\mathrm {F}(S)+1+\mathrm {l}(S)}{2}\).

As a direct consequence of Lemmas 2.1 and 2.2, we have the following result.

Proposition 2.3

If S is a numerical semigroup, then

  1. 1.

    S is symmetric if and only if \(\,\mathrm {l}(S)=0\);

  2. 2.

    S is pseudo-symmetric if and only if \(\,\mathrm {l}(S)=1\).

From Lemma 2.1 we also deduce a useful result that will be used several times in Sect. 6.

Corollary 2.4

If S is a numerical semigroup different from \(\mathbb {N}\), then \(\mathrm {F}(S)+\mathrm {l}(S)\) is an odd number and \(\mathrm {F}(S)\ge \mathrm {l}(S)+1\).

Proof

From item 3 of Lemma 2.1, it is clear that \(\mathrm {F}(S)+\mathrm {l}(S)\) is an odd number (even when \(S=\mathbb {N}\)). On the other hand, if S is a numerical semigroup different from \(\mathbb {N}\), then \(0\in \mathrm {N}(S)\) and, consequently, \(\mathrm {n}(S)\ge 1\). Now, combining items 1 and 2 of Lemma 2.1, we have that \(\mathrm {F}(S)\ge \mathrm {l}(S)+1\). \(\square \)

The next result is consequence of Corollaries 4.11 and 4.16 of [17].

Lemma 2.5

Let S be a numerical semigroup.

  1. a)

    The following conditions are equivalent.

    1. a.1)

      S is symmetric.

    2. a.2)

      \(\mathrm {PF}(S)=\{\mathrm {F}(S) \}\).

    3. a.3)

      \(\mathrm {t}(S)=1\).

  2. b)

    S is pseudo-symmetric if and only if \(\mathrm {PF}(S)=\left\{ \mathrm {F}(S),\frac{\mathrm {F}(S)}{2} \right\} \).

As an immediate consequence of Proposition 2.3 and Lemma 2.5, we have the next result.

Corollary 2.6

Let S be a numerical semigroup.

  1. 1.

    \(\mathrm {l}(S)=0\) if and only if \(\mathrm {PF}(S)=\{\mathrm {F}(S) \}\).

  2. 2.

    \(\mathrm {l}(S)=1\) if and only if \(\mathrm {PF}(S)=\left\{ \mathrm {F}(S),\frac{\mathrm {F}(S)}{2} \right\} \).

Remark 2.7

Let us recall that a numerical semigroup S is almost symmetric if \(\mathrm {L}(S) \subseteq \mathrm {PF}(S)\). This class of numerical semigroups was introduced in [2] and it is characterized by the formula

$$\begin{aligned} \mathrm {g}(S)=\frac{\mathrm {F}(S)+\mathrm {t}(S)}{2} \end{aligned}$$

and by the equality

$$\begin{aligned} \mathrm {PF}(S)=\mathrm {L}(S)\cup \{\mathrm {F}(S)\} . \end{aligned}$$

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.

3 2-Semigroups and 3-Semigroups

We begin this section studying the numerical semigroups S such that \(\mathrm {l}(S)=2\). For that we need to introduce several concepts and results.

If F is a positive integer, then we denote by \(\mathscr {S}(F)\) the set of all numerical semigroups with Frobenius number F.

The following result is deduced from [8] (or from Lemmas 4 and 5 in [3]).

Lemma 3.1

Let S be a numerical semigroup with Frobenius number F.

  1. 1.

    S is irreducible if and only if S is maximal in \(\mathscr {S}(F)\).

  2. 2.

    If \(\,h=\max \left\{ x\in {\mathbb {N}} \setminus S \,\big \vert \, F-x \in {\mathbb {N}} \setminus S \text{ and } x\not =\frac{F}{2} \right\} \), then \(S\cup \{h\} \in \mathscr {S}(F)\).

  3. 3.

    S is irreducible if and only if \(\left\{ x\in {\mathbb {N}} \setminus S \,\big \vert \, F-x \in {\mathbb {N}} \setminus S \text{ and } x\not =\frac{F}{2} \right\} = \emptyset \).

  4. 4.

    \(S \cup \left\{ x\in {\mathbb {N}} \setminus S \,\big \vert \, F-x \in {\mathbb {N}} \setminus S \text{ and } \, x>\frac{F}{2} \right\} \) is a numerical semigroup that is irreducible and with Frobenius number F.

The next result has an immediate proof.

Lemma 3.2

Let S be a numerical semigroup and \(x\in S\). Then \(S\setminus \{x\}\) is a numerical semigroup if and only if \(x\in \mathrm {msg}(S)\).

Now, from Lemma 2.2 we deduce the following one.

Lemma 3.3

Let S be a numerical semigroup and \(x\in \mathrm {msg}(S)\) such that \(x< \mathrm {F}(S)\). Then \(\mathrm {l}(S\setminus \{x\})=\mathrm {l}(S)+2\).

Let S be a numerical semigroup with \(\mathrm {l}(S)\ge 2\). Then, from Proposition 2.3, we know that S is not irreducible. Moreover, from Lemma 3.1, there exists \(\mathrm {h}(S)=\max \left\{ x\in {\mathbb {N}} \setminus S \,\big \vert \, \mathrm {F}(S)-x \in {\mathbb {N}} \setminus S \text{ and } \, x\not =\frac{\mathrm {F}(S)}{2} \right\} = \max \big (\mathrm {L}(S)\big )\) and \(S\cup \{\mathrm {h}(S)\}\) is a numerical semigroup. In addition, it is clear that \(\mathrm {h}(S)\) is a minimal generator of \(S\cup \{\mathrm {h}(S)\}\) which is less than \(\mathrm {F}(S\cup \{\mathrm {h}(S)\})\). Therefore, by applying Lemma 3.3, we have the next result.

Lemma 3.4

If \(S\in \mathscr {S}(F)\) and \(\,\mathrm {l}(S)\ge 2\), then \(\mathrm {l}(S\cup \{\mathrm {h}(S)\})=\mathrm {l}(S)-2\).

In the following result we show how to obtain all the l-semigroups when we know the \((l-2)\)-semigroups set.

Proposition 3.5

If \(S\in \mathscr {S}(F)\), then the following conditions are equivalent.

  1. 1.

    \(\mathrm {l}(S)=l\) and \(\,l\ge 2\).

  2. 2.

    There exist \(\,T\in \mathscr {S}(F)\) and \(x\in \mathrm {msg}(T)\) such that \(\,\mathrm {l}(T)=l-2\), \(\frac{F}{2}<x<F\), and \(S=T\setminus \{x\}\).

Proof

(1. \(\Rightarrow \) 2.) Since \(l\ge 2\), then there exists \(\mathrm {h}(S)\). Therefore, \(T=S\cup \{\mathrm {h}(S)\} \in \mathscr {S}(F)\) and \(\mathrm {h}(S)\) is a minimal generator of T such that \(\frac{F}{2}<\mathrm {h}(S)<F\). Moreover, from Lemma 3.4, \(\mathrm {l}(T)=\mathrm {l}(S)-2\). In order to finish the proof, it is enough to observe that \(S=T\setminus \{\mathrm {h}(S)\}\).

(2. \(\Rightarrow \) 1.) This implication is an immediate consequence of Lemma 3.3. \(\square \)

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 \(\mathrm {l}(Q)=2\), then there exist a symmetric numerical semigroup P and a number \(x\in \mathrm {msg}(P)\) such that \(x<\mathrm {F}(P)\) and \(Q=P\setminus \{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\in \mathrm {msg}(T)\) such that \(S=T\setminus \{x\}\), then we can assert that every 2-semigroup is an URSY-semigroup. However, the converse is not true. For example, \(\langle 2,5 \rangle \setminus \{5\}=\langle 2,7 \rangle \) is an URSY-semigroup and \(\mathrm {l}(\langle 2,7 \rangle )=0\).

The next result can be easily deduced from Theorem 2.2 of [14]. Recall that, if S is a numerical semigroup, then \(\mathrm {m}(S)=\min (S\setminus \{0\})\) is known as the multiplicity of S.

Proposition 3.6

Let S be a numerical semigroup. Then \(\mathrm {l}(S)=2\) if and only if S is an URSY-semigroup and \(\mathrm {m}(S)\ge 3\).

The following result is obtained from Lemmas 2.3 and 2.7 of [14] and the proof of Proposition 3.5.

Proposition 3.7

If S is a 2-semigroup, then

$$\begin{aligned} \left\{ \mathrm {F}(S),\mathrm {h}(S) \right\} \subseteq \mathrm {PF}(S) \subseteq \{\mathrm {F}(S),\mathrm {h}(S),\mathrm {F}(S)-\mathrm {h}(S) \}. \end{aligned}$$

Moreover, \(\mathrm {F}(S)-\mathrm {h}(S)\in \mathrm {PF}(S)\) if and only if \(\,2\mathrm {h}(S)-\mathrm {F}(S)\notin S\).

An immediate consequence of the above proposition is the next result.

Corollary 3.8

If S is a 2-semigroup, then \(\mathrm {t}(S)\in \{2,3\}\). Moreover, \(\mathrm {t}(S)=2\) if and only if \(\,2\mathrm {h}(S)-\mathrm {F}(S)\in S\).

Remark 3.9

From Remark 2.7 and Proposition 3.7, we have that a 2-semigroup is almost symmetric if and only if \(\,2\mathrm {h}(S)-\mathrm {F}(S)\notin S\).

Let us illustrate the previous results with an example.

Example 3.10

From Lemma 2.1, we easily deduce that \(S=\langle 7,8,9,10,11,12 \rangle \) is a symmetric numerical semigroup with Frobenius number 13. Therefore, by applying Proposition 3.5, we have that \(\mathrm {l}(S\setminus \{10\})=2\) and that \(\mathrm {h}(S\setminus \{10\})=10\). Then, since \(2\mathrm {h}(S\setminus \{10\})-\mathrm {F}(S\setminus \{10\})=7 \in S\setminus \{10\}\), from Proposition 3.7 (or Corollary 3.8) we conclude that \(\mathrm {PF}(S\setminus \{10\})=\{10,13\}\).

Now our purpose is to study the numerical semigroups S such that \(\mathrm {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\in \mathrm {msg}(P)\) such that \(\mathrm {F}(P)=\mathrm {F}(Q)\), \(x<\mathrm {F}(P)\), and \(Q=P\setminus \{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\in \mathrm {msg}(T)\) such that \(S=T\setminus \{x\}\).

Let us observe that, if S is a 3-semigroup, then S is an URPSY-semigroup. However, \(\langle 3,4,5 \rangle \setminus \{4\}=\langle 3,5,7 \rangle \) is an URPSY-semigroup and \(\mathrm {l}(\langle 3,5,7 \rangle )=1\). Consequently, there exist URPSY-semigroups that are not 3-semigroups.

The following result can be deduced from Proposition 23 of [13].

Proposition 3.11

Let S be a numerical semigroup. Then \(\mathrm {l}(S)=3\) if and only if S is an URPSY-semigroup and does not belong to the set

$$\begin{aligned} U&=\big \{\langle 3,5,7 \rangle ,\langle 4,5,6,7 \rangle ,\langle 4,5,11 \rangle \big \} \cup \big \{ \langle 3,x+3 \rangle \mid x\in {\mathbb {N}} \setminus \{0\}, \ 3\not \mid x \big \} \, \cup \\&\quad \big \{ \langle m,m+1,\ldots ,2m-3 \rangle \mid m \in {\mathbb {N}}, \ m\ge 5 \big \}. \end{aligned}$$

The next result is deduced from Lemmas 25, 26, and 27 of [13].

Proposition 3.12

If S is a 3-semigroup, then

  1. 1.

    \(\left\{ \mathrm {F}(S),\mathrm {h}(S) \right\} \subseteq \mathrm {PF}(S) \subseteq \left\{ \mathrm {F}(S),\mathrm {h}(S),\frac{\mathrm {F}(S)}{2},\mathrm {F}(S)-\mathrm {h}(S) \right\} ;\)

  2. 2.

    \(\frac{\mathrm {F}(S)}{2} \in \mathrm {PF}(S)\) if and only if \(\,\mathrm {h}(S)-\frac{\mathrm {F}(S)}{2} \notin S\);

  3. 3.

    \(\mathrm {F}(S)-\mathrm {h}(S)\in \mathrm {PF}(S)\) if and only if \(\,2\mathrm {h}(S)-\mathrm {F}(S)\notin S\).

As a direct consequence of the above proposition, we have the following result.

Corollary 3.13

If S is a 3-semigroup, then \(\mathrm {t}(S) \in \{2,3,4\}\). Moreover,

  1. a)

    the following conditions are equivalent.

    1. a.1)

      \(\mathrm {t}(S)=2\).

    2. a.2)

      \(\mathrm {h}(S)-\frac{\mathrm {F}(S)}{2} \in S\).

    3. a.3)

      \(\mathrm {PF}(S)=\left\{ \mathrm {F}(S),\mathrm {h}(S) \right\} \).

  2. b)

    the following conditions are equivalent.

    1. b.1)

      \(\mathrm {t}(S)=3\).

    2. b.2)

      \(\mathrm {h}(S)-\frac{\mathrm {F}(S)}{2} \notin S\) and \(\,2\mathrm {h}(S)-\mathrm {F}(S)\in S\).

    3. b.3)

      \(\mathrm {PF}(S)=\left\{ \mathrm {F}(S),\mathrm {h}(S),\frac{\mathrm {F}(S)}{2} \right\} \).

  3. c)

    the following conditions are equivalent.

    1. c.1)

      \(\mathrm {t}(S)=4\).

    2. c.2)

      \(2\mathrm {h}(S)-\mathrm {F}(S)\notin S\).

    3. c.3)

      \(\mathrm {PF}(S)=\left\{ \mathrm {F}(S),\mathrm {h}(S),\frac{\mathrm {F}(S)}{2},\mathrm {F}(S)-\mathrm {h}(S) \right\} \).

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.

Example 3.15

From Lemma 2.1, \(S=\langle 8,9,10,11,12,13,15 \rangle \) is a pseudo-symmetric numerical semigroup with Frobenius number 14. Therefore, by applying Proposition 3.5, we have that \(\mathrm {l}(S\setminus \{10\})=3\) and that \(\mathrm {h}(S\setminus \{10\})=10\). Since \(2\mathrm {h}(S\setminus \{10\})-\mathrm {F}(S\setminus \{10\})=6 \notin S\setminus \{10\}\), from item c of Corollary 3.13 we conclude that \(\mathrm {PF}(S\setminus \{10\})=\{14,10,7,4\}\).

4 \(\varvec{2n}\)-Semigroups and \(\varvec{(2n+1)}\)-Semigroups

Let \(n\in {\mathbb {N}}\). We begin this section showing how we can obtain 2n-semigroups and \((2n+1)\)-semigroups from symmetric and pseudo-symmetric numerical semigroups, respectively. (Let us recall that, if A is a set, then \(\#(A)\) is the cardinality of A.)

Proposition 4.1

Let S be a symmetric numerical semigroup. Let us take a set \(A \subseteq \left\{ x\in S \,\big \vert \, \frac{\mathrm {F}(S)}{2}<x<\mathrm {F}(S) \right\} \) such that \(\#(A)=n\) and \(S\setminus A\) is a numerical semigroup. Then \(\mathrm {l}(S\setminus A)=2n\). Moreover, each 2n-semigroup can be obtained in this way.

Proof

It is clear that, if \(x\in A\), then \(x\notin S\setminus A\) and \(\mathrm {F}(S\setminus A)-x\notin S\setminus A\) (note that \(\mathrm {F}(S\setminus A)=\mathrm {F}(S)\)). Therefore, \(\mathrm {l}(S\setminus A)\ge 2n\). On the other hand, having in mind that S is symmetric, we deduce that, if \(\left\{ h,\mathrm {F}(S\setminus A)-h\right\} \cap (S\setminus A)=\emptyset \), then \(\max \left\{ h,\mathrm {F}(S\setminus A)-h \right\} \) \(\in A\). Thus, \(\mathrm {l}(S\setminus A)\le 2\#(A)=2n\). Consequently, \(\mathrm {l}(S\setminus A)=2n\).

Now, let T be a numerical semigroup with \(\mathrm {l}(T)=2n\). We define the following sequence of numerical semigroups (recalling item 2 of Lemma 3.1).

  • \(T_0=T\);

  • \(T_{k+1}=T_k\cup \{\mathrm {h}(T_k)\}\), if \(0\le k \le n-1\).

Then, by applying Lemma 3.4, we have that \(T=T_0\subsetneq T_1 \subsetneq \cdots \subsetneq T_n\) and \(\mathrm {l}(T_n)=0\). Moreover, from Proposition 2.3, \(T_n\) is a symmetric numerical semigroup. Finally, \(A=T_n \setminus T \subset \left\{ x\in T_n \,\big \vert \, \frac{\mathrm {F}(T_n)}{2}<x<\mathrm {F}(T_n) \right\} \) and \(\#(A)=n\). \(\square \)

Let us illustrate the previous result with an example.

Example 4.2

Let S be the symmetric numerical semigroup given by

$$\begin{aligned} S=\langle 5,7,9,11 \rangle = \{0,5,7,9,10,11,12,14,\rightarrow \}. \end{aligned}$$

It is clear that \(\mathrm {F}(S)=13\), \(\{7,12\} \subseteq \left\{ x\in S \,\big \vert \, \frac{\mathrm {F}(S)}{2}<x<\mathrm {F}(S) \right\} \), and \(S\setminus \{7,12\}\) is a numerical semigroup. Therefore we can apply Proposition 4.1, getting that \(\mathrm {l}(S\setminus \{7,12\})=2\times 2=4\).

The proof of the following proposition is similar to the proof of Proposition 4.1. So, we omit it.

Proposition 4.3

Let S be a pseudo-symmetric numerical semigroup. Let us take a set \(A \subseteq \left\{ x\in S \,\big \vert \, \frac{\mathrm {F}(S)}{2}<x<\mathrm {F}(S) \right\} \) such that \(\#(A)=n\) and \(S\setminus A\) is a numerical semigroup. Then \(\mathrm {l}(S\setminus A)=2n+1\). Moreover, each \((2n+1)\)-semigroup can be obtained in this way.

Let us see an illustrative example of the above proposition.

Example 4.4

Let S be the pseudo-symmetric numerical semigroup given by

$$\begin{aligned} S=\langle 5,8,11,12 \rangle = \{0,5,8,10,11,12,13,15,\rightarrow \}. \end{aligned}$$

Clearly \(\mathrm {F}(S)=14\), \(\{11,12\} \subseteq \left\{ x\in S \,\big \vert \, \frac{\mathrm {F}(S)}{2}<x<\mathrm {F}(S) \right\} \), and \(S\setminus \{11,12\}\) is a numerical semigroup. Therefore, by applying Proposition 4.3, we have that \(\mathrm {l}(S\setminus \{11,12\})=2\times 2+1=5\).

Let I be an irreducible numerical semigroup. Now we are interested in showing an algorithm which allows us to compute all the numerical semigroups of the form \(I\setminus A\) with \(A \subseteq \left\{ x\in I \,\big \vert \, \frac{\mathrm {F}(I)}{2}<x<\mathrm {F}(I) \right\} \).

If S is a numerical semigroup, then we denote by \(\Delta (S)=\left\{ s\in S \,\big \vert \, s<\frac{\mathrm {F}(S)}{2} \right\} \). The following result has an immediate proof.

Proposition 4.5

Let IS be numerical semigroups such that I is irreducible, \(S\subseteq I\), and \(\mathrm {F}(S){=}\mathrm {F}(I)\). Then \(S{=}I\setminus A\) for some \(A \subseteq \left\{ \!x\in I \,\big \vert \frac{\mathrm {F}(I)}{2}<x<\mathrm {F}(I)\! \right\} \) if and only if \(\Delta (S)=\Delta (I)\).

Let AB be two numerical semigroups such that \(A\subseteq B\). We denote by

$$\begin{aligned} {[}A,B]=\{X\mid X \text{ is } \text{ a } \text{ numerical } \text{ semigroup } \text{ and } A\subseteq X \subseteq B\}. \end{aligned}$$

On the other hand, if S is a numerical semigroup, then we denote by \(\theta (S)\) the numerical semigroup \(\langle \Delta (S) \rangle \cup \{\mathrm {F}(S)+1,\rightarrow \}\). The next result is an immediate consequence of Proposition 4.5.

Corollary 4.6

Let I be an irreducible numerical semigroup. Then \([\theta (I),I]=\left\{ I\setminus A \,\big \vert \, A\subseteq \big \{\!x\in I \,\big \vert \, \frac{\mathrm {F}(I)}{2}<x<\mathrm {F}(I)\! \big \} \text{ and } \, I\setminus A \, \text{ is } \text{ a } \text{ numerical } \text{ semigroup } \right\} \).

At this point, our purpose is to show an algorithm to compute \([\theta (I),I]\). For that we need the concept of (rooted) tree.

A graph G is a pair (VE) where V is a non-empty set (whose elements are called vertices of G) and E is a subset of \(\{(v,w) \in V \times V \mid v \ne 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),\ldots ,(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 (xy) is an edge of the tree, then we say that x is a child of y (see [18]).

If AB are numerical semigroups such that \(A \subsetneq B\), then we denote by \(\mathrm {F}_B(A)=\max (B\setminus A)\). Moreover, according to the Frobenius number \(\mathrm {F}({\mathbb {N}})=-1\), we define \(\mathrm {F}_B(B)=-1\). The following result is Lemma 4.35 of [17].

Lemma 4.7

Let AB be two numerical semigroups such that \(A \subsetneq B\). Then \(A\cup \{\mathrm {F}_B(A)\}\) is another numerical semigroup.

We define the graph \(\mathrm {G}\big ([A,B]\big )\) in the following way: [AB] is the set of vertices and \((X,Y)\in [A,B] \times [A,B]\) is an edge if \(X\cup \{\mathrm {F}_B(X)\}=Y\). The next result is easy to prove (see Corollary 4.5 of [12]).

Proposition 4.8

\(\mathrm {G}\big ([A,B]\big )\) is a tree with root B. Moreover, the children set of a vertex P is \(\big \{P \setminus \{x\} \in [A,B] \mid x \in \mathrm {msg}(P) \text{ and } x>\mathrm {F}_{B}(P) \big \}.\)

Let us note that, if I is an irreducible numerical semigroup and \(P\in [\theta (I),I]\) with \(P\not = I\), then \(\mathrm {F}_I(P)=\mathrm {h}(P)\). Moreover, in order to keep the equality true and according to the value \(\mathrm {F}_I(I)=-1\), we define \(\mathrm {h}(I)=-1\) for any irreducible numerical semigroup I. Thereby, we can formulate Proposition 4.8 as follows.

Corollary 4.9

Let I be an irreducible numerical semigroup. Then \(\mathrm {G}\big ([\theta (I),I]\big )\) is a tree with root I. Moreover, if P is a vertex of such a tree, then its children set is \(\left\{ P \setminus \{x\} \,\big \vert \, x \in \mathrm {msg}(P), \ \frac{\mathrm {F}(I)}{2}<x<\mathrm {F}(I) \text{ and } \, \mathrm {h}(P)<x \right\} .\)

We are now ready to describe an algorithm which allows us to compute \([\theta (I),I]\). If (xy) is an ordered pair, then we denote by \(\pi _1(x,y)=x\).

Algorithm 4.10

  • INPUT: An irreducible numerical semigroup I.

  • OUTPUT: \([\theta (I),I]\).

    1. (1)

      \(n=0\), \(A_0=\left\{ (I,-1)\right\} \), \(B_0=\left\{ I \right\} \).

    2. (2)

      \(n:=n+1\).

    3. (3)

      \(A_n=\left\{ P\setminus \{x\},x) \,\big \vert \, (P,y)\in A_{n-1}, \, x\in \mathrm {msg}(P), \,\! \frac{\mathrm {F}(I)}{2}<x<\mathrm {F}(I), \,\! y<x \right\} \).

    4. (4)

      If \(A_n=\emptyset \), then return \(B_0\cup B_1 \cup \cdots \cup B_{n-1}\).

    5. (5)

      \(B_n=\pi _1(A_n)\) and go to (2).

Let us illustrate the algorithm with an example.

Example 4.11

It is clear that \(I=\langle 5,7,9,11 \rangle \) is a symmetric numerical semigroup with \(\mathrm {F}(I)=13\). Therefore, \(\theta (I) = \langle 5 \rangle \cup \{14,\rightarrow \} = \langle 5,14,16,17,18 \rangle \). Let us compute \([\theta (I),I]\) with the help of Algorithm 4.10.

  • \(n=0\), \(A_0=\big \{(\langle 5,7,9,11 \rangle ,-1)\big \}\), \(B_0=\big \{\langle 5,7,9,11 \rangle \big \}\).

  • \(n=1\).

  • \(A_1=\big \{(\langle 5,9,11,12 \rangle ,7), (\langle 5,7,11 \rangle ,9), (\langle 5,7,9 \rangle ,11) \big \}\).

  • \(B_1=\big \{\langle 5,9,11,12 \rangle , \langle 5,7,11 \rangle , \langle 5,7,9 \rangle \big \}\).

  • \(n=2\).

  • \(A_2{=}\big \{{(}\langle 5,11,12,14,18 \rangle ,9{)}, {(}\langle 5,9,12,16 \rangle ,11{)}, {(}\langle 5,9,11,17 \rangle ,12{)}, {(}\langle 5,7,16,18 \rangle ,11{)} \big \}\).

  • \(B_2=\big \{\langle 5,11,12,14,18 \rangle , \langle 5,9,12,16 \rangle , \langle 5,9,11,17 \rangle , \langle 5,7,16,18 \rangle \big \}\).

  • \(n=3\).

  • \(A_3=\big \{(\langle 5,12,14,16,18 \rangle ,11), (\langle 5,11,14,17,18 \rangle ,12), (\langle 5,9,16,17 \rangle ,12) \big \}\).

  • \(B_3=\big \{\langle 5,12,14,16,18 \rangle , \langle 5,11,14,17,18 \rangle , \langle 5,9,16,17 \rangle \big \}\).

  • \(n=4\).

  • \(A_4=\big \{(\langle 5,14,16,17,18 \rangle ,12) \big \}\).

  • \(B_4=\big \{\langle 5,14,16,17,18 \rangle \big \}\).

  • \(n=5\).

  • \(A_5=\emptyset \).

Therefore, in this example, \([\theta (I),I]=B_0\cup B_1\cup B_2\cup B_3\cup B_4\). We depict in Fig. 1 the tree \(\mathrm {G}\big ([\theta (I),I]\big )\) corresponding to this example. By the way, the number which appears over each edge (QP) is the minimal generator x of P such that \(Q=P\setminus \{x\}\). Note that \(x=\mathrm {h}(Q)\).

Fig. 1
figure 1

Tree \(\mathrm {G}\big ([\theta (I),I]\big )\) with \(I=\langle 5,7,9,11 \rangle \)

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.

Proposition 4.12

Let I be an irreducible numerical semigroup.

  1. 1.

    The height of the tree \(\mathrm {G}\big ([\theta (I),I]\big )\) is equal to \(\#(I\setminus \theta (I))\).

  2. 2.

    If S belongs to the n-level of \(\mathrm {G}\big ([\theta (I),I]\big )\), then \(\mathrm {l}(S)=2n+\mathrm {l}(I)\).

  3. 3.

    \(\left\{ \mathrm {l}(S) \mid S\in [\theta (I),I] \right\} = \left\{ 2n+\mathrm {l}(I) \mid n\in \{0,1,\ldots ,\#(I\setminus \theta (I) \} \right\} \).

Let us illustrate the content of this proposition with an example.

Example 4.13

Following Example 4.11, we know that \(I=\langle 5,7,9,11 \rangle \) is a symmetric numerical semigroup. Therefore, I is an irreducible numerical semigroup with \(\mathrm {l}(I)=0\) (see Proposition 2.3). It is clear that \(\theta (I) = \langle 5 \rangle \cup \{14,\rightarrow \} = \langle 5,14,16,17,18 \rangle \) and \(I\setminus \theta (I)=\{7,9,11,12\}\). Thus, \(\mathrm {G}\big ([\theta (I),I]\big )\) is a tree with height equal to 4. Consequently, \(\left\{ \mathrm {l}(S) \mid S\in [\theta (I),I] \right\} =\{0,2,4,6,8\}\). Moreover, \(\big \{S\in [\theta (I),I] \mid \mathrm {l}(S)=6 \big \} = \big \{ S\in \mathrm {G}\big ([\theta (I),I]\big ) \mid S \text{ has } \text{ depth } \text{ equal } \text{ to } 3\big \} = B_3\).

Let us observe that, if \(n\in {\mathbb {N}}\), we can compute all the 2n-semigroups (\((2n+1)\)-semigroups, respectively) in two steps.

  1. 1.

    Compute the set \(\mathcal {F}(n)\) (\(\mathcal {G}(n)\), respectively) formed by all symmetric numerical semigroups (pseudo-symmetric numerical semigroups, respectively) I such that \(\#(I\setminus \theta (I))\ge n\).

  2. 2.

    For each \(I\in \mathcal {F}(n)\) (\(\mathcal {G}(n)\), respectively) compute the n-level of \(\mathrm {G}\big ([\theta (I),I]\big )\).

Note that there exist infinitely many irreducible numerical semigroups I such that \(\#(I\setminus \theta (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.

5 \({\varvec{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 \(\mathcal {I}(F)\) the set of all irreducible numerical semigroup with Frobenius number equal to F. Then \(\mathrm {G}(\mathcal {I}(F))\) is the graph where \(\mathcal {I}(F)\) is the set of vertices and \((T,S)\in \mathcal {I}(F) \times \mathcal {I}(F)\) is an edge if \(\mathrm {m}(T)<\frac{F}{2}\) and \(S=(T\setminus \{\mathrm {m}(T) \}) \cup \left\{ F-\mathrm {m}(T) \right\} \).

The next results are Proposition 2.7 and Theorem 2.9 of [4], respectively.

Proposition 5.1

Let F be a positive integer. Then there exists a unique irreducible numerical semigroup \(\mathrm {C}(F)\) with Frobenius number F and multiplicity greater than \(\frac{F}{2}\). Moreover,

$$\begin{aligned} \mathrm {C}(F) = \left\{ \begin{array}{ll} \left\{ 0,\frac{F+1}{2},\rightarrow \right\} \setminus \{F\}, &{} \text{ if }\, F\, \text{ is } \text{ odd, } \\ \left\{ 0,\frac{F}{2}+1,\rightarrow \right\} \setminus \{F\}, &{} \text{ if }\, F\, \text{ is } \text{ even. } \end{array} \right. \end{aligned}$$

Proposition 5.2

Let F be a positive integer. Then \(\mathrm {G}(\mathcal {I}(F))\) is a tree with root \(\mathrm {C}(F)\). Moreover, if \(S\in \mathcal {I}(F)\), then the children set of S is \(\Big \{(S\setminus \{x\}) \cup \{F-x\} \,\big \vert \) \( x\in \mathrm {msg}(S), \ \frac{F}{2}<x<F, \ 2x-F\notin S, \ 3x\not =2F, \ 4x\not =3F \text{ and } \, F-x<\mathrm {m}(S) \Big \}.\)

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 \(\mathrm {G}(\mathcal {I}(11))\) starting at its root \(\mathrm {C}(11)=\langle 6,7,8,9,10 \rangle \) and adding to the known vertices their children (that are given by Proposition 5.2). Thus we have the tree of Fig. 2 (for more details see Example 2.10 of [4]).

Fig. 2
figure 2

Tree of irreducible numerical semigroups with Frobenius number 11

The next result gives us the conditions that must be satisfied by two non-negative 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 \(\lfloor q \rfloor = \max \{z \in {\mathbb {Z}} \mid z\le q \}\).

Proposition 5.4

Let kF be non-negative integers. Then there exists at least one k-semigroup with Frobenius number F if and only if \(k+F\) is an odd number and \(F\ge k+1\).

Proof

(Necessity.) This is Corollary 2.4.

(Sufficiency.) It is enough to take \(S=\mathrm {C}(F) \setminus A\) where A is a \(\left\lfloor \frac{k}{2} \right\rfloor \)-cardinality subset of \(\{x\in \mathrm {C}(F) \mid 0\not =x<F \}\) and apply Propositions 4.1 or 4.3 depending on whether F is odd or even. \(\square \)

Let us see an example illustrating the previous proposition.

Example 5.5

Let us build an 8-semigroup with Frobenius number 17. Since \(8+17\) is odd and \(17\ge 8+1\), by applying Proposition 5.4, we know that there exists at least one. Moreover, from the proof of such a proposition, we have that \(S=\mathrm {C}(17) \setminus \{9,11,13,16\} = \{0,10,12,14,15,18,\rightarrow \}\) is an 8-semigroup with Frobenius number 17.

We are now interested in determining all the irreducible numerical semigroups I such that the set \([\theta (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\in {\mathbb {N}}\) such that \(\mathrm {F}(I)+k\) is an odd number and \(\mathrm {F}(I)\ge k+1\). Then \([\theta (I),I]\) contains at least one k-semigroup if and only if \(\#(I\setminus \theta (I)) \ge \left\lfloor \frac{k}{2} \right\rfloor \).

We are ready to show an algorithm which allows us to compute all the k-semigroups with a fixed Frobenius number.

Algorithm 5.7

  • INPUT: Two non-negative integers k and F.

  • OUTPUT: The set of all k-semigroups with Frobenius number F.

    1. (1)

      If \(F+k\) is even, then return \(\emptyset \).

    2. (2)

      If \(F<k+1\), then return \(\emptyset \).

    3. (3)

      Compute the set \(\mathcal {F} = \left\{ I\in \mathcal {I}(F) \,\big \vert \, \#(I\setminus \theta (I)) \ge \left\lfloor \frac{k}{2} \right\rfloor \right\} \).

    4. (4)

      For each \(I\in \mathcal {F}\), compute the set

      $$\begin{aligned} \mathrm {D}(I)=\left\{ S\in \mathrm {G}\big ([\theta (I),I]\big ) \,\big \vert \, S \text{ belongs } \text{ to } \text{ the } \left\lfloor \frac{k}{2} \right\rfloor \text{-level } \right\} . \end{aligned}$$
    5. (5)

      Return \(\bigcup _{I\in \mathcal {F}} \mathrm {D}(I)\).

Remark 5.8

It is clear that, if \(I_1,I_2\) are irreducible numerical semigroups (with the same Frobenius number), then \(\Delta (I_1)=\Delta (I_2)\) if and only if \(I_1=I_2\). Consequently, \([\theta (I_1),I_1] \cap [\theta (I_2),I_2] \not = \emptyset \) if and only if \(I_1=I_2\). Therefore, \(\bigcup _{I\in \mathcal {F}} \mathrm {D}(I)\) 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.

  1. 1.

    \(\#\big (\mathrm {C}(F)\setminus \theta (\mathrm {C}(F))\big ) = \left\lfloor \frac{F-1}{2} \right\rfloor \).

  2. 2.

    If Q is a child of P in the tree \(\mathrm {G}(\mathcal {I}(F))\), then \(\#(Q\setminus \theta (Q)) < \#(P\setminus \theta (P))\).

Proof

The first statement is trivial. For the second one, having in mind that \(Q=(P\setminus \{x\}) \cup \{F-x\}\) for some \(x\in \mathrm {msg}(P)\) such that \(\frac{F}{2}<x<F\), then we easily deduce that \(Q\setminus \theta (Q) \subsetneq P\setminus \theta (P)\) and, therefore, \(\#(Q\setminus \theta (Q)) < \#(P\setminus \theta (P))\). \(\square \)

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.

  1. (1)

    \(11+6\) is odd.

  2. (2)

    \(11\ge 6+1\).

  3. (3)

    By applying the algorithm of [4] which we commented at the beginning of this section and having in mind Proposition 5.9, we get that

    $$\begin{aligned} \mathcal {F} = \big \{I \in \mathcal {I}(11) \mid \#(I\setminus \theta (I)) \ge 3 \big \} = \big \{ \langle 6,7,8,9,10 \rangle , \langle 4,6,9 \rangle , \langle 5,7,8,9 \rangle \big \}. \end{aligned}$$

    Let us observe that it is not necessary to compute all the numerical semigroups of \(\mathcal {I}(11)\). In fact, from Example 5.3 and Proposition 5.9, we just need to take into account \(\mathrm {C}(11)=\langle 6,7,8,9,10 \rangle \), \(I_1=\langle 3,7 \rangle \), \(I_2=\langle 4,6,9 \rangle \), and \(I_3=\langle 5,7,8,9 \rangle \) because \(\#\big (\mathrm {C}(11)\setminus \theta (\mathrm {C}(11))\big )=5\), \(\#(I_1\setminus \theta (I_1))=2\), and \(\#(I_2\setminus \theta (I_2))=\#(I_3\setminus \theta (I_3))=3\).

  4. (4)

    By using Algorithm 4.10, we get that

    • \(\mathrm {D}(\mathrm {C}(11)) = \mathrm {D}(\langle 6,7,8,9,10 \rangle ) = \big \{ \langle 6,7,15,16,17 \rangle , \langle 6,8,13,15,17 \rangle , \)

         \(\langle 6,9,13,14,16,17 \rangle , \langle 6,10,13,14,15,17 \rangle , \langle 7,8,12,13,17,18 \rangle , \)

         \(\langle 7,9,12,13,15,17 \rangle , \langle 7,10,12,13,15,16,18 \rangle , \)

         \(\langle 8,9,12,13,14,15,19 \rangle , \langle 8,10,12,13,14,15,17,19 \rangle , \)

         \(\langle 9,10,12,13,14,15,16,17 \rangle \big \}\);

    • \(\mathrm {D}(I_2) = \mathrm {D}(\langle 4,6,9 \rangle ) = \big \{ \langle 4,13,14,15 \rangle \big \}\);

    • \(\mathrm {D}(I_3) = \mathrm {D}(\langle 5,7,8,9 \rangle ) = \big \{ \langle 5,12,13,14,16 \rangle \big \}\).

  5. (5)

    \(\mathrm {D}(\mathrm {C}(11)) \cup \mathrm {D}(I_2) \cup \mathrm {D}(I_3)\) is the set of all 6-semigroups with Frobenius number 11.

6 Wilf’s Conjecture and \({\varvec{k}}\)-Semigroups

From Lemma 2.2 we have that \(\mathrm {g}(S)=\frac{\mathrm {F}(S)+1+\mathrm {l}(S)}{2}\). Moreover, from the definitions, \(\mathrm {c}(S)=\mathrm {F}(S)+1\). Given these two facts we can rewrite Wilf’s conjecture in terms of the Frobenius number and the number of second kind gaps.

Lemma 6.1

Let S be a numerical semigroup. Then S fulfils Wilf’s conjecture if and only if \(\mathrm {l}(S) \le \frac{\mathrm {e}(S)-2}{\mathrm {e}(S)}(\mathrm {F}(S)+1)\).

Proof

Let us recall that S fulfils Wilf’s conjecture if \(\frac{\mathrm {g}(S)}{\mathrm {c}(S)}\le 1-\frac{1}{\mathrm {e}(S)}\). Since

$$\begin{aligned} \frac{\mathrm {g}(S)}{\mathrm {c}(S)}\le & {} 1-\frac{1}{\mathrm {e}(S)} \Leftrightarrow \mathrm {g}(S) \le \frac{\left( \mathrm {e}(S)-1\right) }{\mathrm {e}(S)} \, \mathrm {c}(S) \Leftrightarrow \\ \frac{\mathrm {F}(S)+1+\mathrm {l}(S)}{2}\le & {} \frac{\left( \mathrm {e}(S)-1\right) }{\mathrm {e}(S)} \left( \mathrm {F}(S)+1 \right) \Leftrightarrow \\ \mathrm {l}(S)\le & {} \left( 2\,\frac{\left( \mathrm {e}(S)-1\right) }{\mathrm {e}(S)} - 1 \right) \left( \mathrm {F}(S)+1 \right) , \end{aligned}$$

we have the conclusion. \(\square \)

As an application of the previous lemma, let us see some remarks on k-semigroups, with \(k\in \{0,1,2,3\}\), and Wilf’s conjecture. In the first two we recover well known results.

Remark 6.2

If \(S=\mathbb {N}\), then \(\mathrm {l}(S)=0\), \(\mathrm {e}(S)=1\), \(\mathrm {F}(S)=-1\), and it is clear that \(0 = \frac{1-2}{1}(-1+1)\). On the other hand, it is trivial that \(0 \le \frac{e-2}{e}(F+1)\) for all \(e\ge 2\) and \(F\ge 1\). Therefore, we have that all 0-semigroups fulfil Wilf’s conjecture.

Remark 6.3

Let \(S_1\) be a numerical semigroup such that \(\mathrm {e}(S_1)=2\). Then \(S_1\) is symmetric and, consequently, \(S_1\) is a 0-semigroup. Thus, if \(S_2\) is a 1-semigroup, we have that \(\mathrm {e}(S_2)\ge 3\). Moreover, by Corollary 2.4, \(\mathrm {F}(S_2)\) is an even number greater than or equal to 2. Now, because \(1\le \frac{e-2}{e}(2+1)\) for all \(e\ge 3\), we deduce that all 1-semigroups fulfil Wilf’s conjecture.

Remark 6.4

From Remark 6.3 we know that, if S is a 2-semigroup, then \(\mathrm {e}(S)\ge 3\). Moreover, by Corollary 2.4, \(\mathrm {F}(S)\) is an odd number greater than or equal to 3. Since \(S=\langle 4,5,6,7 \rangle \) is the unique 2-semigroup with \(\mathrm {F}(S)=3\) and \(2\le \frac{e-2}{e}(5+1)\) for all \(e\ge 3\), we get that all 2-semigroups fulfil Wilf’s conjecture.

Remark 6.5

From Remark 6.3 we know that, if S is a 3-semigroup, then \(\mathrm {e}(S)\ge 3\). Moreover, by Corollary 2.4, \(\mathrm {F}(S)\) is an even number greater than or equal to 4. Now, it is clear that

  • \(S=\langle 5,6,7,8,9 \rangle \) is the unique 3-semigroup with \(\mathrm {F}(S)=4\);

  • \(S=\langle 4,7,9,10 \rangle \) and \(S=\langle 5,7,8,9,11 \rangle \) are the unique 3-semigroups with \(\mathrm {F}(S)=6\);

  • \(3\le \frac{e-2}{e}(8+1)\) for all \(e\ge 3\).

Thus, we conclude that all 3-semigroups fulfil Wilf’s conjecture.

We finish this section with a remark on k-semigroups, with \(k\ge 4\), and Wilf’s conjecture.

Remark 6.6

From Remark 6.3 we have that, if S is a k-semigroup with \(k\ge 4\), then \(\mathrm {e}(S)\ge 3\). Moreover, it is well known that all numerical semigroups with embedding dimension less than or equal to three satisfy Wilf’s conjecture (see [8, Remark after Theorem 20] or [7, Corollary 2.6]). Thus, we can focus our attention on the case \(\mathrm {e}(S)\ge 4\). Now then, since \(k\le \frac{e-2}{e}((2k-1)+1)\) for all \(e\ge 4\), we conclude that, if \(k,F\in \mathbb {N}\), \(k\ge 4\), and \(F\ge 2k-1\), then all k-semigroups with Frobenius number F verify Wilf’s conjecture. On the other hand, it is clear that \(S=\langle k+2, k+3, \ldots , 2k+3 \rangle \) is the unique k-semigroup with Frobenius number equal to \(k+1\) and, moreover, S fulfils Wilf’s conjecture (in fact, S achieves the equality). Finally, by Corollary 2.4, the Frobenius number F of any k-semigroup satisfies the inequality \(F\ge k+1\) and, in addition, \(F+k\) has to be an odd number. Thereby, the following question arises in order to solve the Wilf’s conjecture: if S is a k-semigroup with \(\mathrm {e}(S)\ge 4\), \(\mathrm {k}\ge 4\), and Frobenius number in the interval \([k+3,2k-1)\), does S fulfil Wilf’s conjecture? (in fact, because \([k+3,2k-1) = \emptyset \) for \(k=4\), we can take \(k\ge 5\)).