1 Introduction

Let \(\mathbb {Z}\) be the set of integer numbers and \(\mathbb {N}=\{z\in \mathbb {Z}\mid z\ge 0\}\). Let \(k\in \mathbb {N}\backslash \{0\}\), a submonoid of \((\mathbb {N}^k,+)\) is a subset M of \(\mathbb {N}^k\) which is closed under addition and contains the element \((0,\dots , 0).\) A plane monoid is a submonoid of \((\mathbb {N}^2,+)\). A numerical semigroup is a submonoid S of \((\mathbb {N},+)\) such that \(\mathbb {N}\backslash S=\{x\in \mathbb {N}\mid x\notin S\}\) is finite.

Let M be a plane monoid. We will say that an integer number n is bounded by M if there is \((a,b)\in M\) such that \(a<n<b\). We will denote it by \({\mathrm A}(M)=\{n \in \mathbb {N}\mid n \text{ is } \text{ bounded } \text{ by } M\}\). In [4] it is proven that if \({\mathrm A}(M)\ne \emptyset \) then \({\mathrm A}(M)\cup \{0\}\) is a numerical semigroup. An \(\mathcal {A}\)-semigroup is a numerical semigroup S such that \(S={\mathrm A}(M) \cup \{0\}\) for some plane monoid M. In [4, Theorem 2.4] it is shown that a numerical semigroup S is an \(\mathcal {A}\)-semigroup if and only if \(x+y-1,x+y+1\in S\) for all \(x,y \in S\backslash \{0\}.\)

Let M be a plane monoid and \(p,q\in \mathbb {N}\). We will say that an integer number n is M(pq)-bounded if there is \((a,b)\in M\) such that \(a+p\le n \le b-q\). We will denote it by \({\mathrm A}(M(p,q))=\{n\in \mathbb {N}\mid n \text { is } M(p,q)\text {-bounded}\}.\) In [5] it is proven that \({\mathrm A}(M(p,q))\cup \{0\}\) is a submonoid of \((\mathbb {N},+).\) An \(\mathcal {A}(p,q)\)-semigroup is a numerical semigroup S such that \(S= {\mathrm A}(M(p,q))\cup \{0\}\) for some plane monoid M.

Observe that if M is a plane monoid, then \({\mathrm A}(M)\cup \{0\}={\mathrm A}(M(1,1))\cup \{0\}\). Therefore, the concepts of \(\mathcal {A}\)-semigroup and \(\mathcal {A}(1,1)\)-semigroup are the same. In Sect. 2, we will see that a numerical semigroup S is an \(\mathcal {A}(p,q)\)-semigroup if and only if \(\{x+y-p,x+y-p+1,\dots ,x+y+q\}\subseteq S\) for all \(x,y\in S\backslash \{0\}.\)

If S is a numerical semigroup, then \({\mathrm m}(S)=\min (S\backslash \{0\})\), \({\mathrm F}(S)={\mathrm {max}}\{z\in \mathbb {Z}\mid z\notin S\}\) and \({\mathrm g}(S)=\sharp (\mathbb {N}\backslash S)\) (where \(\sharp (X)\) denotes the cardinality of a set X), are three invariants of S which are called multiplicity, Frobenius number and genus of S, respectively.

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

  1. 1)

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

  2. 2)

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

  3. 3)

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

We will denote it by \(\mathcal {A}(p,q)[m]=\{S \mid S \text { is an }\mathcal {A}(p,q)\text {-semigroup and }{\mathrm m}(S)=m\}.\) In Sect. 3, we will see that \(\mathcal {A}(p,q)[m]\) is a Frobenius pseudo-variety. This fact allows us to order the elements of \(\mathcal {A}(p,q)[m]\) making a tree with root. Consequently, we present an algorithmic procedure to calculate all the elements of \(\mathcal {A}(p,q)[m]\).

In Sect. 4, we will see that if X is a nonempty subset of \(\mathbb {N}\backslash \{0,1\}\) and \(p\le \min (X)\), then there exists a unique smallest (with respect to set inclusion) \(\mathcal {A}(p,q)\)-semigroup containing X and it will be denoted by \(\mathcal {A}(p,q)(X)\). If \(m=\min (X)\), then we will see that \(\mathcal {A}(p,q)(X)\) is the intersection of all elements of \(\mathcal {A}(p,q)[m]\) containing X. Moreover, we will present an algorithm which calculates \(\mathcal {A}(p,q)(X)\) from X.

A plane monoid M is cyclic if there exists \((a, b) \in M\) such that \(M=\{(ka, kb)\mid k\in \mathbb {N}\}.\) Following the terminology introduced in [2] an \({{\mathcal {A}}{\mathcal {C}}}\)-semigroup is a numerical semigroup S such that \(S={\mathrm A}(M)\cup \{0\}\) for some plane and cyclic monoid M. Note that if \(M=\{(ka,kb)\mid k\in \mathbb {N}\}\) then \({\mathrm A}(M)=\{n\in \mathbb {N}\mid ka< n < kb \text { for some } k\in \mathbb {N}\}.\)

We say that a numerical semigroup S is an \({{\mathcal {A}}{\mathcal {C}}}(p,q)\)-semigroup if \(S={\mathrm A}(M(p,q))\cup \{0\}\) for some plane and cyclic monoid M. Note that if \(M=\{(ka,kb)\mid k\in \mathbb {N}\}\) then \({\mathrm A}(M(p,q))=\{n\in \mathbb {N}\mid ka+p \le n \le kb-q \text { for some } k\in \mathbb {N}\}.\) Also, notice that the concepts of \({{\mathcal {A}}{\mathcal {C}}}\)-semigroup and \({{\mathcal {A}}{\mathcal {C}}}(1,1)\)-semigroup are the same. Our main aim in Sect. 5 is to give formulas to compute, in terms of a, b, p and q, the multiplicity, the Frobenius number and the genus of \({\mathrm A}(M(p,q))\cup \{0\}.\)

2 \(\mathcal {A}(p,q)\)-semigroups

Let M be a plane monoid and \(p,q \in \mathbb {N}\). Our first aim in this section will be to study the conditions that M, p and q have to fulfil to make \({\mathrm A}(M(p,q))\cup \{0\}\) a numerical semigroup.

Lemma 1

If M is a plane monoid and \(p,q \in \mathbb {N}\), then \({\mathrm A}(M(p,q))\cup \{0\}\) is a submonoid of \((\mathbb {N},+).\)

Proof

Trivially \({\mathrm A}(M(p,q))\subseteq \mathbb {N}\) and \(0\in {\mathrm A}(M(p,q))\cup \{0\}\) . If \(x,y\in {\mathrm A}(M(p,q))\), then there are \(i,j\in \mathbb {N}\) and \((a,b)\in M\) such that \(ai+p\le x \le bi-q\) and \(aj+p\le x \le bj-q.\) Therefore, \(a(i+j)+p\le a(i+j)+2p \le x+y \le b(i+j)-2q\le b(i+j)-q.\) Hence, \({\mathrm A}(M(p,q))\cup \{0\}\) is a submonoid of \((\mathbb {N},+).\) \(\square \)

The following result is a consequence of [8, Lemma 1.1].

Lemma 2

Let M be a submonoid of \((\mathbb {N},+).\) Then M is a numerical semigroup if and only if \({\mathrm {gcd}}(M)=1.\)

We can now give the result announced at the beginning of this section.

Proposition 3

Let M be a plane monoid and \(p,q\in \mathbb {N}\). Then \({\mathrm A}(M(p,q))\cup \{0\}\) is a numerical semigroup if and only if one of the following conditions is fulfilled:

  1. (1)

    There is \((m,n)\in M\) such that \(m<n.\)

  2. (2)

    There is a numerical semigroup S such that \(\{(s,s)\mid s\in S\}\subseteq M \) and \(p=q=0.\)

Proof

(Necessity) We suppose that 1) does not hold. Let \(s\in {\mathrm A}(M(p,q))\), then there is \((a,b) \in M\) such that \(a+p\le s \le b-q\). As \(b\le a\), we deduce \(p=q=0\) and \(a=b=s\). Therefore, \(\{(s,s)\mid s\in {\mathrm A}(M(p,q)) \cup \{0\}\}\subseteq M .\) Hence 2) holds.

(Sufficiency) By Lemma 1, we know that \({\mathrm A}(M(p,q))\cup \{0\}\) is a submonoid of \((\mathbb {N},+)\). Then, by Lemma 2, to prove that \({\mathrm A}(M(p,q))\cup \{0\}\) is a numerical semigroup, it will be enough to see that \({\mathrm {gcd}}({\mathrm A}(M(p,q))\cup \{0\})=1.\)

We suppose that (1) holds. Then, there is \((a,b)\in M\) such that \(a<b\). As \(a< b\), there exists \(x\in \mathbb {N}\) such that \((b-a)x\ge p+q+1.\) Therefore, \(ax+p+1\le bx-q\) and so \(ax+p\le ax+p+1 \le bx-q.\) Consequently, \(\{ax+p,ax+p+1\}\subseteq {\mathrm A}(M(p,q)).\) Hence, \({\mathrm {gcd}}({\mathrm A}(M(p,q))\cup \{0\})=1.\)

Now, we will suppose that (2) is true. Then \(S\subseteq {\mathrm A}(M(p,q))\cup \{0\}\). By Lemma 2, we know that \({\mathrm {gcd}}(S)=1\) and so \({\mathrm {gcd}}({\mathrm A}(M(p,q))\cup \{0\})=1.\) \(\square \)

Our next aim will be to prove Theorem 8. For this purpose, we need to introduce some notions and results.

Lemma 4

Let M be a plane monoid and \(p,q\in \mathbb {N}\) such that \({\mathrm A}(M(p,q))\cup \{0\}\) is a numerical semigroup. Then \(\{s+t-p,s+t-p+1,\dots ,s+t+q\}\subseteq {\mathrm A}(M(p,q))\) for all \(s,t\in {\mathrm A}(M(p,q)).\)

Proof

If \(s,t\in {\mathrm A}(M(p,q))\), then there are \((a,b),(m,n)\in M\) such that \(a+p\le s \le b-q\) and \(m+p\le t \le n-q.\) Therefore, \(a+m+2p\le s+t \le b+n-2q\) and \((a+m,b+n)\in M.\) If \(i\in \{0,1,\dots ,p\},\) then \(a+m+p\le a+m+2p-i \le s+t-i \le b+n-2q-i\le b+n-q\) and so \(s+t-i \in {\mathrm A}(M(p,q)).\) If \(j\in \{0,1,\dots ,q\},\) then \(a+m+p\le a+m+2p+j \le s+t+j \le b+n-2q+j\le b+n-q\) and so \(s+t+j \in {\mathrm A}(M(p,q)).\) \(\square \)

Let \(k\in \mathbb {N}\backslash \{0\}\) and let X be a nonempty set of \(\mathbb {N}^k\). We denote by \(\langle X\rangle \) the submonoid of \((\mathbb {N}^k,+)\) generated by X, that is, \(\langle X \rangle =\{\lambda _1x_1+\dots +\lambda _nx_n\mid n\in \mathbb {N}\backslash \{0\}, \{x_1,\dots , x_n\}\subseteq X \text { and } \{\lambda _1,\dots ,\lambda _n\}\subseteq \mathbb {N}\}.\) It is clear that this submonoid is the smallest (with respect to set inclusion) submonoid of \((\mathbb {N}^k,+)\) containing X and it is the intersection of all submonoids of \((\mathbb {N}^k,+)\) containing X.

If \(M=\langle X \rangle \), we will say that X is a system of generators of M. Moreover, if \(M\ne \langle Y \rangle \) for all \(Y \subsetneq X\), we will say that X is a minimal system of generators of M. A submonoid M of \((\mathbb {N}^k,+)\) is finitely generated if there is a finite set X such that \(M=\langle X \rangle \). There are submonoids of \((\mathbb {N}^k,+)\) which are not finitely generated for all \(k\ge 2\) (see Exercise 2 from [7, Chapter 3]). The following result is Corollary 2.8 from [8].

Lemma 5

Every submonoid of \((\mathbb {N},+)\) has a unique minimal system of generators. Moreover, this system is finite.

If M is a submonoid of \((\mathbb {N},+)\), we denote by \({\mathrm { msg }}(M)\) the minimal system of generators of M. The cardinality of \({\mathrm { msg }}(M)\) is an important invariant of M (see [1]) which is called the embedding dimension of M.

Lemma 6

Let \(p\in \mathbb {N}\) and let S be a numerical semigroup such that \(x+y-p\in S\) for all \(x,y\in S \backslash \{0\}\). Then \(p\le {\mathrm m}(S)\) or \(p=2\) and \({\mathrm m}(S)=1.\)

Proof

If \(p>{\mathrm m}(S)\), then applying that \({\mathrm m}(S)+{\mathrm m}(S)-p \in S\), we deduce \(p=2{\mathrm m}(S).\) If \({\mathrm m}(S)\ne 1\), there is \(r(S)=\min (S\backslash \langle {\mathrm m}(S) \rangle ). \) Then \({\mathrm m}(S)+r(S)-p\in S\) and so \(r(S)-{\mathrm m}(S)\in S\), which is absurd because \(r(S)-{\mathrm m}(S)\in S\backslash \langle {\mathrm m}(S) \rangle \) and \(r(S)-{\mathrm m}(S) < r(S).\) \(\square \)

Lemma 7

Let S be a numerical semigroup such that \(S \ne \mathbb {N}\), \(\{n_1,\dots , n_e\}={\mathrm { msg }}(S)\) and \(p,q\in \mathbb {N}\). We suppose that \(\{x+y-p,x+y-p+1,\dots ,x+y+q\}\subseteq S\) for all \(x,y\in S\backslash \{0\}\). If \(\{n,\lambda _1,\dots , \lambda _e\}\subseteq \mathbb {N}\) and \(\lambda _1(n_1-p)+\dots +\lambda _e(n_e-p)+p\le n \le \lambda _1(n_1+q)+\dots +\lambda _e(n_e+q)-q\), then \(n\in S.\)

Proof

We proceed by induction on \(\lambda _1+\dots + \lambda _e\). If \(\lambda _1+\dots + \lambda _e=0\), then \(\lambda _1=\dots = \lambda _e=0\) and so \(p \le n\le -q.\) Then \(p=q=n=0\) and \(0 \in S.\)

If \(\lambda _1+\dots + \lambda _e=1\), then there is \(i \in \{1, \dots , e\}\) such that \(\lambda _i=1\) and \(\lambda _j=0\) for all \(j \in \{1, \dots , e\}\backslash \{i\}.\) Therefore, \(n_i-p+p\le n \le n_i+q-q.\) Consequently, \(n=n_i \in S.\)

We suppose that \(\lambda _1+\dots + \lambda _e \ge 2\) and let \(i \in \{1,\dots ,e\}\) such that \(\lambda _i \ne 0.\) Let \(\alpha =\lambda _1(n_1-p)+\dots +\lambda _e(n_e-p)+p \) and \(\beta =\lambda _1(n_1+q)+\dots +\lambda _e(n_e+q)-q.\) By applying the induction hypothesis, if \(x\in \mathbb {N}\) and \(\alpha -(n_i-p)\le x \le \beta -(n_i+q)\), we obtain that \(x\in S.\) Hence, \(\{\alpha -(n_i-p), \dots ,\beta -(n_i+q)\}\subseteq S\backslash \{0\}\). So, \(\{\alpha -(n_i-p), \dots ,\beta -(n_i+q)\}+\{n_i\}+\{-p,\dots ,q\}\subseteq S.\) Consequently, \(\{\alpha , \dots , \beta \}\subseteq S.\) \(\square \)

Theorem 8

Let S be a numerical semigroup and \(p,q \in \mathbb {N}\) such that \(p\le {\mathrm m}(S).\) Then S is an \(\mathcal {A}(p,q)\)-semigroup if and only if \(\{s+t-p, \dots , s+t+q\}\subseteq S\) for all \(s,t \in S\backslash \{0\}\).

Proof

(Necessity) Follows from Lemma 4.

(Sufficiency) Let \(\{n_1,\dots , n_e\}\) be the minimal system of generators of S and let M be a plane monoid generated by \(\{(n_1-p,n_1+q), \dots , (n_e-p,n_e+q) \}.\) Then \(\{n_1, \dots , n_e\}\subseteq {\mathrm A}(M(p,q))\) and, by applying Lemma 1, we have \(S \subseteq {\mathrm A}(M(p,q))\cup \{0\}.\)

If \(x\in {\mathrm A}(M(p,q))\), then there is \((a,b)\in M\) such that \(a+p\le x \le b-q.\) As \((a,b)\in M\), there exits \(\{\lambda _1, \dots , \lambda _e\}\subseteq \mathbb {N}\) such that \((a,b)=\lambda _1(n_1-p,n_1+q)+\dots + \lambda _e(n_e-p,n_e+q).\) Therefore, \(\lambda _1(n_1-p)+\dots + \lambda _e(n_e-p)+p \le x \le \lambda _1(n_1+q)+\dots + \lambda _e(n_e+q)-q\) and, by applying Lemma 7, we have \(x\in S.\) Hence, \(S={\mathrm A}(M(p,q))\cup \{0\}\), and consequently S is an \(\mathcal {A}(p,q)\)-semigroup. \(\square \)

From the proof of this result we obtain the following consequence.

Corollary 9

Let \(p,q \in \mathbb {N}\) and let S be a numerical semigroup such that \(p \le {\mathrm m}(S)\). Then the following conditions are equivalent:

(1):

S is an \(\mathcal {A}(p,q)\)-semigroup.

(2):

There is a plane and finitely generated monoid M such that \(S={\mathrm A}(M(p,q))\cup \{0\}.\)

(3):

There is \(\{a_1,b_1, a_2,b_2, \dots , a_e,b_e\} \subseteq \mathbb {N}\) such that \(S=\{n\in \mathbb {N}\mid a_1x_1+a_2x_2+\dots +a_ex_e+p\le n \le b_1x_1+b_2x_2+\dots +b_ex_e-q \text { for some } \{x_1,\dots , x_e\}\subseteq \mathbb {N}\}.\)

We finish this section by giving a very useful criterion to check whether or not a numerical semigroup is an \(\mathcal {A}(p,q)\)-semigroup.

Corollary 10

Let \(p,q\in \mathbb {N}\) and let S be a numerical semigroup such that \(p \le {\mathrm m}(S)\) and \({\mathrm { msg }}(S)=\{n_1,\dots n_e\}.\) Then the following conditions are equivalent.

(1):

S is an \(\mathcal {A}(p,q)\)-semigroup.

(2):

If \(i,j \in \{1,\dots , e\},\) then \(\{n_i+n_j-p, \dots , n_i+n_j+q \} \subseteq S.\)

(3):

If \(s\in S\backslash \{0,n_1,\dots , n_e\}\) then \(\{s-p,\dots , s+q\}\subseteq S.\)

Proof

(1) implies (2). It is an immediate consequence of Theorem 8.

(2) implies (3). If \(s\in S \backslash \{0,n_1,\dots , n_e\}\), then it easily follows that there is \(i,j \in \{1,\dots , e\}\) and there exists \(s' \in S\) such that \(s=n_i+n_j+s'.\) Therefore, \(n_i+n_j+\{-p,\dots ,q\}+s'\in S.\) Hence, \(\{s-p,\dots , s+q\}\subseteq S.\)

(3) implies (1). If \(x,y \in S\backslash \{0\}\), then \(x+y \in S\backslash \{0,n_1,\dots , n_e\}.\) Hence, \(\{x+y-p,\dots , x+y+q\}\subseteq S.\) By Theorem 8, S is an \(\mathcal {A}(p,q)\)-semigroup. \(\square \)

Example 11

Let \(\{5,9,11,12,13\}\) be the minimal system of generators of a numerical semigroup S. Then, by applying Corollary 10, we easily deduce that S is an \(\mathcal {A}(1,2)\)-semigroup.

3 The Frobenius pseudo-variety \(\mathcal {A}(p,q)[m]\)

By using Theorem 8, we can easily deduce that the concepts of \(\mathcal {A}(0,0)\)-semigroup and numerical semigroup are the same. Therefore, for the rest of this section we suppose that \(p,q \in \mathbb {N}\) and \(p+q\ne 0.\) The following result can be deduced from Lemma 6 and Theorem 8.

Lemma 12

If S is an \(\mathcal {A}(p,q)\)-semigroup such that \(S \ne \mathbb {N}\), then \(p\le {\mathrm m}(S).\)

Our next aim is to study what conditions should the integers p, m and q fulfil for

$$\begin{aligned} \mathcal {A}(p,q)[m]=\{S\mid S \text { is an } \mathcal {A}(p,q)\text {-semigroup and }{\mathrm m}(S)=m\} \end{aligned}$$

to be a nonempty set.

Lemma 13

If S is a numerical semigroup, then the set

$$\begin{aligned} \{T\mid T \text { is a numerical semigroup and }S \subseteq T\} \end{aligned}$$

is finite.

Proof

Notice that \(T=S\cup X\) for some \(X\subseteq \mathbb {N}\backslash S.\) To complete the proof it is enough to recall that \(\mathbb {N}\backslash S\) is finite. \(\square \)

Proposition 14

Let \(m\in \mathbb {N}\backslash \{0,1\}\). Then \(\mathcal {A}(p,q)[m]\ne \emptyset \) if and only if \(p\le m.\) Moreover, \(\mathcal {A}(p,q)[m]\) is finite.

Proof

By Lemma 12, we know that if \(\mathcal {A}(p,q)[m]\ne \emptyset \) then \(p\le m.\) Conversely, by applying Theorem 8, we deduce that \(\Delta (m)=\{0,m,\rightarrow \}\in \mathcal {A}(p,q)[m]\) (the symbol \(\rightarrow \) means that every integer greater than m belongs to the set). Thus, \(\mathcal {A}(p,q)[m]\ne \emptyset .\) We will see next that \(\mathcal {A}(p,q)[m]\) is finite. As \(p+q\ne 0\), then \(p\ne 0\) or \(q\ne 0.\) By Theorem 8, if \(S \in \mathcal {A}(p,q)[m]\) then \(\{2m-p, \dots , 2m+q\}\subseteq S.\) Let \(T=\langle m,2m-p, \dots , 2m+q \rangle \), as \({\mathrm {gcd}}\{m,2m-p, \dots , 2m+q\}=1\), T is a numerical semigroup. Then \(\mathcal {A}(p,q)[m]\subseteq \{S\mid S \text { is a numerical semigroup and }T \subseteq S\}.\) According to Lemma 13 this last set is finite; therefore \(\mathcal {A}(p,q)[m]\) is finite. \(\square \)

In the following result, we prove that if \(\mathcal {A}(p,q)[m]\ne \emptyset \), then \(\mathcal {A}(p,q)[m]\) is in fact a Frobenius pseudo-variety.

Theorem 15

Let \(\{p,q,m\}\subseteq \mathbb {N}\) such that \(p+q\ne 0\), \(p\le m\) and \(2\le m\). Then \(\mathcal {A}(p,q)[m]\) is a Frobenius pseudo-variety. Moreover, \(\Delta (m)=\{0,m,\rightarrow \}\) is its maximum.

Proof

It is clear that \(\Delta (m)\) is the maximum of the set \(\mathcal {A}(p,q)[m]\). If \(\{S,T\}\subseteq \mathcal {A}(p,q)[m],\) then \(S\cap T\) is a numerical semigroup and \({\mathrm m}(S\cap T)=m.\) By Theorem 8 we know that if \(x,y\in S\cap T\), then \(\{x+y-p,\dots , x+y+q\}\subseteq S\) and \(\{x+y-p,\dots , x+y+q\}\subseteq T\). Therefore, \(\{x+y-p,\dots , x+y+q\}\subseteq S\cap T.\) By applying Theorem 8 again we deduce \(S\cap T \in \mathcal {A}(p,q)[m].\)

Let \(S\in \mathcal {A}(p,q)[m]\) such that \(S\ne \Delta (m)\) and \(T=S\cup \{{\mathrm F}(S)\}.\) Then T is a numerical semigroup and \({\mathrm m}(T)=m.\) To complete the proof it will be enough to observe that, by Theorem 8, \(\{{\mathrm F}(S)+s-p, \dots ,{\mathrm F}(S)+s+q \}\subseteq T\) for all \(s\in T\backslash \{0\}.\) As \(s\ge {\mathrm m}(T)=m\ge p,\) \({\mathrm F}(S)+s-p \ge {\mathrm F}(S)\) and so, \(\{{\mathrm F}(S)+s-p, \dots ,{\mathrm F}(S)+s+q \}\subseteq T.\) \(\square \)

A directed 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 directed graph \(G(\mathcal {A}(p,q)[m])\) as follows: \(\mathcal {A}(p,q)[m]\) is its set of vertices and \((S,T)\in \mathcal {A}(p,q)[m]\times \mathcal {A}(p,q)[m]\) is an edge if \(S\cup \{{\mathrm F}(S)\}=T.\) As a consequence of Lemma 11 from [3], we have the following result.

Proposition 16

Let \(\{p,q,m\}\subseteq \mathbb {N}\) such that \(p+q\ne 0\), \(p\le m\) and \(2\le m.\) Then \(G(\mathcal {A}(p,q)[m])\) is a tree with root \(\Delta (m).\)

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

The following result is a consequence of Lemma 12 and Theorem 3 of [3].

Proposition 17

Let \(\{p,q,m\}\subseteq \mathbb {N}\) such that \(p+q\ne 0\), \(p\le m\) and \(2\le m\). Then the set formed by the children of a vertex S in the tree \(G(\mathcal {A}(p,q)[m])\) is

$$\begin{aligned} \left\{ S\backslash \{x\} \mid x\in {\mathrm { msg }}(S), x>{\mathrm F}(S) \text { and } S\backslash \{x\}\in \mathcal {A}(p,q)[m]\right\} . \end{aligned}$$

The following result is Lemma 1.7 from [6].

Lemma 18

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

The following result characterizes when \(S\backslash \{x\}\in \mathcal {A}(p,q)[m]\), being \(S\in \mathcal {A}(p,q)[m].\)

Proposition 19

Let \(\{p,q,m\}\subseteq \mathbb {N}\) such that \(p+q\ne 0\), \(p\le m\) and \(2\le m\). Let \(S\in \mathcal {A}(p,q)[m]\) and \(x\in {\mathrm { msg }}(S)\backslash \{m\}.\) Then \(S\backslash \{x\}\in \mathcal {A}(p,q)[m]\) if and only if \(\left( \{x\}+\{-q,\dots , p\}\right) \cap \left( S\backslash ({\mathrm { msg }}(S\backslash \{x\})\cup \{0,x\})\right) = \emptyset .\)

Proof

(Necessity) If there is \(i\in \{-q,\dots , p\}\) such that \(x+i\in S\backslash ({\mathrm { msg }}(S\backslash \{x\}) \cup \{0,x\})\), then there exists \(s,t\in S\backslash \{0,x\}\) such that \(x+i=s+t .\) Therefore, \(x=s+t-i.\) Hence, \(x=s+t+j\) with \(j\in \{-p,\dots ,q\}\). Consequently, \(\{s+t-p,\dots , s+t+q\} \not \subseteq S\backslash \{x\}.\) Thus, by applying Theorem 8, we obtain that \(S\backslash \{x\}\notin \mathcal {A}(p,q)[m].\)

(Sufficiency) By Lemma 18, we know that \(S\backslash \{x\}\) is a numerical semigroup. It is clear that \({\mathrm m}(S\backslash \{x\})=m.\) To complete the proof, we check that \(S\backslash \{x\}\) is an \(\mathcal {A}(p,q)\)-semigroup. If \(s,t\in S\backslash \{0,x\}\), then by applying \(S\in \mathcal {A}(p,q)[m]\), we obtain \(\{s+t-p,\dots , s+t+q\}\subseteq S.\) Moreover, by hypothesis, we deduce that \(x\notin \{s+t-p,\dots , s+t+q\}.\) So, \(\{s+t-p,\dots , s+t+q\}\subseteq S\backslash \{x\}.\) By applying again Theorem 8, we can assert that \(S\backslash \{x\}\) is an \(\mathcal {A}(p,q)\)-semigroup. \(\square \)

Example 20

Now we are going to recursively build the tree \(G(\mathcal {A}(1,0)[5])\), starting in \(\Delta (5)=\langle 5,6,7,8,9 \rangle .\) Observe that by Propositions 17 and 19, the set formed by the children of S in this tree is

$$\begin{aligned} \left\{ S\backslash \{x\} \mid x\in {\mathrm { msg }}(S\backslash \{5\}), x>{\mathrm F}(S) \text { and } \{x+1\}\cap S \backslash ({\mathrm { msg }}(S\backslash \{x\}) \cup \{0,x\}) \right\} =\emptyset . \end{aligned}$$

Besides, note that the number which appears on the edge in the following figure represents the element that we have removed from the father vertex to obtain its corresponding child. It is clear that this number matches the Frobenius number of the child as well.

figure a

4 The smallest \(\mathcal {A}(p,q)\)-semigroup containing a set

By using Theorem 8, it is easy to check that the finite intersection of \(\mathcal {A}(p,q)\)-semigroups is again an \(\mathcal {A}(p,q)\)-semigroup. This result is not true for infinite intersection. Indeed by applying Theorem 8, we have that \(\{0,p+n,\rightarrow \}\) is an \(\mathcal {A}(p,q)\)-semigroup for all \(n\in \mathbb {N}.\) But \(\bigcap _{n\in \mathbb {N}} \{0,p+n,\rightarrow \}=\{0\}\) is not an \(\mathcal {A}(p,q)\)-semigroup because it is not a numerical semigroup. On the other hand, it is clear that the intersection (finite or infinite) of \(\mathcal {A}(p,q)\)-semigroups is always a submonoid of \((\mathbb {N},+).\)

We say that a submonoid M of \((\mathbb {N},+)\) is an \(\mathcal {A}(p,q)\)-monoid if it can be written as the intersection of \(\mathcal {A}(p,q)\)-semigroups. The following result has an immediate proof.

Lemma 21

The intersection of \(\mathcal {A}(p,q)\)-monoids is an \(\mathcal {A}(p,q)\)-monoid.

If \(X\subseteq \mathbb {N}\) and there is at least one \(\mathcal {A}(p,q)\)-monoid containing X, then we can speak about the \(\mathcal {A}(p,q)\)-monoid generated by X as the intersection of all \(\mathcal {A}(p,q)\)-monoids containing X. It will be denoted by \(\mathcal {A}(p,q)(X).\)

Observe that there is an \(\mathcal {A}(p,q)\)-monoid containing X if and only if there is an \(\mathcal {A}(p,q)\)-semigroup containing X.

The following result has a straightforward proof.

Proposition 22

If \(X \subseteq \mathbb {N}\) and there is at least an \(\mathcal {A}(p,q)\)-semigroup containing X, then \(\mathcal {A}(p,q)(X)\) is the intersection of all \(\mathcal {A}(p,q)\)-semigroups containing X.

Observe that by Theorem 8 we deduce that \(\mathcal {A}(0,0)(X)=\langle X \rangle \). Also, it is clear that \(\mathcal {A}(p,q)(X)=\mathcal {A}(p,q)(X\cup \{0\}).\) Notice as well that if \(1\in X\), then \(\mathcal {A}(p,q)(X)=\mathbb {N}\) if \(p\in \{0,1,2\}\) and if \(p\notin \{0,1,2\},\) then there is no \(\mathcal {A}(p,q)\)-semigroup containing X. In what follows, we will suppose that \(p+q\ne 0\) and \(X\subseteq \mathbb {N}\backslash \{0,1\}.\)

Theorem 23

Let \(p,q \in \mathbb {N}\) such that \(p+q\ne 0\), \(\emptyset \ne X\subseteq \mathbb {N}\backslash \{0,1\}\) and \(m=\min (X).\) Then there is an \(\mathcal {A}(p,q)\)-semigroup containing X if and only if \(p\le m.\) Moreover, in this case \(\mathcal {A}(p,q)(X)\) is the intersection of all elements of \(\mathcal {A}(p,q)[m]\) containing X.

Proof

Let S be an \(\mathcal {A}(p,q)\)-semigroup such that \(X\subseteq S.\) Then \({\mathrm m}(S)\le m.\) By applying Lemma 12, we deduce that \(p\le {\mathrm m}(S)\) or \(p>{\mathrm m}(S)\) and \(S=\mathbb {N}.\) If \(p\le {\mathrm m}(S)\), then \(p\le m.\) If \(p>{\mathrm m}(S)\) and \(S=\mathbb {N}\), then we deduce that \(p=2\). Therefore, \(p=2\le m.\)

Conversely, by applying Theorem 8, we easily deduce that \(\{0,m,\rightarrow \}\) is an \(\mathcal {A}(p,q)\)-semigroup containing X.

Let \(C(X)=\{S\mid S \text { is an } \mathcal {A}(p,q)\text {-semigroup and } X\subseteq S\}.\) Then \(\mathcal {A}(p,q)(X) = \bigcap _{S\in C(X)}S.\) If \(S\in C(X)\), we use the notation \(\overline{S}=\{s\in S\mid s\ge m\}\cup \{0\}.\) It is clear that \(\overline{S}\in \mathcal {A}(p,q)[m].\) Let \(D(X)=\{\overline{S}\mid S\in C(X)\} .\) It is easy to see that \(\mathcal {A}(p,q)(X)= \bigcap _{\overline{S}\in D(X)}\overline{S}.\) Then, we deduce that \(\mathcal {A}(p,q)(X)\) is the intersection of all elements of \(\mathcal {A}(p,q)[m]\) containing X. \(\square \)

Corollary 24

Let \(p,q\in \mathbb {N}\) such that \(p+q\ne 0\), \(\emptyset \ne X\subseteq \mathbb {N}\backslash \{0,1\}\), \(m=\min (X)\) and \(p\le m.\) Then \(\mathcal {A}(p,q)(X)\) is an \(\mathcal {A}(p,q)\)-semigroup.

Proof

By Theorem 23, \({\mathrm A}(p,q)(X)\) is the intersection of all the elements of \(\mathcal {A}(p,q)[m]\) containing X. By Proposition 14, the set \(\mathcal {A}(p,q)[m]\) is finite. Therefore, \({\mathrm A}(p,q)(X)\) is the intersection of a finite number of elements belonging to \(\mathcal {A}(p,q)[m]\). By applying now Theorem 15 we can conclude that \(\mathcal {A}(p,q)(X)\) is an \(\mathcal {A}(p,q)\)-semigroup. \(\square \)

The following algorithm computes \(\mathcal {A}(p,q)(X)\); Corollary 10 validates the operation.

Algorithm 25

Input: X is a nonempty subset of \(\mathbb {N}\backslash \{0,1\}\), \(p,q\in \mathbb {N}\) such that \(p+q\ne 0\) and \(p\le \min (X).\)

Output: The minimal system of generators of \(\mathcal {A}(p,q)(X).\)

  1. (1)

    \(Y={\mathrm { msg }}(\langle X \rangle ).\)

  2. (2)

    \(Z=Y\cup \left( \bigcup _{\{a,b\}\subseteq Y}\{a+b-p,\dots , a+b+q\}\right) .\)

  3. (3)

    If \({\mathrm { msg }}(\langle Z \rangle )=Y\), then return Y.

  4. 4)

    \(Y={\mathrm { msg }}(\langle Z \rangle )\) and go to (2).

Example 26

We are going to compute \(\mathcal {A}(1,0)(\{5\})\) by using Algorithm 25.

  • \(Y=\{5\}\) and \(Z=\{5,9,10\}.\)

  • \({\mathrm { msg }}(\langle Z\rangle )=\{5,9\}\) and \(Y=\{5,9\}.\)

  • \(Z=\{5,9,10,13,14,17,18\}.\)

  • \({\mathrm { msg }}(\langle Z\rangle )=\{5,9,13,17\}\) and \(Y=\{5,9,13,17\}.\)

  • \(Z=\{5,9,10,13,14,17,18,21,22,25,26,29,30,33,34\}.\)

  • \({\mathrm { msg }}(\langle Z\rangle )=\{5,9,13,17,21\}\) and \(Y=\{5,9,13,17,21\}.\)

  • \(Z=\{5,9,10,13,14,17,18,21,22,25,26,29,30,33,34,37,38,41,42\}.\)

  • \({\mathrm { msg }}(\langle Z\rangle )=\{5,9,13,17,21\}\) and \(Y=\{5,9,13,17,21\}.\)

  • Return \(\{5,9,13,17,21\}.\)

We know that \(\Delta (m)=\{0,m,\rightarrow \}\) is the maximum of \(\mathcal {A}(p,q)[m]\). Also it is clear that \(\mathcal {A}(p,q)(\{m\})\) is the minimun of \(\mathcal {A}(p,q)[m].\) Then, we can enounce the following result.

Proposition 27

Let \(\{p,q,m\}\subseteq \mathbb {N}\) such that \(p+q\ne 0\), \(2 \le m\) and \(p\le m.\) Then \(\{{\mathrm g}(S)\mid S\in \mathcal {A}(p,q)[m]\}=\{m-1,\dots , {\mathrm g}(\mathcal {A}(p,q)(\{m\}))\}.\)

Our next goal will be to present an algorithm that computes all the elements of \(\mathcal {A}(p,q)[m]\) with a fixed genus. In order to do so we first need to introduce some concepts and results.

If \(G=(V,E)\) is a tree and \(v\in V\), then the depth of v, denoted by \(\mathrm {d}(v)\), is the length of a unique path that connects v with the root. If \(k\in \mathbb {N}\), we use the notation \({\mathrm N}(G,k)=\{v\in V\mid \mathrm {d}(v)=k\}.\) The height of G is the maximum of the set \(\{k \in \mathbb {N}\mid {\mathrm N}(G,k)\ne \emptyset \}.\)

The following result is easily deduced from Proposition 27.

Proposition 28

Let \(\{p,q,m\}\subseteq \mathbb {N}\) such that \(p+q\ne 0\), \(2\le m\) and \(p\le m\). Then

  1. (1)

    \(G\left( \mathcal {A}(p,q)[m]\right) \) is a tree with height \(\displaystyle {\mathrm g}\left( \mathcal {A}(p,q)(\{m \})\right) -m+1.\)

  2. (2)

    For all \(k\in \{0,\dots , {\mathrm g}\left( \mathcal {A}(p,q)(\{m \})\right) -m\}\) it is verified that \({\mathrm N}(G(\mathcal {A}(p,q) [m]), k+1)= \{S\mid S\text { is a child of some element of } N\left( G\left( \mathcal {A}(p,q)[m]\right) ,k\right) \}.\)

  3. (3)

    \(S\in N\left( G\left( \mathcal {A}(p,q)[m]\right) ,k\right) \) if and only if \(S \in \mathcal {A}(p,q)[m]\) and \({\mathrm g}(S)=m-1+k.\)

Example 29

From Example 26, we know that \(\mathcal {A}(1,0)(\{5 \})=\langle 5,9,13,17,21\rangle .\) Thus, \({\mathrm g}\left( \mathcal {A}(1,0)(\{5 \})\right) =10\). By applying Proposition 28 we have that \(G\left( \mathcal {A}(1,\right. \left. 0)[5]\right) \) is a tree with height \(10-5+1=6.\)

We can now provide the announced algorithm.

Algorithm 30

Input: \(\{p,q,m,g\}\subseteq \mathbb {N}\) such that \(p+q\ne 0\), \(2\le m\), \(p\le m\) and \(m-1\le g \le {\mathrm g}\left( \mathcal {A}(p,q)(\{m \})\right) .\)

Output: The set \(\{S \in \mathcal {A}(p,q)[m] \mid {\mathrm g}(S)=g\}.\)

  1. (1)

    \(i=m-1\) and \(A=\{\langle m,m+1,\dots , 2m-1\rangle \}.\)

  2. (2)

    If \(i=g\) then return A.

  3. (3)

    For each \(S\in A\) compute the set \(B_S\) formed by all the children of S in the tree \(G\left( \mathcal {A}(p,q)[m]\right) .\)

  4. (4)

    \(A=\bigcup _{S\in A}B_S,\) \(i=i+1\) and go to (2).

We finish this section by illustrating how the previous algorithm works with an example.

Example 31

We are going to calculate the set \(\{S\in \mathcal {A}(1,0)[5] \mid {\mathrm g}(S)=7\}.\) For this purpose, we will use Algorithm 30.

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

  • \(B_{\langle 5,6,7,8,9\rangle }=\{\langle 5,7,8,9,11\rangle , \langle 5,6,8,9\rangle , \langle 5,6,7,9\rangle \}.\)

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

  • \(B_{\langle 5,7,8,9,11\rangle }=\{ \langle 5,8,9,11,12\rangle , \langle 5,7,9,11,13\rangle \}\), \(B_{\langle 5,6,8,9\rangle }=\{ \langle 5,6,9,13\rangle \}\) and \(B_{\langle 5,6,7,9\rangle }=\emptyset .\)

  • \(A=\left\{ \langle 5,8,9,11,12\rangle , \langle 5,7,9,11,13\rangle , \langle 5,6,9,13\rangle \right\} ,\) \(i=6.\)

  • \(B_{\langle 5,8,9,11,12\rangle }=\{\langle 5,9,11,12,13\rangle , \langle 5,8,9,12\rangle \}\), \(B_{\langle 5,7,9,11,13\rangle }=B_{\langle 5,6,9,13\rangle }=\emptyset .\)

  • \(A=\{\langle 5,9,11,12,13\rangle , \langle 5,8,9,12\rangle \}\), \(i=7.\)

  • Return \(\{S\in \mathcal {A}(1,0)[5] \mid {\mathrm g}(S)=7\}=\{\langle 5,9,11,12,13\rangle , \langle 5,8,9,12\rangle \}.\)

5 \({{\mathcal {A}}{\mathcal {C}}}(p,q)\)-semigroups

If \(\{a,b,c,d\}\subseteq \mathbb {N}\), then \(S(a,b,c,d)=\{n\in \mathbb {N}\mid ak+c \le n \le bk-d \text { for some }k\in \mathbb {N}\}.\) Our main aim in this section will be to present formulas in terms of a, b, c y d to compute the Frobenius number and the genus of \(S(a,b,c,d)\cup \{0\}.\) Note that \(S(a,b,c,d)\cup \{0\}={\mathrm A}(M(c,d))\cup \{0\}\) for some plane and cyclic monoid M. The next two propositions induce us to assume that \(c+d\ne 0.\)

Proposition 32

Let \(a,b\in \mathbb {N}\). Then

  1. (1)

    If \(b<a\), then \(S(a,b,0,0)=\{0\}.\)

  2. (2)

    If \(a=b\), then \(S(a,b,0,0)=\langle a \rangle .\)

  3. (3)

    If \(a<b\), then \(S(a,b,0,0)=\langle a, a+1,\dots , b \rangle .\)

Proof

Conditions 1) and 2) are trivial and condition 3) is deduced from [2, Corollary 8]. \(\square \)

If \(q\in \mathbb {Q}\), we use the notation \( \lfloor q \rfloor ={\mathrm {max}}\{z\in \mathbb {Z}\mid z \le q\}\) and \(\lceil q \rceil =\min \{z\in \mathbb {Z}\mid q \le z\}.\) The following result is Proposition 9 from [2].

Proposition 33

If \(a,k\in \mathbb {N}\backslash \{0\}\), \(a \ge 2\) and \(S=\langle a, a+1, \dots , a+k\rangle ,\) then

  1. (1)

    \({\mathrm F}(S)=\left( \lfloor \frac{a-2}{k} \rfloor +1 \right) a-1.\)

  2. (2)

    \({\mathrm g}(S)=\frac{1}{2}\left( \lfloor \frac{a-2}{k}\rfloor +1 \right) (a+(a-2) \; {\mathrm { mod }}\; k ).\)

The following result is a consequence of Proposition 3.

Proposition 34

Let \(\{a,b,c,d\}\subseteq \mathbb {N}\) such that \(c+d\ne 0\). Then \(S(a,b,c,d)\cup \{0\}\) is a numerical semigroup if and only if \(a<b.\)

The next two results (Proposition 35 and Lemma 36) show that we can suppose \(c=0\) in order to obtain the proposed goal in this section.

Proposition 35

Let \(\{a,b,c,d\}\subseteq \mathbb {N}\) such that \(c+d\ne 0\) and \(a<b\). Then \(S(a,b,c,d)=S(a,b,0,c+d)+\{c\}.\)

Proof

If \(s\in S(a,b,c,d)\), then there is \(k\in \mathbb {N}\) such that \(ak+c\le s \le bk-d.\) Thus, \(ak\le s-c \le bk-(d+c).\) Therefore, \(s-c\in S(a,b,0,d+c)\) and so \(s\in S(a,b,0,c+d)+\{c\}.\) Conversely, if \(s\in S(a,b,0,c+d)+\{c\} \) then \(s-c \in S(a,b,0,c+d)\) and so there exists \(k\in \mathbb {N}\) such that \(ak\le s-c \le bk-(d+c)\). Hence, \(ak+c\le s \le bk-d\) and consequently, \(s\in S(a,b,c,d).\) \(\square \)

If \(X \subseteq \mathbb {N}\) and \(\mathbb {N}\backslash X\) is finite, then we use the notation \({\mathrm m}(X)=\min (X\backslash \{0\})\), \({\mathrm F}(X)={\mathrm {max}}\{z\in \mathbb {Z}\mid z\notin \mathbb {Z}\}\) and \({\mathrm g}(X)=\sharp (\mathbb {N}\backslash X).\)

Lemma 36

Let S be a numerical semigroup, \(c\in \mathbb {N}\backslash \{0\}\) and \(T=\left( (S\backslash \{0\})+\right. \left. \{c\}\right) \cup \{0\}.\) Then \({\mathrm m}(T)={\mathrm m}(S)+c\), \({\mathrm F}(T)={\mathrm F}(S)+c\) and \({\mathrm g}(T)={\mathrm g}(S)+c.\)

Proof

Clearly, \(\min \left( (S\backslash \{0\})+\{c\} \right) =\min (S\backslash \{0\})+c={\mathrm m}(S)+c.\) As \({\mathrm F}(S)+c\notin T\) and \(\{{\mathrm F}(S)+1+c,\rightarrow \}\subseteq T,\) then \({\mathrm F}(T)={\mathrm F}(S)+c\). It is clear that \(\{h\in \mathbb {N}\backslash T\mid h>c\}=\{x+c\mid x\in \mathbb {N}\backslash S\}.\) Moreover, \(\{1,2,\dots , c\}\subseteq \mathbb {N}\backslash T.\) Therefore, \({\mathrm g}(T)={\mathrm g}(S)+c.\) \(\square \)

If \(\alpha , \beta \in \mathbb {Z}\), then \([\alpha , \beta ]=\{z\in \mathbb {Z}\mid \alpha \le z \le \beta \}.\) Note that if \(\beta < \alpha \), then \([\alpha , \beta ]=\emptyset .\)

Proposition 37

If \(\{a,b,d\}\subseteq \mathbb {N}\), \(a<b\), \(d\ne 0\) and \(t=\lceil \frac{d}{b-a} \rceil \), then \(S(a,b,0,d) =\bigcup _{k=t}^\infty [ka,kb-d].\)

Proof

It is enough to note that if \(k\in \mathbb {N}\), then \(ka\le kb-d\) if and only if \(\lceil \frac{d}{b-a} \rceil \le k.\) \(\square \)

If \(\alpha , \beta \in \mathbb {Z}\), then \(]\alpha , \beta [=\{z\in \mathbb {Z}\mid \alpha< z < \beta \}.\) Note that if \(\beta \le \alpha +1\), then \(]\alpha , \beta [=\emptyset .\)

Theorem 38

If \(\{a,b,d\}\subseteq \mathbb {N}\), \(a<b\), \(d\ne 0\), \(t=\lceil \frac{d}{b-a}\rceil \) and \(r=\lceil \frac{a+d-1}{b-a} \rceil \), then

  1. 1)

    \({\mathrm F}\left( S(a,b,0,d)\cup \{0\} \right) =ra-1.\)

  2. 2)

    \({\mathrm g}\left( S(a,b,0,d)\cup \{0\} \right) =(ta-1)+(d+a-1)(r-t)-\frac{1}{2}(b-a)(r+t-1)(r-t).\)

Proof

By Proposition 37, we know that \(\mathbb {N}\backslash \left( S(a,b,0,d)\cup \{0\} \right) =]0,ta[\,\cup \, ]tb-d,(t+1)a[ \,\cup \, ](t+1)b-d, (t+2)a[\,\cup \dots \) Observe that the interval \(]kb-d, (k+1)a[ =\emptyset \) if and only if \(k(b-a)\ge a+d-1.\)

Therefore, \({\mathrm F}\left( S(a,b,0,d)\cup \{0\} \right) =ra-1\) and \({\mathrm g}\left( S(a,b,0,d)\cup \{0\}\right) =(ta-1)\) \(+((t+1)a-1-tb+d)+((t+2)a-1-(t+1)b+d)\) \(+\dots +(ra-1-(r-1)b+d)=\)\((ta-1)+(d-1)(r-t)+\frac{1}{2}a(r+t+1)(r-t)- \frac{1}{2}b(r+t-1)(r-t)=\)\((ta-1)+(d+a-1)(r-t)-\frac{1}{2}(b-a)(r+t-1)(r-t).\) \(\square \)

As a consequence of Theorem 38, Proposition 35 and Lemma 36, we have the following result.

Corollary 39

If \(\{a,b,c,d\}\subseteq \mathbb {N}\), \(a<b\) and \(c+d\ne 0\), then

  1. (1)

    \({\mathrm m}\left( S(a,b,c,d)\cup \{0\} \right) =\lceil \frac{c+d}{b-a}\rceil a+c.\)

  2. (2)

    \({\mathrm F}\left( S(a,b,c,d)\cup \{0\} \right) =\lceil \frac{a+c+d-1}{b-a}\rceil a+c-1.\)

  3. (3)

    \({\mathrm g}\left( S(a,b,c,d)\cup \{0\} \right) =c+(ta-1)+(c+d+a-1)(r-t)-\frac{1}{2}(b-a)(r+t-1)(r-t)\) where \(t=\lceil \frac{c+d}{b-a}\rceil \) and \(r=\lceil \frac{a+c+d-1}{b-a} \rceil .\)

Example 40

Let \(S(2,5,1,7)=\{7,\rightarrow \}\), then

  1. 1)

    \({\mathrm m}\left( S(2,5,1,7)\cup \{0\} \right) = \lceil \frac{8}{3}\rceil 2+1=7,\)

  2. 2)

    \({\mathrm F}\left( (S(2,5,1,7)\cup \{0\} \right) =\lceil \frac{9}{3}\rceil 2+1-1=6\) and

  3. 3)

    \({\mathrm g}\left( (S(2,5,1,7)\cup \{0\} \right) =1+(2t-1)+9(r-t)-\frac{1}{2}3(r+t-1)(r-t)\), where \(t=\lceil \frac{8}{3}\rceil =3\) and \(r=\lceil \frac{9}{3}\rceil =3\), so \({\mathrm g}\left( (S(2,5,1,7)\cup \{0\} \right) =1+(6-1)+0+0=6.\)