1 Introduction

Let \(\mathbb {Z}\) be the set of integers and \(\mathbb {N}=\{z\in \mathbb {Z}\mid z\ge 0\}\). A submonoid of \((\mathbb {N},+)\) is a subset of \(\mathbb {N}\) which is closed under addition and contains the element 0. A numerical semigroup is a submonoid S of \((\mathbb {N},+)\) such that \(\mathbb {N}\backslash S=\{x\in \mathbb {N}\mid x \notin S\}\) has finitely many elements.

If A is a subset nonempty of \(\mathbb {N}\), we denote by \(\langle A \rangle \) the submonoid of \((\mathbb {N},+)\) generated by A, that is, \(\langle A \rangle =\{\lambda _1a_1+\dots +\lambda _na_n \mid n\in \mathbb {N}\backslash \{0\}, \, \{a_1,\dots , a_n\}\subseteq A \text{ and } \{\lambda _1,\dots ,\lambda _n\}\subseteq \mathbb {N}\}.\) In [11, Lema 2.1]) it is shown that \( \langle A \rangle \) is a numerical semigroup if and only if \({\textrm{gcd}}(A)=1.\) If M is a submonoid of \((\mathbb {N},+)\) and \(M=\langle A \rangle \), then we say that A is a system of generators of M. Moreover, if \(M\ne \langle B \rangle \) for all \(B \varsubsetneq A\), then we will say that A is a minimal system of generators of M. In [11, Corollary 2.8] is shown that every submonoid of \((\mathbb {N},+)\) has a unique minimal system of generators, which in addition is finite. We denote by \({\textrm{ msg }}(M)\) the minimal system of generators of M. The cardinality of \({\textrm{ msg }}(M)\) is called the embedding dimension of M and will be denoted by \({\mathrm e}(M).\)

It is clear that \({\mathrm e}(\mathbb {N})=1\) and \({\mathrm e}(S)\ge 2\) for every numerical such that \(S\ne \mathbb {N}.\) The multiplicity of a numerical semigroup S is \({\mathrm m}(S)=\min (S\backslash \{0\}).\) Note that \(\min (S\backslash \{0\})=\min ({\textrm{ msg }}(S)).\)

If S is a numerical semigroup such that \(S\ne \mathbb {N},\) then the ratio of S, denoted by \(\textrm{r}(S)\), is \(\min \left( {\textrm{ msg }}(S)\backslash \{{\mathrm m}(S)\}\right) .\) Observe that \(\textrm{r}(S)=\min \left( S \backslash \langle {\mathrm m}(S)\rangle \right) .\)

If m and r are positive integers, then we will denote by \(\mathscr {L}(m,r)=\{S\mid S \text{ is } \text{ a } \text{ numerical } \text{ semigroup }, {\mathrm m}(S)=m \text{ and } \textrm{r}(S)=r\}.\)

For integers a and b,  we say that a divides b if there exists an integer c such that \(b=ca,\) and we denote this by \(a\mid b.\) Otherwise, a does not divide b, and we denote this by \(a\not \mid b.\) Given two integers m and n with \(n\ne 0,\) we denote by m \({\textrm{ mod }}\) n the remainder of the division of m by n.

It is clear that \(\mathscr {L}(m,r)\ne \emptyset \) if and only if \(m<r\) and \(m \not \mid r.\) Our aim in this work is to study the set \( \mathscr {L}(m,r).\)

If S is a numerical semigroup, then \({\mathrm F}(S)={\textrm{max}}(\mathbb {N}\backslash S)\) and \({\mathrm g}(S)=\sharp (\mathbb {N}\backslash S)\) (where \(\sharp X\) denotes the cardinality of a set X), are two important invariants of S called Frobenius number and genus of S, respectively.

The Frobenius problem (see [6]) focuses on finding formulas to calculate the Frobenius number and the genus of a numerical semigroup from its minimal generator system. The problem was solved in [12] for numerical semigroups with embedding dimension two. Nowadays, the problem is still open in the case of numerical semigroups with embedding dimension greater than or equal to three. Furthemore, in this case the problem of computing the Frobenius number of a general numerical semigroup becomes NP-hard.

Following the notation introduced in [7], a Frobenius pseudo-variety is a nonempty family \(\mathscr {P}\) of numerical semigroups that the following conditions hold:

  1. 1)

    \(\mathscr {P}\) has a maximum element, \({\textrm{max}}(\mathscr {P})\) (with respect to the inclusion order).

  2. 2)

    If \(S, T \in \mathscr {P}\), then \(S \cap T \in \mathscr {P}\).

  3. 3)

    If \(S \in \mathscr {P}\) and \(S \ne {\textrm{max}}(\mathscr {P})\), then \(S \cup \{{\mathrm F}(S)\} \in \mathscr {P}\).

We will begin Sect. 2, showing that \({\mathscr {L}}(m,r)\) is a Frobenius pseudo-variety. We will show that \(\mathscr {L}(m,r)\) is a finite set if and only if \({\textrm{gcd}}\{m,r\}=1.\) We will order the elements of \( \mathscr {L}(m,r)\) making a tree and this fact will allow us give an algorithm to compute all the elements of \( \mathscr {L}(m,r)\) with a given genus.

A numerical semigroup is ratio-elementary if \({\mathrm F}(S)<2\textrm{r}(S).\) In Sect. 3, we will study this kind of semigroups. In particular, we will present an algorithm to determine all the ratio-elementary numerical semigroups of \( \mathscr {L}(m,r)\) with a given Frobenius number.

If F is a positive integer, then we will denote by \(\mathscr {L}(m,r)[F]=\{S\in \mathscr {L}(m,r)\mid {\mathrm F}(S)=F\}.\) In Sect. 4, we will study the set \(\mathscr {L}(m,r)[F]\) when \(F>2r.\)

Following the notation introduced in [9], a numerical semigroup is irreducible if it can not be expressed as an intersection of two numerical semigroups containing it properly. We denote by \(\mathscr {J}(\mathscr {L}(m,r))=\{S\in \mathscr {L}(m,r)\mid S \text{ is } \text{ irreducible }\}.\)

In Sect. 4, we define an equivalence binary relation \(\sim \) on \(\mathscr {L}(m,r)[F]\) obtaining the quotient set \(\displaystyle \frac{\mathscr {L}(m,r)[F]}{\sim }=\{[S]\mid S \in \mathscr {J}(\mathscr {L}(m,r)[F]) \}.\) As an immediate consequence, we have that to obtain an algorithm which allows to compute all elements of \(\mathscr {L}(m,r)[F]\) it is enough to have the following two algorithms:

  1. 1)

    An algorithm that computes the set \(\mathscr {J}(\mathscr {L}(m,r)[F]).\)

  2. 2)

    An algorithm that computes [S] if \(S\in \mathscr {J}(\mathscr {L}(m,r)[F]). \)

With the help of [4], we will quickly solve 1). The rest of the Sect. 4, is devoted to give an algorithm to obtain 2).

Let \((A,\le )\) be an ordered set and \(B\subseteq A\). The set B is a set of incomparable elements, if \(\{b,b'\}\subseteq B\) and \(b\le b',\) then \(b=b'.\)

Let \({\mathrm H}(\langle m,r\rangle )=\mathbb {N}\backslash \langle m,r\rangle .\) We define over \({\mathrm H}(\langle m,r\rangle )\) the following order relation: \(h \lesssim h'\) if and only if \(h'-h \in \langle m,r \rangle .\) In Sect. 5, we will see that giving an element of \(\mathscr {L}(m,r)\) is equivalent to give a subset of incomparable elements of \(\left( {\mathrm H}(\langle m,r\rangle ), \lesssim \right) \) which verify certain properties.

When \({\textrm{gcd}}\{m,r\}=1\), the results of [10] allow us to state that an element of \(\mathscr {L}(m,r)\) is determined by a subset of \(\{1,\cdots , r-1\}\times \{1,\cdots , m-1\}.\) The results of [10] also allow us to give formulas for the Frobenius number and the genus of an element of \(\mathscr {L}(m,r)\) from of its subset of \(\{1,\cdots , r-1\}\times \{1,\cdots , m-1\}\) associated.

2 The tree associated to \(\mathscr {L}(m,r)\)

In all this work m and r will denote integers such that \(2\le m<r\) and \(m \not \mid r.\) Note that \(\mathscr {L}(2,r)=\{ \langle 2 \rangle \cup \{r, \rightarrow \}\}\), where the symbol \(\rightarrow \) means that every integer greater than r belongs to the set. Therefore, in the following we will assume that \(m\ge 3.\)

The next lemma is straightforward to prove.

Lemma 1

Under the standing notation, \({\textrm{max}}\left( \mathscr {L}(m,r)\right) =\varDelta (m,r)=\langle m \rangle \cup \{r,\rightarrow \}.\)

It is easy to prove the following result.

Proposition 1

\( \mathscr {L}(m,r)\) is a Frobenius pseudo-variety.

If S is a numerical semigroup, then \(\mathbb {N}\backslash S\) is finite. Hence, we have the following result.

Lemma 2

If S is a numerical semigroup, then the set \(\{T\mid T \text{ is } \text{ a } \text{ numerical } \text{ semigroup } \text{ and } S\subseteq T\}\) is finite.

Proposition 2

With the above notation, we have that \(\mathscr {L}(m,r)\) is a finite set if and only if \({\textrm{gcd}}\{m,r\}=1.\)

Proof

Necessity. If \({\textrm{gcd}}\{m,r\}=d\ne 1\), then for all \(t\in \displaystyle \left\{ \displaystyle \frac{r}{d},\rightarrow \right\} \) we have \(S(t)=\langle m,r\rangle \cup \{td, \rightarrow \}\in \mathscr {L}(m,r)\) and \({\mathrm F}(S(t))=td-1.\) So, \(\mathscr {L}(m,r)\) is an infinite set.

Sufficiency. It is clear that \(\mathscr {L}(m,r)\subseteq \{S\mid S \text{ is } \text{ a } \text{ numerical } \text{ semigroup } \text{ and } \langle m,r \rangle \subseteq S\}.\) As \({\textrm{gcd}}\{m,r\}=1,\) then \(\langle m,r \rangle \) is a numerical semigroup. By applying Lemma 2, we deduce that \(\mathscr {L}(m,r)\) is a finite set.

A graph G is a pair (VE) where V is a nonempty set and E is a subset of \(\{(u,v)\in V\times V \mid u\ne v\}\). The elements of V and E are called vertices and edges respectively. A path (of length n) connecting the vertices u and v of G is a sequence of different edges of the form \((v_0,v_1), (v_1,v_2),\ldots ,(v_{n-1},v_n)\) such that \(v_0=u\) and \(v_n=v\).

A graph G is a tree if there exists a vertex r (known as the root of G) such that for any other vertex v of G there exists a unique path connecting v and r. If (uv) is an edge of the tree G, we say that u is a child of v.

We define the graph G(mr) as follows: \(\mathscr {L}(m,r)\) is its set of vertices and \((S,T)\in \mathscr {L}(m,r)\times \mathscr {L}(m,r)\) is an edge if \(S\cup \{{\mathrm F}(S)\}=T.\)

By applying Lemma 1 and Lemma 11 from [7], we have the following result.

Proposition 3

G(mr) is a tree with root \(\varDelta (m,r).\)

A tree can be built recurrently starting from the root and connecting, through an edge, the vertices already built with their children. Hence, it is very interesting to know how the children of the arbitrary vertices in G(mr) are.

The following result appears in [8, Lemma 1.7].

Lemma 3

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

The following result is easily deduced from [7, Theorem 3].

Proposition 4

Let \(S\in \mathscr {L}(m,r).\) Then the set formed by the children of S in the tree G(mr) is \(\{S\backslash \{x\}\mid x\in {\textrm{ msg }}(S), \, x>{\mathrm F}(S) \text{ and } x\notin \{m,r\}\}.\)

Example 1

Starting in \(\varDelta (4,7)=\langle 4,7,9,10 \rangle \) and by applying Proposition 4, we can build the tree G(4, 7).

figure a

Note that \( \begin{array}{*{20}l} P \hfill \\ { \uparrow x} \hfill \\ Q \hfill \\ \end{array} \) indicates that \(Q=P\backslash \{x\}\) and in addition \({\mathrm F}(Q)=x.\)

Observe also that \(\mathscr {L}(4,7)\) is finite.

Example 2

Starting in \(\varDelta (4,6)=\langle 4,6,7,9 \rangle \) and by applying Proposition 4, we can build recurrently the tree G(4, 6), although in this case we know, by Proposition 2, that \(\mathscr {L}(4,6)\) is infinite.

figure b

The following algorithm is deduced from [7, Algorithm 1] and it allows to compute all the elements of \(\mathscr {L}(m,r)\) with a given genus.

figure c

In the following example we illustrate the usage of Algorithm 1

Example 3

We are going to compute all the elements of \(\mathscr {L}(4,6)\) with genus 7.

  • \(A=\{\langle 4,6,7,9\rangle \}\), \(i=4.\)

  • \(B_{\langle 4,6,7,9\rangle }=\left\{ \langle 4,6,9,11\rangle , \langle 4,6,7\rangle \right\} .\)

  • \(A=\{\langle 4,6,9,11\rangle , \langle 4,6,7\rangle \}\), \(i=5.\)

  • \(B_{\langle 4,6,9,11\rangle }=\left\{ \langle 4,6,11,13\rangle , \langle 4,6,9\rangle \right\} ,\) \(B_{\langle 4,6,7\rangle }=\emptyset .\)

  • \(A=\{\langle 4,6,11,13\rangle , \langle 4,6,9\rangle \}\), \(i=6.\)

  • \(B_{\langle 4,6,11,13\rangle }=\left\{ \langle 4,6,13,15\rangle , \langle 4,6,11\rangle \right\} ,\) \(B_{\langle 4,6,9\rangle }=\emptyset .\)

  • \(A=\{\langle 4,6,13,15\rangle , \langle 4,6,11\rangle \}\), \(i=7.\)

  • \(\{S \in \mathscr {L}(4,6)\mid {\mathrm g}(S)=7\}=\{\langle 4,6,13,15\rangle , \langle 4,6,11\rangle \}.\)

3 Ratio-elementary numerical semigroups

A numerical semigroup S is called ratio-elementary if \({\mathrm F}(S)<2\textrm{r}(S).\) Our first aim in this section is to prove Theorem 1, which together with Proposition 5, describes how the ratio-elementary elements of \(\mathscr {L}(m,r)\) are. To this end, we need to introduce some concepts and results.

Lemma 4

Let \(x\in \{r+1,\cdots , 2r-1\}.\) Then \(x\notin \langle m,r \rangle \) if and only if \(x\, {\textrm{ mod }}\, m \notin \{0, r\,{\textrm{ mod }}\, m\}.\)

Proof

Neccesity. If \(x\, {\textrm{ mod }}\, m=0\), then \(x\in \langle m \rangle \subseteq \langle m,r \rangle .\) If \(x\, {\textrm{ mod }}\, m=r\,{\textrm{ mod }}\, m\), then \(x=r+km\) for some \(k\in \mathbb {N}.\) Therefore \(x\in \langle m,r \rangle .\)

Suficiency. If \(x\, {\textrm{ mod }}\, m \notin \{0, r\,{\textrm{ mod }}\, m\},\) then \(x\notin \langle m\rangle \) and \(x\ne r+km\) for all \(k\in \mathbb {N}.\) As \(x\in \{r+1,\cdots , 2r-1\},\) then we deduce that \(x\notin \langle m,r \rangle .\)

Let \(A \subseteq \{r+1,\cdots , 2r-1\}\backslash \langle m,r\rangle \). We will say that A is a (mr)-set if \(a\in A\) and \(a+m<2r,\) then \(a+m\in A.\)

Proposition 5

Let S be a numerical semigroup. The following conditions are equivalent:

1):

\(S\in \mathscr {L}(m,r)\) and S is ratio-elementary.

2):

\(S=\langle m,r \rangle \cup A \cup \{2r,\rightarrow \}\) where A is a (mr)-set.

Proof

\(1) \Longrightarrow 2)\) Let \(A=\{s\in S\mid r<s<2r \text{ and } s\notin \langle m,r \rangle \}.\) Then, \(A \subseteq \{r+1, \cdots , 2r-1\}\backslash \langle m,r \rangle .\) If \(a\in A,\) then by Lemma 4, we know tha \(a \, {\textrm{ mod }}\, m \notin \{0, r \, {\textrm{ mod }}\, m\}.\) Therefore, \((a+m) \, {\textrm{ mod }}\, m \notin \{0, r \, {\textrm{ mod }}\, m\}.\) Hence, if \(a\in A\) and \(a+m<2r,\) then by applying Lemma 4, we deduce that \(a+m \in A.\)

\(2) \Longrightarrow 1)\) It is easy to see that \(S\in \mathscr {L}(m,r)\) and \({\mathrm F}(S)<2r.\) Therefore, S is an element of \(\mathscr {L}(m,r)\) which is ratio-elementary.

Theorem 1

Let \(\{i_1,\dots i_k\}\) be a subset of \(\{1,\dots ,m-1\}\backslash \{r\, {\textrm{ mod }}\, m\}\) with cardinality k. For all \(j \in \{1,\dots , k\}\) let \(a_j\in \{r+1,\dots ,2r-1\}\) such that \(a_j\, {\textrm{ mod }}\, m=i_j.\) Then \(A=\left( \{a_1,\dots , a_k\}+\langle m \rangle \right) \cap \{r+1,\dots , 2r-1\}\) is a (mr)-set. Moreover, every (mr)-set is of this form.

Proof

By applying Lemma 4, we deduce that \(A\subseteq \{r+1,\dots , 2r-1\}\backslash \langle m, r \rangle .\) Besides, it is clear that if \(a\in A\) and \(a+m<2r,\) then \(a+m\in A.\) Therefore, A is a (mr)-set.

Conversely, if A is a (mr)-set, then by Lemma 4, we know that \(\{a\, {\textrm{ mod }}\, m\mid a\in A\}= \{i_1,\dots i_k\}\subseteq \{1,\dots , m-1\}\backslash \{r\, {\textrm{ mod }}\, m\}.\) For all \(j\in \{1,\dots ,k\}\), let \(a_j=\min \{ a\in A \mid a\, {\textrm{ mod }}\, m=i_j \}.\) Then it is clear that \(A=\left( \{a_1,\dots , a_j\}+\langle m \rangle \right) \cap \{r+1,\dots ,2r-1\}.\)

Example 4

Take \(m=5\) and \(r=23.\) Then \(\{1,\dots , m-1\}\backslash \{r \, {\textrm{ mod }}\, m \}=\{1,2,4\}.\) If we take \(i_1=1,\) \(i_2=4,\) \(a_1=31\) and \(a_2=29,\) then by applying Theorem 1, we have that \(\left( \{31,29\}+\langle 5 \rangle \right) \cap \{24,25,\dots , 45\}=\{31,36,41,29,34,39,44\}\) is a (5, 23)-set. By applying Proposition 5, we have that \(S=\langle 5,23\rangle \cup \{29,31,34,36,39,41,44\}\cup \{46, \rightarrow \}\) is an element of \(\mathscr {L}(5,23)\) which is ratio-elementary.

If F is a positive integer, we denote by \(\mathscr {L}(m,r)[F]=\{S\in \mathscr {L}(m,r)\mid {\mathrm F}(S)=F\}.\)

Our next aim in this section will be to give an algorithm which allows compute all the elements of \(\mathscr {L}(m,r)[F]\) when \(F<2r.\)

The next lemma is straightforward to prove.

Lemma 5

Under the standing notation, it is verified that

1):

If \(S\in \mathscr {L}(m,r)\) and \({\mathrm F}(S)<r\), then \({\mathrm F}(S)\in \{r-1,r-2\}.\)

2):

\(\mathscr {L}(m,r)[r-2]\ne \emptyset \) if and only if \(r \, {\textrm{ mod }}\, m=1.\) Besides, in this case, \(\mathscr {L}(m,r)[r-2]=\{\langle m \rangle \cup \{r,\rightarrow \}\}.\)

3):

\(\mathscr {L}(m,r)[r-1]\ne \emptyset \) if and only if \(r \, {\textrm{ mod }}\, m\in \{2,\dots ,m-1\}.\) Besides, in this case, \(\mathscr {L}(m,r)[r-1]=\{\langle m \rangle \cup \{r,\rightarrow \}\}.\)

4):

If \(F>r,\) then \(\mathscr {L}(m,r)[F]\ne \emptyset \) if and only if \(F\notin \langle m,r \rangle .\) Besides, in this case, \(\langle m,r \rangle \cup \{F+1,\rightarrow \}\in \mathscr {L}(m,r)[F].\)

5):

If \(r+1 \notin \langle m,r \rangle ,\) then \(\mathscr {L}(m,r)[r+1]=\{\langle m \rangle \cup \{r,r+2,\rightarrow \}\}.\)

We want to compute the set \(\mathscr {L}(m,r)[F]\) when \(F<2r.\) By applying the previous lemma, we can suppose that \(F\in \{r+2,\dots , 2r-1\}\) and \(F\notin \langle m,r\rangle . \) Note that as a consequence of Lemma 4, we have that \(F\notin \langle m,r \rangle \) if and only if \(F \, {\textrm{ mod }}\, m\notin \{0, r \, {\textrm{ mod }}\, m\}.\) Hence in the rest of this section we will assume that \(F\in \{r+2,\dots ,2r-1\}\) and \(F \, {\textrm{ mod }}\, m \notin \{0, r \, {\textrm{ mod }}\, m\}.\)

Let \(A \subseteq \{r+1,\dots , F-1\}.\) We will say that A is a (mrF)-set if it verifies the following conditions:

1):

\(a \, {\textrm{ mod }}\, m\notin \{0, r \, {\textrm{ mod }}\, m, F \, {\textrm{ mod }}\, m\}\) for all \(a\in A.\)

2):

If \(a\in A\) and \(a+m<F,\) then \(a+m\in A.\)

Proposition 6

The following conditions are equivalents:

1):

\(S \in \mathscr {L}(m,r)[F].\)

2):

\(S=\langle m,r\rangle \cup A \cup \{F+1,\rightarrow \}\) where A is a (mrF)-set.

Proof

\(1) \Longrightarrow 2)\) Let \(A=\{s\in S\mid r<s<F \text{ and } s \notin \langle m,r \rangle \}.\) Then it is clear that \(A \subseteq \{r+1, \dots ,F-1\}\) and \(a \, {\textrm{ mod }}\, m \notin \{0, r \, {\textrm{ mod }}\, m, F \, {\textrm{ mod }}\, m,\}\) for every \(a\in A.\) Besides, if \(a\in A\) and \(a+m<F,\) then by applying Lemma 4, we deduce that \(a+m\in A. \) Therefore, \(S=\langle m,r \rangle \cup A \cup \{F+1,\rightarrow \}\) and A is a (mrF)-set.

\(2) \Longrightarrow 1)\) It will be suffice to see that S is a numerical semigroup. For this purpose, it will be enough to prove that if \(a\in A\), then \(a+m\in S.\) But if \(a+m>F,\) then it is clear. Also it is true if \(a+m<F\) because A is a (mrF)-set.

figure d

Example 5

We are going to calculate \(\mathscr {L}(5,11)[17]\) by applying the previous algorithm.

  • \(B=\{x \, {\textrm{ mod }}\, 5 \mid x\in \{12,13,14,15,16\}\} \backslash \{0,1,2 \} =\{3,4\}.\)

  • \(C(3)=\{13\}\) and \(C(4)=\{14\}.\)

  • \(D=\{\emptyset , (13),(14),(13,14)\}.\)

  • \(E=\{\emptyset , \{13\},\{14\},\{13,14\}\}.\)

  • \(\mathscr {L}(5,11)[17]=\{\langle 5,11 \rangle \cup A \cup \{18\rightarrow \}\mid A \in \{\emptyset , \{13\},\{14\}, \{13,14\}\}\}=\{ \langle 5,11,18,19\rangle , \langle 5,11,13,19\rangle , \langle 5,11,14,18\rangle , \langle 5,11,13,14\rangle \}.\)

4 The elements of \(\mathscr {L}(m,r)\) that are not elementary

Our main aim in this section will be to show an algorithm which allows us to compute all the elements of \(\mathscr {L}(m,r)[F]\) when \(F>2r.\) Therefore, in all this section, we suppose that mr and F are integers such that \(3\le m<r<2r<F\), \(r \, {\textrm{ mod }}\, m\ne 0\) and \(F\notin \langle m,r\rangle .\)

Following the notation introduced in [9], a numerical semigroup is irreducible if it can not be expressed as an intersection of two numerical semigroups containing it properly. This kind of semigroups has been widely studied and are called symmetric or pseudo-symmetric numerical semigroups depending on whether their Frobenius number is odd or even, respectively (see [5] and [2]). There are many characterizations of them. The following results is Corollary 4.5 from [11].

Proposition 7

Let S be a numerical semigroup. Then the following conditions are hold:

  1. 1)

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

  2. 2)

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

In [11, Lemma 2.14], it is is shown that if S is a numerical semigroup, then \(\displaystyle \frac{{\mathrm F}(S)+1}{2} \le {\mathrm g}(S).\)

Then Proposition 7, asserts that irreducible numerical semigroups are those numerical semigroups with the least possible genus in terms of their Frobenius number.

The following result appears in [3, Lemma 4].

Proposition 8

If S is a numerical semigroup, then the following conditions are hold:

  1. 1)

    S is irreducible if and only if S is maximal (with respect to the inclusion ordering) in the set of all the numerical semigroups with Frobenius number \({\mathrm F}(S).\)

  2. 2)

    If \(h={\textrm{max}}\{x\in \mathbb {N}\backslash S\mid {\mathrm F}(S)-x \notin S \text{ and } x\ne \frac{{\mathrm F}(S)}{2}\}\), then \(S \cup \{h\}\) is also a numerical semigroup with Frobenius number \({\mathrm F}(S).\)

  3. 3)

    S is irreducible if and only if \(\{x\in \mathbb {N}\backslash S \mid {\mathrm F}(S)-x\notin S \text{ and } x \ne \frac{{\mathrm F}(S)}{2}\}=\emptyset .\)

If S is not an irreducible numerical semigroup, we denote by \(\alpha (S)={\textrm{max}}\{x\in \mathbb {N}\backslash S\mid {\mathrm F}(S)-x\notin S \text{ and } x \ne \frac{{\mathrm F}(S)}{2}\}.\) By definition, we will say that \(\alpha (S)=0\) if S is an irreducible numerical semigroup. Note that if \(\alpha (S)\ne 0,\) then \(\displaystyle \frac{{\mathrm F}(S)}{2}<\alpha (S)<{\mathrm F}(S).\)

As \(r<\displaystyle \frac{F}{2},\) then if \(S\in \mathscr {L}(m,r)[F]\), Proposition 8 allows us recurrentely define the following sequence of elements of \(\mathscr {L}(m,r)[F]:\) \(S_0=S\) and \(S_{n+1}=S_n \cup \{\alpha (S_n)\}.\)

The following result has an easy proof.

Proposition 9

Let \(S\in \mathscr {L}(m,r)[F]\) and let \(\{S_n\mid n\in \mathbb {N}\}\) be the sequence defined above, then there is \(p\in \mathbb {N}\) such that \(S_p\) is an irreducible numerical semigroup with \({\mathrm m}(S_p)=m\), \(\textrm{r}(S_p)=r\) and \({\mathrm F}(S_p)=F.\)

The numerical semigroup \(S_p\) is called irreducible numerical semigroup associated to S and it will be denoted by \({\mathrm I}(S).\)

Define the following equivalence binary relation over \(\mathscr {L}(m,r)[F]\): \(S \sim T\) if and only if \({\mathrm I}(S)={\mathrm I}(T).\)

Denote by \([S]=\{T \in \mathscr {L}(m,r)[F]\mid S \sim T\}\) and by \(\mathscr {J}(\mathscr {L}(m,r)[F])=\{S\in \mathscr {L}(m,r)[F]\mid S \text{ is } \text{ irreducible }\}.\)

As a consequence of Proposition 9, we have the following result.

Theorem 2

The quotient set of \(\mathscr {L}(m,r)[F]\) by \(\sim \) is \(\displaystyle \frac{\mathscr {L}(m,r)[F]}{\sim }=\{[S]\mid S\in \mathscr {J}(\mathscr {L}(m,r)[F]) \}.\) Moreover, if \(\{S,T\} \subseteq \mathscr {J}(\mathscr {L}(m,r)[F])\) and \(S\ne T,\) then \([S]\cap [T]=\emptyset .\)

As a consequence of previous theorem, to built all the elements of \(\mathscr {L}(m,r)[F]\) it is enough:

  1. 1.

    An algorithm which computes \(\mathscr {J}(\mathscr {L}(m,r)[F]).\)

  2. 2.

    An algorithm which computes [S] for each \(S\in \mathscr {J}(\mathscr {L}(m,r)[F]). \)

In [4] appears an algorithm which allows to calculate all the irreducible numerical semigroups with multiplicity m and Frobenius number F. If we take those that have ratio r, then we have an algorithm which computes \(\mathscr {J}(\mathscr {L}(m,r)[F]).\)

The rest of this section, we will focus on give an algorithm which computes \([\varDelta ]\) for each \(\varDelta \in \mathscr {J}(\mathscr {L}(m,r)[F]).\) For this purpose, we define the graph \(G([\varDelta ])\) of the following way: the set of vertices is \([\varDelta ]\) and \((S,T)\in [\varDelta ] \times [\varDelta ]\) is an edge of \(G([\varDelta ])\) if and only if \(T = S\cup \{\alpha (S)\}\) and \(\alpha (S)\ne 0.\)

Theorem 3

If \(\varDelta \in \mathscr {J}(\mathscr {L}(m,r)[F]),\) then \(G([\varDelta ])\) is a tree with root \(\varDelta .\) Moreover, the set formed by the children of a vertex T of the tree \(G([\varDelta ])\) is \(\{T\backslash \{x\}\mid x \in {\textrm{ msg }}(T), \frac{F}{2}<x<F \text{ and } \alpha (T)<x\}. \)

Proof

By applying Proposition 9, we easily deduce that \(G([\varDelta ])\) is a tree with root \(\varDelta .\) If S is a child of T, then \(T=S\cup \{\alpha (S)\}\) and \(\alpha (S)\ne 0.\) Therefore, \(S=T\backslash \{\alpha (S)\}\) and by applying Lemma 3, we deduce that \(\alpha (S)\in {\textrm{ msg }}(T)\) and \(\frac{F}{2}<\alpha (S)<F.\) It is also clear that \(\alpha (T)<\alpha (S).\)

Conversely, if \(x\in {\textrm{ msg }}(T),\) \(\frac{F}{2}<x<F\) and \(\alpha (T)<x,\) then it is clear that \(T\backslash \{x\}\in \mathscr {L}(m,r)[F]\) and \(\alpha (T\backslash \{x\})=x.\) As \(T=(T\backslash \{x\})\cup \{ \alpha (T\backslash \{x\})\},\) we have that \(T\backslash \{x\}\) is a child of T.

We are now ready to prove the announced algorithm at the beginning of this section.

The pseudo-code in Algorithm 3 shows how to compute \([\varDelta ]\) for any \(\varDelta \in \mathscr {J}(\mathscr {L}(m,r)[F]).\)

figure e

In the following example we illustrate the usage of Algorithm 3

Example 6

Let us compute \([\varDelta ]\) for \(\varDelta =\langle 5,7,16\rangle =\{0,5,7,10,12,14,15,16,17,19,\rightarrow \}.\) It is verified that \({\mathrm F}(\varDelta )=18,\) \({\mathrm g}(\varDelta )=10\) and \({\mathrm g}(\varDelta )=\displaystyle \frac{{\mathrm F}(\varDelta )+2}{2}.\) Hence, by applying Proposition 7, we have that \(\varDelta \in \mathscr {J}(\mathscr {L}(5,7)[18]).\)

  • \(A=\{\langle 5,7,16\rangle \}\) and \(C=\{\langle 5,7,16\rangle \}.\)

  • \(B_{\langle 5,7,16\rangle }=\{\langle 5,7,23\rangle \}.\)

  • \(C=\{\langle 5,7,23\rangle \}.\)

  • \(A=\{\langle 5,7,16\rangle ,\langle 5,7,23\rangle \}.\)

  • \(B_{\langle 5,7,23\rangle }=\emptyset .\)

  • \(C=\emptyset .\)

  • \([\langle 5,7,16 \rangle ]=\{\langle 5,7,16\rangle ,\langle 5,7,23\rangle \}.\)

5 Intersection of Apéry sets of m and r

Let S be a numerical semigroup and \(n\in S\backslash \{0\}\). The Apéry set of n in S (named so in honour of [1]) is \(\textrm{Ap}(S,n)=\{s\in S\mid s-n \notin S\}\).

The following result appears in [11, Lemma 2.4].

Lemma 6

Let S be a numerical semigroup and \(n\in S\backslash \{0\}\). Then \(\textrm{Ap}(S,n)\) is a set with cardinality n. Moreover, \(\textrm{Ap}(S,n)=\{0=w(0),w(1), \dots , w(n-1)\}\), where w(i) is the least element of S congruent with i modulo n, for all \(i\in \{0,\dots , n-1\}.\)

Proposition 10

If \(S\in \mathscr {L}(m,r),\) then \(S=\left( \textrm{Ap}(S,m)\cap \textrm{Ap}(S,r)\right) +\langle m,r \rangle .\)

Proof

It is clear that \(\left( \textrm{Ap}(S,m)\cap \textrm{Ap}(S,r)\right) +\langle m,r \rangle \subseteq S.\) Now, we are going to see the other inclusion. If \(s\in S,\) then we recurrentely define the following sequence:

\(s_0 = s\) and

\(s_{n+1} =\left\{ \begin{array}{lcl} s_n-m &{} &{} \text{ if } \,\, s_n-m\in S,\\ s_n-r &{} &{} \text{ if } \,\, s_n-m\notin S \text{ and } s_n-r\in S\\ s_n &{} &{} \text{ if } \,\, s_n-m\notin S \text{ and } s_n-r\notin S.\\ \end{array} \right. \)

Clearly, there is \(k\in \mathbb {N}\) such that \(s_k=s_{k+h}\) for all \(h\in \mathbb {N}.\) Then we deduce that \(s_k\in \textrm{Ap}(S,m)\cap \textrm{Ap}(S,r)\) and \(s\in \{s_k\}+\langle m,r\rangle .\)

Let \((A,\le )\) an ordered set and \(B\subseteq A.\) We will say that B is a subset of incomparable elements, if the following condition holds: if \(\{b,b'\}\subseteq B\) and \(b\le b',\) then \(b=b'.\)

Let \({\mathrm H}(\langle m,r\rangle )=\mathbb {N}\backslash \langle m,r\rangle .\) We define over \({\mathrm H}(\langle m,r\rangle )\) the following order relation: \(h \lesssim h'\) if and only if \(h'-h \in \langle m,r \rangle .\)

The following result is not hard to see.

Lemma 7

If \(S\in \mathscr {L}(m,r),\) then the following conditions hold:

  1. 1)

    \(0\in \textrm{Ap}(S,m)\cap \textrm{Ap}(S,r).\)

  2. 2)

    \(\left( \textrm{Ap}(S,m)\cap \textrm{Ap}(S,r)\right) \backslash \{0\}\) is the set formed by the minimals elements of \({\mathrm H}(\langle m,r\rangle )\cap S\) with respect to \(\lesssim .\)

  3. 3)

    \(\left( \textrm{Ap}(S,m)\cap \textrm{Ap}(S,r)\right) \backslash \{0\}\) is a subset of incomparable elements of \({\mathrm H}(\langle m,r\rangle , \lesssim ).\)

Theorem 4

Under the standing notation, \(S\in \mathscr {L}(m,r)\) if and only if \(S=\{h_0=0, h_1,\dots , h_p\}+\langle m,r \rangle ,\) where \(p\in \mathbb {N}\) and \(\{h_1,\dots ,h_p\}\) is a subset of incomparable elements of \({\mathrm H}(\langle m,r\rangle , \lesssim )\) verifying the following conditions:

  1. 1)

    \({\textrm{gcd}}\{m,r,h_1,\dots , h_p\}=1.\)

  2. 2)

    \(r<\min \{h_1,\dots , h_p\}.\)

  3. 3)

    For all \(\{i,j\}\subseteq \{1,\dots ,p\}\) there is \(k\in \{0,1,\dots ,p\}\) such that \(h_i+h_j-h_k \in \langle m,r \rangle .\)

Proof

Necessity. Consider \(\{h_0=0, h_1,\dots , h_p\}=\textrm{Ap}(S,m)\cap \textrm{Ap}(S,r).\) Then by Lemma 7, we know that \( \{ h_1,\dots , h_p\}\) is a subset of incomparable elements of \({\mathrm H}(\langle m,r\rangle , \lesssim )\) and by Proposition 10, we have that \(S=\{h_0=0, h_1,\dots , h_p\}+\langle m,r \rangle .\) Clearly, \(S=\langle m,r, h_1,\dots , h_p \rangle \) and so \({\textrm{gcd}}\{m,r, h_1,\dots , h_p\}=1\) and \(h_i>r\) for all \(i\in \{1,\dots , p\}.\) As \(h_i+h_j\in S=\{h_0=0, h_1,\dots , h_p\}+\langle m,r \rangle ,\) then we deduce that there is \(k\in \{0,1,\dots ,p\}\) such that \(h_i+h_j-h_k \in \langle m,r \rangle .\)

Sufficiency. From 3) we easily deduce that S is a submonoid of \((\mathbb {N},+).\) As \(S=\{h_0=0, h_1,\dots , h_p\}+\langle m,r \rangle ,\) then \(S=\langle m,r, h_1,\dots , h_p \rangle . \) By applying 1) and 2) we obtain that \(S\in \mathscr {L}(m,r).\)

Example 7

Take \(m=10\) and \(r=12,\) then \(\{15\}\) is a subset of incomparable elements of \({\mathrm H}(\langle 10,12\rangle , \lesssim )\) verifying 1), 2) and 3) of Theorem 4. Therefore, \(S=\{0,15\}+\langle 10,12 \rangle =\langle 10,12,15 \rangle \in \mathscr {L}(10,12).\)

In the rest of this section, we suppose that \({\textrm{gcd}}\{m,r\}=1.\)

Denote by \({\mathrm B}(m,r)=\{(a,b)\in \{1,\cdots , r-1\}\times \{1,\cdots , m-1\} \mid mr-am-br\ge 0\}.\) Consider \({\mathrm B}(m,r)\) ordered by the cartesian product order, that is, \((a,b)\le (a',b')\) if and only if \((a'-a,b'-b)\in \mathbb {N}\times \mathbb {N}.\)

The following result is Proposition 10 from [10].

Proposition 11

The correspondence \( \theta : {\mathrm B}(m,r) \longrightarrow {\mathrm H}(\langle m,r\rangle )\) defined by \(\theta (a,b)=mr-am-br\) is a bijective map. Moreover, \((a,b)\le (a',b')\) if and only if \(\theta (a',b') \lesssim \theta (a,b). \)

If \(h\in {\mathrm H}(\langle m,r\rangle )\), \((a,b)\in {\mathrm B}(m,r)\) and \(\theta (a,b)=h,\) then we will say that (ab) are the coordinates of h.

If \(q\in \mathbb {Q}\), then \(\lfloor q \rfloor ={\textrm{max}}\{z\in \mathbb {Z}\mid z\le q\}.\) The following result appears in [10, Theorem 15].

Theorem 5

Let \(\{(a_1,b_1),\dots , (a_p,b_p)\}\) be a subset of incomparable elements of \(({\mathrm B}(m,r),\le )\) verifying the following condition: if \(\{i,j\}\subseteq \{1,\dots , p\},\) \((a_i+a_j) \, {\textrm{ mod }}\, r \ne 0, \) \((b_i+b_j) \, {\textrm{ mod }}\, m \ne 0 \) and \(\displaystyle \left\lfloor \frac{a_i+a_j}{r}\right\rfloor +\left\lfloor \frac{b_i+b_j}{m}\right\rfloor =1, \) then there is \(k \in \{1,\dots , p\}\) such that \(\displaystyle \left( (a_i+a_j) \, {\textrm{ mod }}\, r, (b_i+b_j) \, {\textrm{ mod }}\, m \right) \le (a_k,b_k).\) Then \(S=\{0,\theta (a_1,b_1), \dots , \theta (a_p,b_p) \}+\langle m,r \rangle \) is a numerical semigroup which contains \(\langle m,r \rangle .\) Moreover, every numerical semigroup that contains \(\langle m,r \rangle \) has this form.

As a consequence of Theorems 4 and 5 we have the following result.

Corollary 1

Let \(\{(a_1,b_1),\dots , (a_p,b_p)\}\) be a subset of incomparable elements of \(({\mathrm B}(m,r),\le )\) verifying the following conditions:

  1. 1)

    \(\theta (a_i,b_i)>r\) for all \(i \in \{1,\dots , p\}.\)

  2. 2)

    If \(\{i,j\}\subseteq \{1,\dots ,p\},\) \((a_i+a_j) \, {\textrm{ mod }}\, r \ne 0, \) \((b_i+b_j) \, {\textrm{ mod }}\, m \ne 0\) and \(\displaystyle \left\lfloor \frac{a_i+a_j}{r}\right\rfloor +\left\lfloor \frac{b_i+b_j}{m}\right\rfloor =1,\) then there is \(k\in \{1,\dots , p\}\) such that \(\left( (a_i+a_j) \, {\textrm{ mod }}\, r, (b_i+b_j) \, {\textrm{ mod }}\, m \right) \le (a_k,b_k).\)

Then \(S=\{0,\theta (a_1,b_1),\dots ,\theta (a_p,b_p)\}+\langle m,r \rangle \) is an element of \(\mathscr {L}(m,r).\) Moreover, every element of \(\mathscr {L}(m,r)\) has this form.

The following result is Theorem 19 from [10]. Notice that in the next theorem it is not necessary that the set A is a numerical semigroup.

Theorem 6

Let \(\{(a_1,b_1),\dots , (a_p,b_p)\}\) be a subset of incomparable elements of \(({\mathrm B}(m,r),\le )\) such that \(b_1<b_2<\dots <b_p\) and let \(A=\{0,\theta (a_1,b_1),\dots , \theta (a_p,b_p)\}+\langle m,r \rangle .\) Then \(\sharp (\mathbb {N}\backslash A)=\displaystyle \frac{(m-1)(r-1)}{2}-(a_1b_1+a_2(b_2-b_1)+\dots +a_p(b_p-b_{p-1})).\)

Remark 1

Note that if the set \(\{(a_1,b_1),\dots , (a_p,b_p)\}\) of the previous theorem verifies 1) and 2) from Corollary 1, then \(A\in \mathscr {L}(m,r)\) and so Theorem 6 gives us a formula to calculate the genus of A.

The following result appears in [10, Theorem 24]. Notice that in the next result it is not necessary that the set A is a numerical semigroup.

Theorem 7

Let \(\{(a_1,b_1),\dots , (a_p,b_p)\}\) be a subset of incomparable elements of \(({\mathrm B}(m,r),\le )\) such that \(b_1<b_2<\dots <b_p,\) \(A=\{0,\theta (a_1,b_1),\dots , \theta (a_p,b_p)\}+\langle m,r \rangle \) and \(M=\{(a_1+1,1),(a_2+1,b_1+1),\dots ,(a_p+1,b_{p-1}+1,),(1,b_p+1)\}.\) If \(A\ne \mathbb {N},\) then \({\textrm{max}}(\mathbb {Z}\backslash A)={\textrm{max}}\{mr-xm-yr\mid (x,y)\in M\}.\)

Remark 2

Note that if the set \(\{(a_1,b_1),\dots , (a_p,b_p)\}\) of the theorem above verifies 1) and 2) from Corollary 1, then \(A\in \mathscr {L}(m,r)\) and so Theorem 7 gives us a formula to calculate the Frobenius number of A.

Example 8

Take \(m=5\) and \(r=7.\) Then \(\{(2,2),(1,3)\}\) is a subset of incomparable elements of \(({\mathrm B}(5,7),\le )\) verifying the conditions 1) and 2) of Corollary 1. Then \(S=\{0, \theta (2,2), \theta (1,3)\}+ \langle 5,7\rangle =\{0,9,11\}+\langle 5,7\rangle =\langle 5,7,9,11 \rangle \in \mathscr {L}(5,7).\) Moreover, by Theorem 6, we have \({\mathrm g}(S)=\displaystyle \frac{4 \cdot 6}{2}-5=7.\) Furthermore, \(M=\{(3,1),(2,4),(1,4)\}\) and by applying Theorem 7, we have \({\mathrm F}(S)={\textrm{max}}\{35-22,35-38,35-33\}=13.\)