1 Introduction

A numerical semigroup is a subset of natural numbers that contains 0, is closed under addition and has a finite complement with respect to the natural numbers. The numbers that are in the complement of a numerical semigroup S are called its gaps. The set of gaps is denoted by Gap(S). The number of gaps is called the genus, it is denoted by g(S). The largest gap is called the Frobenius number, it is denoted by f(S). We will assume \(S\ne {\mathbb {N}}\) throughout the paper, so the Frobenius number is well defined. The smallest non-zero element of S is called its multiplicity and is denoted by m(S).

For a given f there are only finitely many numerical semigroups with Frobenius number f (at most \(2^{f-1}\)). Denote this number by N(f). Backelin in [1] proves the following theorem, here \({\overline{f}}=\left\lfloor \frac{f-1}{2}\right\rfloor \).

Theorem 1

([1], Proposition 1) The following limits exist and are positive (we denote the values by \(c_1\), \(c_2\))

$$\begin{aligned} \lim _{f\text { odd}} \frac{N(f)}{2^{{\overline{f}}}}= & {} c_1 \\ \lim _{f\text { even}} \frac{N(f)}{2^{{\overline{f}}}}= & {} c_2. \end{aligned}$$

In [2], the authors study the set of numerical semigroups with Frobenius number f and give an algorithm to compute it. In [3], the authors do the same for the set of numerical semigroups with a given Frobenius number and multiplicity. Both papers use a similar strategy of partitioning the respective sets into equivalence classes, such that numerical semigroups belong to the same class if they have the same

$$\begin{aligned} X(S)=\left\{ x\in S\mid 1\le x< \frac{f}{2}\right\} . \end{aligned}$$

In this paper we will study how these equivalence classes change when we vary f. We will thus give a detailed description of numerical semigroups for which \(f(S)<3m(S)\). It will be shown that when counted by Frobenius number, almost all numerical semigroups satisfy this property. We will use this to analyse the distribution of genus among numerical semigroups with Frobenius number f. In Sect. 6 we show that

Theorem 2

Among numerical semigroups with Frobenius number f the average value of genus is \(\frac{3f}{4}+o(f)\).

In fact most numerical semigroups have genus close to this value, in Sect. 6 we also show that

Theorem 3

For any \(\epsilon >0\),

$$\begin{aligned} \lim _{f\rightarrow \infty } \frac{\#\{S\mid f(S)=f, |g(S)-\frac{3f}{4}|<f^{\frac{1}{2}+\epsilon }\}}{N(f)}=1. \end{aligned}$$

We obtain the limiting distribution of genus among numerical semigroups with Frobenius number f in Theorem 14. It is of the form of a Gaussian times a power series.

Let \(n_g\) be the number of numerical semigroups of genus g. Bras-Amorós conjectured in [4] that the sequence \(n_g\) is monotonic. However when we count by Frobenius number, it is known that N(f) is not monotonic. For example \(N(5)=5, N(6)=4\). However since N(f) behaves differently for even and odd f, it makes sense to investigate whether the two sub sequences for even and odd f are monotonic. Indeed they must be eventually monotonic by Theorem 1. And we prove in Sect. 5

Theorem 4

For every positive integer f, \(N(f)<N(f+2)\).

It is well known that each numerical semigroup has a unique minimal set of generators; the number of generators is called the embedding dimension and is denoted by e(S). It is known that \(e(S)\le m(S)\). If equality holds for a numerical semigroup S then it is said to be of max embedding dimension. Let MED(f) be the number of max embedding dimension numerical semigroups with Frobenius number f. In Sect. 8 we prove

Theorem 5

There are positive constants c, \(c'\) such that for any f

$$\begin{aligned} c2^{\frac{1}{3} f}<MED(f)<c'2^{0.41385f}. \end{aligned}$$

We also make a conjecture about the growth of MED(f).

Conjecture 1

The following limit exists

$$\begin{aligned} \lim _{f\rightarrow \infty }\frac{\text {log}_{2}(MED(f))}{f}. \end{aligned}$$

We can also look at the set of numerical semigroups of a fixed genus g. The following is proved in [9], here \(\phi \) is the golden ratio.

Theorem 6

([9], Theorem 1) The following limit exists

$$\begin{aligned} \lim _{g\rightarrow \infty }\frac{n_g}{\phi ^{g}}. \end{aligned}$$

Kaplan and Ye [6] studied the set of numerical semigroups with a fixed genus. They proved that almost all of them have Frobenius number close to twice the multiplicity.

Theorem 7

([6], Theorem 4) Let \(\epsilon >0\) then

$$\begin{aligned} \lim _{g\rightarrow \infty }\frac{\#\{S|g(S)=g, |F(S)-2m(S)|>\epsilon g\}}{n_g}=0. \end{aligned}$$

We make this result stronger and prove in Sect. 9

Theorem 8

For any \(\epsilon >0\) there is an N such that for every g

$$\begin{aligned} \frac{\#\{S|g(S)=g, |F(S)-2m(S)|>N\}}{n_g}<\epsilon . \end{aligned}$$

2 Depth of a numerical semigroup

Notation: Throughout this paper, \({\overline{f}}= \left\lfloor \frac{f-1}{2}\right\rfloor \). Also we will use intervals \([a,b]=\{n\in {\mathbb {Z}}\mid a\le n\le b\}\), \((a,b)=\{n\in {\mathbb {Z}}\mid a< n< b\}\).

The depth of a numerical semigroup S is \(q(S)=\left\lceil \frac{f(S)+1}{m(S)}\right\rceil \). In particular, \(q=1\) only for the numerical semigroup \(\{0,f+1\rightarrow \}\). Here, the arrow indicates that all natural numbers after \(f+1\) are in the semigroup. Moreover, \(q=2\) when \(\frac{f}{2}<m<f\); \(q=3\) when \(\frac{f}{3}<m\le {\overline{f}}\) and \(q\ge 4\) when \(m<\frac{f}{3}\). Most numerical semigroups have depth 2 or 3 when counted by Frobenius number (Corollary 1), we will primarily be interested in these two families.

Theorem 9

([1], Proposition 2) For any \(\epsilon >0\), there is a M such that for all f

$$\begin{aligned} \frac{\#\{S\mid f(S)=f,|m(S)-\frac{f}{2}|>M\}}{2^{{\overline{f}}}} <\epsilon . \end{aligned}$$

Corollary 1

$$\begin{aligned} \lim _{f\rightarrow \infty } \frac{\#\{S\mid f(S)=f, q(S)>3\}}{2^{{\overline{f}}}} =0. \end{aligned}$$

Proof

Note that \(q(S)\ge 4\) means \(\frac{f(S)+1}{m(S)}>3\), i.e. \(f(S)\ge 3m(S)\). This implies that

$$\begin{aligned} \left| m(S)-\frac{f(S)}{2}\right| \ge \frac{f(S)}{6}. \end{aligned}$$

Now for a give \(\epsilon >0\), consider the M given by Theorem 9. For \(f>6M\) we have

$$\begin{aligned} \frac{\#\{S\mid f(S)=f, q(S)>3\}}{2^{{\overline{f}}}}\le \frac{\#\{S\mid f(S)=f,|m(S)-\frac{f}{2}|>M\}}{2^{{\overline{f}}}} <\epsilon . \end{aligned}$$

Therefore the limit is 0.\(\square \)

We denote by n(S) the size of \(S\cap [1,f(S)]\). Therefore, \(n(S)+g(S)=f(S)\). Note that for any x in \([1,f-1]\), at least one of \(x,f-x\) must be a gap of S and hence \(g(S)\ge \left\lceil \frac{f+1}{2} \right\rceil \) i.e. \(n(S)\le {\overline{f}}\). Among numerical semigroups with Frobenius number f, studying the distribution of g(S) is equivalent to studying the distribution of n(S). We shall be using n(S) as it makes the expressions simpler. Denote by N(fn) the number of numerical semigroups with Frobenius number f and \(n(S)=n\).

We now enumerate the numerical semigroups of depth 2.

Theorem 10

There are \(2^{{\overline{f}}}-1\) numerical semigroups of depth 2 and Frobenius number f. Moreover, there are \({{\overline{f}}}\atopwithdelims (){n}\) numerical semigroups of depth 2, Frobenius number f and \(n(S)=n\).

Proof

The first part follows from the second as we add up \({{\overline{f}}}\atopwithdelims (){n}\) for \(1\le n\le {\overline{f}}\). For the second part fix a n, pick a subset T of \([f-{\overline{f}},f-1]\) of size n, this can be done in \({{\overline{f}}}\atopwithdelims (){n}\) ways. Once we have such a T, the sum of any two numbers in T is larger than f. Therefore \(\{0\}\cup T\cup \{f+1\rightarrow \}\) is a numerical semigroup. It is clear that all numerical semigroups of depth 2 are achieved this way. \(\square \)

3 Partition of the set of numerical semigroups

In this section we will describe a partition of the collection of all numerical semigroups. We will then study the equivalence classes of the partition in the next section.

Definition 1

Given a numerical semigroup S with Frobenius number f, let

$$\begin{aligned} Y(S)=\{t\mid {\overline{f}} -t\in S,\; 0\le t<{\overline{f}}\}. \end{aligned}$$

We define an equivalence relation on the set of all numerical semigroups. Numerical semigroups S and \(S'\) are related if \(Y(S)=Y(S')\). If S and \(S'\) have the same Frobenius number then \(Y(S)=Y(S')\) if and only if \(X(S)=X(S')\). Therefore, if we restrict ourselves to numerical semigroups of a fixed Frobenius number then we get the partition introduced in [2] and if we restrict to numerical semigroups with a fixed Frobenius number and multiplicity then we get the partition introduced in [3].

Definition 2

Given a finite subset \(Y\subseteq {\mathbb {N}}\), denote by N(Yf) the number of numerical semigroups with Frobenius number f and \(Y(S)=Y\).

It is clear that \(Y(S)=\emptyset \) if and only if S has depth 1 or 2. Therefore

$$\begin{aligned} N(\emptyset ,f)=1+(2^{{\overline{f}}}-1)=2^{{\overline{f}}}. \end{aligned}$$

Next, if S has depth at least 3, i.e. if \(Y(S)\ne \emptyset \), then we will denote by l(S) the largest number in Y(S). The multiplicity of S is \(\overline{f(S)}-l(S)\). Therefore, S has depth 3 when \(f(S)>6l(S)+6\). Now, we state another version of Theorem 9.

Theorem 11

For every \(\epsilon >0\) there exists a L such that for every f

$$\begin{aligned} \frac{N(\emptyset ,f)+\sum _{Y:\max (Y)\le L} N(Y,f)}{N(f)}>1-\epsilon . \end{aligned}$$

Proof

For a given \(\epsilon >0\), consider the M given by Theorem 9. Take \(L=M\). Firstly note that \(\sum _{Y\subseteq {\mathbb {N}}} N(Y,f)=N(f)\), so

$$\begin{aligned} 1-\frac{N(\emptyset ,f)+\sum _{Y:\max (Y)\le L} N(Y,f)}{N(f)}=\frac{\sum _{Y:\max (Y)> L} N(Y,f)}{N(f)} \end{aligned}$$

Suppose S is a numerical semigroup with \(f(S)=f\), \(Y(S)\ne \emptyset \) and \(l(S)=\max (Y(S))> L\). The multiplicity of S is \(m(S)={\overline{f}}-l(S)<{\overline{f}}-L\). Therefore

$$\begin{aligned} \left| m(S)-\frac{f}{2}\right| \ge {\overline{f}}-m(S)>L. \end{aligned}$$

By Theorem 9, we see that

$$\begin{aligned} \frac{\sum _{Y:\max (Y)> L} N(Y,f)}{N(f)}\le \frac{\#\{S\mid f(S)=f, |m-\frac{f}{2}|>M\}}{N(f)}<\epsilon . \square \end{aligned}$$

In order to study the distribution n(S), we pick a large L, restrict ourselves to numerical semigroups that have \(Y(S)=\emptyset \) or \(l(S)\le L\). For \(f>6L+6\), all such numerical semigroups will be of depth \(\le 3\). We will study the limit of the distribution of n(S) among these semigroups as f goes to infinity. We already know how n(S) behaves among numerical semigroups of depth 2, in the next section we will study the ones with depth 3.

4 Numerical semigroups of depth 3

In this section we will describe numerical semigroups of depth 3. For \(Y\ne \emptyset \) we will study the equivalence class of numerical semigroups with \(Y(S)=Y\). However we need to further partition these equivalence classes first.

Definition 3

For a numerical semigroup S of depth 3 we define

$$\begin{aligned} Z(S)= \left\{ x-f(S)+\overline{f(S)} \mid x\in S, \frac{f(S)}{2} <x\le f(S)-m(S) \right\} . \end{aligned}$$

Note that all numbers in Z(S) are non-negative and the largest number in Z(S) is at most

$$\begin{aligned} \overline{f(S)}- m(S) =\overline{f(S)}-(\overline{f(S)}-l(S)) =l(S). \end{aligned}$$

Moreover \(Y(S)\cap Z(S)=\emptyset \), this because if \(x\in Y(S)\cap Z(S)\) then \(\overline{f(S)}-x\in S\) and \(x+f(S)-\overline{f(S)}\in S\). Adding the two leads to \(f(S)\in S\), which is impossible.

Definition 4

If Y is a finite non-empty subset of natural numbers, \(f>6\max (Y)+6\) and Z is a subset \([0,\max (Y)]\) such that \(Z\cap Y=\emptyset \) then we define N(YZf) to be the number of numerical semigroups S with Frobenius number f, \(Y(S)=Y\) and \(Z(S)=Z\). Also let N(YZfn) be the number of numerical semigroups with additional condition that \(n(S)=n\).

In this section we will classify the numerical semigroups with a given Y, Z and \(f>6\max (Y)+6\).

Example 1

Let us first consider an example, say \(Y=\{2\}\), \(Z=\{0\}\) and \(f=30\) (so \({\overline{f}}=14\)). Y tells us that \(S\cap [1,14]=\{12\}\), Z tells that \(S\cap [16,18]=\{16\}\). This still leaves the elements in the interval [19, 29] to be decided. However, note that \(12\in S\) forces \(12+12=24\in S\), we will show that such forced elements correspond to the set \(2Y=\{y_1+y_2\mid y_1,y_2\in Y\}\). Another forced element is \(12+16=28\), we will show that such forced elements correspond to \(W_1(Y,Z)\) or \(W_2(Y,Z)\) (defined below) depending on the parity of f. It can be seen that the remaining numbers in \([19,29]\setminus \{24,28\}\) can be independently included or excluded from S. Therefore, there are \(2^{9}\) such numerical semigroups.

Given sets \(A,B\subseteq {\mathbb {Z}}\) and \(n\in {\mathbb {Z}}\) we have the following notation

$$\begin{aligned} A+B=\{a+b\mid a\in A, b\in B\}. \end{aligned}$$

Also let \(-B=\{-b\mid b\in B\}\) and \(A-B=A+(-B)\). Finally let \(2A=A+A\) and \(A+n=A+\{n\}\).

Definition 5

Given YZ we define

$$\begin{aligned} W_1(Y,Z)&=(Y-Z-1)\cap [0,\infty ),\\ W_2(Y,Z)&=(Y-Z-2)\cap [-1,\infty ). \end{aligned}$$

Lemma 1

If S is a numerical semigroup of depth 3 with \(Y(S)=Y\), \(Z(S)=Z\), \(f(S)=f\) and \(l(S)=l\) then \(S\cap \left[ 1,{\overline{f}}\right] ={\overline{f}}-Y\) and

$$\begin{aligned} S\cap \left[ f-{\overline{f}}, f-{\overline{f}} +l \right] = Z+f-{\overline{f}}. \end{aligned}$$

Moreover if f is odd then

$$\begin{aligned} S\cap \left[ f-2l-1, f-1 \right] \supseteq (f-1)-(2Y\cup W_1(Y,Z)). \end{aligned}$$

And if f is even then

$$\begin{aligned} S\cap \left[ f-2l-2, f-1 \right] \supseteq (f-2)-(2Y\cup W_2(Y,Z)). \end{aligned}$$

Proof

The first part is just the definition of Y. The second follows from the definition of Z and the fact that \(m={\overline{f}}-l\). We now prove the third one for odd f. We have \(X={\overline{f}}-Y\) and hence \(2X=(f-1)-2Y\). Now, \(X\subseteq S\) implies \(2X\subseteq S\), also \((f-1)-2Y\subseteq [f-1-2l,f-1]\). Finally, a general element of \(W_1(Y,Z)\) is of the form \(y-z-1\) for \(y\in Y\) and \(z\in Z\), they must satisfy \(y\ge z+1\). Now, \((f-1)-(y-z-1)=(z+f-{\overline{f}})+({\overline{f}}-y)\in S\). Also \(0\le y-z-1\le l-1\), therefore \((f-1)-(y-z-1)\subseteq [f-l,f-1]\).

For even f we have \(X={\overline{f}}-Y\), which implies \(2X=(f-2)-2Y\), also \((f-2)-2Y\subseteq [f-2-2l,f-2]\). Next, a general element of \(W_2(Y,Z)\) is of the form \(y-z-2\) for \(y\in Y\) and \(z\in Z\), they must satisfy \(y\ge z+1\). Now, \((f-2)-(y-z-2)=(z+f-{\overline{f}})+({\overline{f}}-y)\in S\). Also \(-1\le y-z-2\le l-2\), therefore \((f-2)-(y-z-2)\subseteq [f-l,f-1]\).\(\square \)

Lemma 2

Suppose we are given a finite, non-empty set \(Y\subseteq {\mathbb {N}}\) and an odd integer f such that \(f>6\max (Y)+6\). Suppose we are also given a subset \(Z\subseteq [0,\max (Y)]\) such that \(Z\cap Y=\emptyset \).

Pick T to be a subset of

$$\begin{aligned}{}[f-{\overline{f}}+\max (Y)+1, f-1]\setminus \Big ( (f-1)-(2Y\cup W_1(Y,Z))\Big ). \end{aligned}$$

Construct S as

$$\begin{aligned} S=\{0\}\cup ({\overline{f}}-Y)\cup (Z+f-{\overline{f}})\cup T \cup \big ((f-1)-(2Y\cup W_1(Y,Z))\big ) \cup \{f+1\rightarrow \}. \end{aligned}$$

Then S is a numerical semigroup.

Proof

We need to prove that S is closed under addition. Consider \(x,y\in S\), assume that \(x+y\le f\) and \(x,y\ne 0\) because otherwise we have nothing to prove. At least one of xy must be less than \(\frac{f}{2}\), say x, then \(x\in {\overline{f}}-Y\).

Case 1: \(y<\frac{f}{2}\) then then y is in \({\overline{f}}-Y\) as well. Therefore,

$$\begin{aligned} x+y\in 2({\overline{f}}-Y)= (f-1)-2Y\subseteq S. \end{aligned}$$

Case 2: \(y>\frac{f}{2}\). Then

$$\begin{aligned} y\le f-x\le f-({\overline{f}}-\max (Y))= \max (Y)+f-{\overline{f}}. \end{aligned}$$

This means that \(y\in Z+f-{\overline{f}}\). Now, \(y-f+{\overline{f}}\in Z\), \({\overline{f}}-x\in Y\) and \(({\overline{f}}-x)-(y-f+{\overline{f}})-1=f-1-x-y\in (Y-Z-1)\). We know that \(x+y\le f\). If \(x+y=f\) then \(({\overline{f}}-x)=(y-f+{\overline{f}})\) which would contradict the fact that \(Y\cap Z=\emptyset \). Therefore \(x+y\le f-1\), which means \(f-1-x-y\in W_1(Y,Z)\). It also implies that \(x+y=(f-1)-(f-1-x-y)\in S\).\(\square \)

Lemma 3

Suppose we are given a finite, non-empty \(Y\subseteq {\mathbb {N}}\) and an even integer f such that \(f>6\max (Y)+6\). Suppose we are also given a subset \(Z\subseteq [0,\max (Y)]\) such that \(Z\cap Y=\emptyset \).

Pick T to be a subset of

$$\begin{aligned}{}[f-{\overline{f}}+\max (Y)+1, f-1]\setminus \Big ( (f-2)-(2Y\cup W_2(Y,Z))\Big ). \end{aligned}$$

Construct S as

$$\begin{aligned} S=\{0\}\cup ({\overline{f}}-Y)\cup (Z+f-{\overline{f}})\cup T \cup \big ((f-2)-(2Y\cup W_2(Y,Z))\big ) \cup \{f+1\rightarrow \}. \end{aligned}$$

Then S is a numerical semigroup.

Proof

The proof is similar to Lemma 2. Consider \(x,y\in S\), assume that \(x+y\le f\) and \(x,y\ne 0\). We will show that \(x+y\in S\). If \(x\le \frac{f}{2}\), then \(x\in {\overline{f}}-Y\).

Case 1: \(y\le \frac{f}{2}\) then then y is in \({\overline{f}}-Y\) as well. Therefore,

$$\begin{aligned} x+y\in 2({\overline{f}}-Y)= (f-2)-2Y\subseteq S. \end{aligned}$$

Case 2: \(y>\frac{f}{2}\). Then

$$\begin{aligned} y\le f-x\le f-({\overline{f}}-\max (Y))= \max (Y)+f-{\overline{f}}. \end{aligned}$$

This means that \(y\in Z+f-{\overline{f}}\). Now, \(y-f+{\overline{f}}\in Z\), \({\overline{f}}-x\in Y\) and

$$\begin{aligned} ({\overline{f}}-x)-(y-f+{\overline{f}})-2=f-2-x-y\in (Y-Z-2). \end{aligned}$$

We know that \(x+y\le f\). If \(x+y=f\) then \(({\overline{f}}-x)=(y-f+{\overline{f}})\) which would contradict the fact that \(Y\cap Z=\emptyset \). Therefore \(x+y\le f-1\), which means \(f-2-x-y\in W_1(Y,Z)\). It also implies that \(x+y=(f-2)-(f-2-x-y)\in S\).

\(\square \)

We have characterised the depth 3 numerical semigroups with a given fYZ. We are now going to count them. We make the following notations \(|2Y\cup W_1(Y,Z)|=\alpha \), \(|2Y\cup W_2(Y,Z)|=\alpha '\), \(\max (Y)+1-|Y\cup Z|=\beta \). These are all functions of YZ of course.

Theorem 12

If Y is a finite, non-empty subset of natural numbers, \(f>6\max (Y)+6\) and Z is a subset \([0,\max (Y)]\) such that \(Z\cap Y=\emptyset \) and f is odd then

$$\begin{aligned} N(Y,Z,f)= & {} 2^{{\overline{f}}-\max (Y)-1-\alpha } \\ N(Y,Z,f,n)= & {} {{\overline{f}}-\max (Y)-1-\alpha \atopwithdelims ()n-\max (Y)-1-\alpha +\beta }. \end{aligned}$$

If f is even, then replace \(\alpha \) with \(\alpha '\).

Proof

This follows from Lemmas 1, 2 and 3.\(\square \)

Example 2

In Example 1, we looked at numerical semigroups with \(Y=\{2\}\), \(Z=\{0\}\) and \(f=30\) (so \({\overline{f}}=14\)). We saw that there are \(2^9\) such numerical semigroups. They all satisfy \(S\cap ([1,18]\cup \{24,28\})=\{12,16,24,28\}\) and numbers in \([19,29]\setminus \{24,28\}\) can be independently included or excluded in S. If x numbers from this set are chosen in S, then \(n(S)=4+x\). Therefore the number of numerical semigroups with \(Y=\{2\}\), \(Z=\{0\}\), \(f=30\) and \(n(S)=n\) is \({9}\atopwithdelims (){n-4}\). Note that \({\overline{f}}-\max (Y)-1-\alpha '=9\), \(\max (Y)+1+\alpha '-\beta =4\).

5 Monotonicity of N(f)

Denote by \(N_{mul}(m,f)\) the number of numerical semigroups with Frobenius number f and multiplicity m. We know that \(N(\emptyset ,f+2)-N(\emptyset ,f)=2^{{\overline{f}}}\). Also for \(\frac{f}{3}<m<\frac{f}{2}\), by using Theorem 12 we get \(N_{mul}(m,f)<N_{mul}(m+1,f+2)\), since

$$\begin{aligned} N_{mul}(m,f)= & {} \sum _{\max (Y)={\overline{f}}-m} \sum _{Z} 2^{m-1-*} <\sum _{\max (Y)=\overline{(f+2)}-(m+1)} \sum _{Z} 2^{m-*} \\= & {} N_{mul}(m+1,f+2). \end{aligned}$$

Here \(*=\alpha \) if f is odd and \(*=\alpha '\) if f is even.

Lemma 4

([1], Equation 18) For \(m<\frac{f}{2}\)

$$\begin{aligned} N_{mul}(m,f)\le \frac{1}{4}2^{{\overline{f}}}\left( \frac{11}{12}\right) ^{{\overline{f}}-m}. \end{aligned}$$

Corollary 2

$$\begin{aligned} \sum _{m<\frac{f}{3}}N_{mul}(m,f)\le 3\left( \frac{11}{12}\right) ^{\frac{f}{6}-\frac{1}{2}}2^{{\overline{f}}}. \end{aligned}$$

Theorem

4 For every positive integer f, \(N(f)<N(f+2)\).

Proof

In [5] the value of N(f) are listed for \(f\le 39\), this can thus be checked manually for \(f\le 37\). We now assume \(f>37\). We have computed

$$\begin{aligned}&\sum _{Y:\max (Y)\le 5}\sum _{Z\subseteq [0,\max (Y)-1],Z\cap Y = \emptyset } 2^{-\max (Y)-1-\alpha (Y,Z)}>1.08 \\&\sum _{Y:\max (Y)\le 5}\sum _{Z\subseteq [0,\max (Y)-1],Z\cap Y = \emptyset } 2^{-\max (Y)-1-\alpha '(Y,Z)}>1.06. \end{aligned}$$

This computation was done with the help of a program that manually computed the sums for each YZ. It follows that

$$\begin{aligned} \sum _{m>\frac{f}{3}}N_{mul}(m+1,f+2)-N_{mul}(m,f) > 2^{{\overline{f}}}(1+1.06). \end{aligned}$$

Moreover by Corollary 2, we have

$$\begin{aligned} \sum _{m<\frac{f}{3}}N_{mul}(m,f)\le 3\left( \frac{11}{12}\right) ^{\frac{37}{6}-\frac{1}{2}}2^{{\overline{f}}} <1.9\times 2^{{\overline{f}}}. \end{aligned}$$

It follows that \(N(f)<N(f+2)\).\(\square \)

6 Expectation of genus given Frobenius number

In this section we will use Theorems 10 and 12 to find the expected value of genus among numerical semigroups of fixed Frobenius number. We will thus prove Theorems 2 and 3. Before that we give expressions for the constants \(c_1,c_2\) from Theorem 1.

Theorem 13

The constants \(c_1,c_2\) of Theorem 1 are given by

$$\begin{aligned} c_1= & {} 1+\sum _{Y\ne \emptyset , |Y|<\infty } \sum _{Z\subseteq [0,\max (Y)]\setminus Y} 2^{-\max (Y)-1-\alpha }, \\ c_2= & {} 1+\sum _{Y\ne \emptyset , |Y|<\infty } \sum _{Z\subseteq [0,\max (Y)]\setminus Y} 2^{-\max (Y)-1-\alpha '}. \end{aligned}$$

Proof

Let \(\epsilon >0\), consider the L given by Theorem 11. So for each f

$$\begin{aligned} (1-\epsilon ) \frac{N(f)}{2^{{\overline{f}}}} \le \frac{N(\emptyset ,f) +\sum _{Y:\max (Y)\le L} N(Y,f)}{2^{{\overline{f}}}} \le \frac{N(f)}{2^{{\overline{f}}}}. \end{aligned}$$

Now for odd \(f>6L+6\)

$$\begin{aligned} \frac{N(\emptyset ,f)+\sum _{Y:\max (Y)\le L} N(Y,f)}{2^{{\overline{f}}}} =1+\sum _{Y\ne \emptyset , \max (Y)\le L} \sum _{Z\subseteq [0,\max (Y)]\setminus Y} 2^{-\max (Y)-1-\alpha }. \end{aligned}$$

By letting f tend to infinity we get

$$\begin{aligned} (1-\epsilon )c_1 \le 1+\sum _{Y\ne \emptyset , \max (Y)\le L} \sum _{Z\subseteq [0,\max (Y)]\setminus Y} 2^{-\max (Y)-1-\alpha } \le c_1. \end{aligned}$$

The second inequality is true for any L, so the sum

$$\begin{aligned} 1+\sum _{Y\ne \emptyset , \max (Y)<\infty } \sum _{Z\subseteq [0,\max (Y)]\setminus Y} 2^{-\max (Y)-1-\alpha } \end{aligned}$$

converges and the value is at most \(c_1\). On the other hand we can pick \(\epsilon \) to be arbitrarily small, so the sum is exactly \(c_1\). The equation for \(c_2\) is obtained similarly by considering even f.\(\square \)

We now compute the average value of genus, remember that \(g(S)=f(S)-n(S)\).

Theorem

2 Among numerical semigroups with Frobenius number f the average value of genus is \(\frac{3f}{4}+o(f)\).

Proof

Pick \(\epsilon >0\), consider the L given by Theorem 11. Suppose \(f>6L+6\). Consider a Y which is a non-empty subset of [0, L], and Z a subset \([0,\max (Y)]\setminus Y\). Let \(*=\alpha \) if f is odd and \(*=\alpha '\) if f is even. From Theorem 12 we know that numerical semigroups with \(f(S)=f\), \(Y(S)=Y\), \(Z(S)=Z\) and \(n(S)=n\) are obtained by choosing \(n-\max (Y)-1-*+\beta \) numbers out of \({\overline{f}}-\max (Y)-1-*\) numbers. We compute expectations among numerical semigroups with fixed fYZ:

$$\begin{aligned} \frac{{\overline{f}}-\max (Y)-1-*}{2} ={\mathbb {E}}(n-\max (Y)-1-*+\beta )={\mathbb {E}}(n)-\max (Y)-1-*+\beta . \end{aligned}$$

This means that the average value of n(S) among numerical semigroups with \(f(S)=f\), \(Y(S)=Y\), \(Z(S)=Z\) is

$$\begin{aligned} {\mathbb {E}}(n)=\frac{{\overline{f}}}{2}+\frac{\max (Y)+1+*}{2}-\beta =\frac{f}{4}+O_L(1). \end{aligned}$$

By Theorem 10 the average of n(S) among numerical semigroups with \(f(S)=f\), \(Y(S)=\emptyset \) is \(\frac{{\overline{f}}}{2}\).

It follows that the difference between the average of n(S) and \(\frac{f}{4}\) is at most \(2\epsilon f+O_L(1)\). Since \(\epsilon \) was arbitrary we get that the average value of n(S) among numerical semigroups with Frobenius number f is \(\frac{f}{4}+o(f)\). This means the average value of genus is \(\frac{3f}{4}+o(f)\).\(\square \)

Next we will show that for almost all numerical semigroups the genus is close to this value.

Theorem

3 For any \(\epsilon >0\),

$$\begin{aligned} \lim _{f\rightarrow \infty } \frac{\#\{S\mid f(S)=f, |g(S)-\frac{3f}{4}|<f^{\frac{1}{2}+\epsilon }\}}{N(f)}=1. \end{aligned}$$

Proof

We need the following property of binomial coefficients: for a fixed large M, the distribution \(\frac{1}{2^M} {M\atopwithdelims ()n}\) is approximately the Gaussian distribution with mean \(\frac{M}{2}\) and standard deviation \(\sigma _M=\frac{\sqrt{M}}{2}\) by the De Moivre–Laplace theorem. And since \(\frac{M^{\frac{1}{2}+\epsilon }}{\sigma _M}\) goes to infinity as M goes to infinity we get

$$\begin{aligned} \lim _{M\rightarrow \infty }\frac{1}{2^M}\sum _{n:|n-\frac{M}{2}|<M^{\frac{1}{2}+\epsilon }} {M\atopwithdelims ()n} =1. \end{aligned}$$

Now for fixed YZ we get by Theorem 12 that for any \(\epsilon >0\)

$$\begin{aligned} \lim _{f\rightarrow \infty } \frac{\#\{S\mid Y(S)=Y, Z(S)=Z, f(S)=f, |n(S)-\frac{f}{4}| < f^{\frac{1}{2}+\epsilon }\}}{N(Y,Z,f)} =1. \end{aligned}$$

Also by Theorem 10, for any \(\epsilon >0\)

$$\begin{aligned} \lim _{f\rightarrow \infty } \frac{\#\{S\mid Y(S)=\emptyset ,f(S)=f, |n(S)-\frac{f}{4}| < f^{\frac{1}{2}+\epsilon }\}}{N(\emptyset ,f)} =1. \end{aligned}$$

Therefore by Theorem 11 we conclude that for any \(\epsilon >0\)

$$\begin{aligned} \lim _{f\rightarrow \infty } \frac{\#\{S\mid f(S)=f, |n(S)-\frac{f}{4}| < f^{\frac{1}{2}+\epsilon }\}}{N(f)} =1. \end{aligned}$$

Of course this is equivalent to saying that for any \(\epsilon >0\)

$$\begin{aligned} \lim _{f\rightarrow \infty } \frac{\#\{S\mid f(S)=f, |g(S)-\frac{3f}{4}| < f^{\frac{1}{2}+\epsilon }\}}{N(f)} =1. \end{aligned}$$

\(\square \)

7 Distribution of genus

We will now obtain the distribution of the genus among numerical semigroups with a fixed Frobenius number. We will be using the notation of falling factorials, \([n]_k=(n)(n-1)\dots (n-k+1)\). Also remember that \(g(S)=f(S)-n(S)\).

Theorem 14

Let \(\psi _{f}\) be the Gaussian density function with mean \(\frac{{\overline{f}}}{2}\) and variance \(\frac{{\overline{f}}}{4}\). Let \(c_1\) be the constant from Theorem 1. Then for any \(\epsilon >0\) there is a L such that for sufficiently large, odd f (and arbitrary n) the difference between \(\frac{N(f,n)}{N(f)}\) and

$$\begin{aligned} \frac{1}{c_1}\psi _f(n)\left( 1+\sum _{Y\ne \emptyset , \max (Y)\le L}\sum _{Z\subseteq [0,\max (Y)]\setminus Y} \left( 1-\frac{n}{{\overline{f}}}\right) ^{\beta }\left( \frac{n}{{\overline{f}}} \right) ^{\max (Y)+1+\alpha -\beta } \right) \end{aligned}$$

is less than \(\epsilon \).

Replace \(c_1\) with \(c_2\) and \(\alpha \) with \(\alpha '\) to get the corresponding result for even f.

Proof

Given \(\epsilon >0\) consider the L given by Theorem 11. Also consider YZ with \(\max (Y)\le L\) and \(Y\cap Z=\emptyset \). Let \(l=\max (Y)\). By Theorem 12 we have

$$\begin{aligned} \begin{aligned} N(Y,Z,f,n)&={{\overline{f}}-l-1-\alpha \atopwithdelims ()n-l-1-\alpha +\beta } = \frac{({\overline{f}}-l-1-\alpha )!}{(n-l-1-\alpha +\beta )!({\overline{f}}-n-\beta )!}\\&= \frac{({\overline{f}}-l-1-\alpha )!\left[ {\overline{f}}\right] _{l+1+\alpha }}{(n-l-1-\alpha +\beta )!\;[n]_{l+1+\alpha -\beta }\;({\overline{f}}-n-\beta )!\left[ {\overline{f}}-n\right] _{\beta }}\\&\quad \frac{[n]_{l+1+\alpha -\beta } \left[ {\overline{f}}-n\right] _{\beta }}{\left[ {\overline{f}}\right] _{l+1+\alpha }}\\&=\frac{({\overline{f}})!}{n!({\overline{f}}-n)!} \frac{[n]_{l+1+\alpha -\beta } \left[ {\overline{f}}-n\right] _{\beta }}{\left[ {\overline{f}}\right] _{l+1+\alpha }} =\frac{\left[ {\overline{f}}-n\right] _{\beta } [n]_{l+1+\alpha -\beta }}{\left[ {\overline{f}}\right] _{l+1+\alpha }} {{\overline{f}}\atopwithdelims ()n}\\&=\frac{\prod _{i=0}^{\beta -1} ({\overline{f}}-n-i) \prod _{i=0}^{l+\alpha -\beta } (n-i)}{\prod _{i=0}^{l+\alpha } ({\overline{f}}-i)} {{\overline{f}}\atopwithdelims ()n}\\&= \frac{\prod _{i=0}^{\beta -1} \left( 1-\frac{n}{{\overline{f}}}-\frac{i}{{\overline{f}}}\right) \prod _{i=0}^{l+\alpha -\beta } \left( \frac{n}{{\overline{f}}}-\frac{i}{{\overline{f}}}\right) }{\prod _{i=0}^{l+\alpha } (1-\frac{i}{{\overline{f}}})} {{\overline{f}}\atopwithdelims ()n}. \end{aligned} \end{aligned}$$

Therefore once we fix YZ (and hence \(\alpha ,\beta ,l\)) we get the following limit (n is allowed to vary with f)

$$\begin{aligned} \lim _{f\rightarrow \infty }\frac{1}{2^{{\overline{f}}}} N(Y,Z,f,n) - \frac{1}{2^{{\overline{f}}}} {{\overline{f}}\atopwithdelims ()n} \left( 1-\frac{n}{{\overline{f}}}\right) ^{\beta } \left( \frac{n}{{\overline{f}}}\right) ^{l+1+\alpha -\beta } =0. \end{aligned}$$

Denote \(h_L(x)= 1+\sum _{\max (Y)\le L}\sum _{Z\subseteq [0,\max (Y)]\setminus Y} \left( 1-x\right) ^{\beta }x^{\max (Y)+1+\alpha -\beta }\). It follows by Theorems 10 and 12 that

$$\begin{aligned} \limsup _{f\rightarrow \infty }\left| \frac{N(f,n)}{N(f)} -\frac{1}{c_12^{{\overline{f}}}} {{\overline{f}}\atopwithdelims ()n} h_L\left( \frac{n}{{\overline{f}}}\right) \right| \le \epsilon . \end{aligned}$$

Now we are done by the De Moivre–Laplace theorem which implies that for large f, the binomial distribution \(\frac{1}{2^{{\overline{f}}}}{{\overline{f}}\atopwithdelims ()n}\) is approximately the Gaussian distribution with mean \(\frac{{\overline{f}}}{2}\) and variance \(\frac{{\overline{f}}}{4}\).\(\square \)

For Frobenius numbers 19, 29 we plot in Figs. 1 and 2 the distribution given in Theorem 14 with \(L=2\) along with the actual distribution of n(S). The polynomial for \(L=2\) is

$$\begin{aligned} 1+\sum _{\max (Y)\le 2}\sum _{Z\subseteq [0,\max (Y)]\setminus Y} \left( 1-x\right) ^{\beta } x^{\max (Y)+1+\alpha -\beta } =1+2x^2-x^3+4x^4-2x^5+2x^6. \end{aligned}$$
Fig. 1
figure 1

Actual distribution and L \(=\) 2 for F \(=\) 19

Fig. 2
figure 2

Actual distribution and L \(=\) 2 for F \(=\) 29

8 Max embedding dimension

Let MED(f) be the number of max embedding dimension numerical semigroups with Frobenius number f. Let MED(mf) be the number of max embedding dimension numerical semigroups with Frobenius number f and multiplicity m.

Theorem 15

([8], Proposition 2.12) Let S be a numerical semigroup with multiplicity m. Then S is of max embedding dimension if and only if \((S\setminus \{0\})-m\) is a numerical semigroup.

Corollary 3

MED(mf) is equal to the number of numerical semigroups that contain m and have Frobenius number \(f-m\).

To prove Theorem 5 we will need some results from [1].

Lemma 5

([1], Equation 1) For every positive integer f

$$\begin{aligned} 2^{{\overline{f}}}\le N(f)<4\times 2^{{\overline{f}}}. \end{aligned}$$

Corollary 4

For every positive integer f

$$\begin{aligned} \frac{1}{2} 2^{\frac{f}{2}} \le N(f) <4\times 2^{\frac{f}{2}}. \end{aligned}$$

Lemma 6

([1], Equation 17) Given positive integers mf such that \(m<\frac{f}{4}\) we have

$$\begin{aligned} N_{mul}(m,f)< 0.071\times 2^{\frac{f}{2}}\left( \frac{13}{16}\right) ^{\frac{f}{8}}2^{-0.628(\frac{f}{4}-m)}. \end{aligned}$$

Theorem

5 There are constants c, \(c'\) such that

$$\begin{aligned} c2^{\frac{1}{3} f}<MED(f)<c'2^{0.41385f}. \end{aligned}$$

Proof

We start with the lower bound, let \(m=\left\lceil \frac{f+1}{3}\right\rceil \) so that \(f=3m-r\), \(1\le r\le 3\). Let \(f_1=f-m\) so that \(f_1=2m-r<2m\). Now for a lower bound on the number of numerical semigroups that contain m and have Frobenius number \(f_1\), just consider the depth 2 numerical semigroups among them. Therefore by Corollary 3,

$$\begin{aligned} MED(f)\ge MED(m,f)\ge 2^{\overline{f_1}-1}\ge 2^{\frac{f_1}{2}-2} =\frac{1}{4}2^{\frac{f}{2}-\frac{m}{2}} >\frac{1}{4}2^{\frac{f}{2}-\frac{f+4}{6}} =2^{-\frac{8}{3}}2^{\frac{f}{3}}. \end{aligned}$$

Now we obtain the upper bound, let \(u=0.1723\). By Corollary 3 we know that

$$\begin{aligned}MED(f)= & {} \sum _{m=2}^{f+1} MED(m,f) \le 1+\sum _{2\le m<uf}N_{mul}(m,f)+\sum _{uf\le m\le f-1} N(f-m) \\< & {} 1+0.071\times 2^{\frac{f}{2}}\left( \frac{13}{16}\right) ^{\frac{f}{8}}\sum _{2\le m<uf} 2^{-0.628(\frac{f}{4}-m)} +4\sum _{uf\le m\le f-1}2^{\frac{f-m}{2}} \\\ll & {} 2^{\frac{f}{2}}\left( \frac{13}{16}\right) ^{\frac{f}{8}} 2^{-0.628(0.25-u)f}+ 2^{\frac{1-u}{2}f} \end{aligned}$$

It should be numerically checked that \(\frac{1-u}{2}=0.41385\) and

$$\begin{aligned} 2^{\frac{1}{2}}\left( \frac{13}{16}\right) ^{\frac{1}{8}} 2^{-0.628(0.25-u)} <2^{0.41385}. \end{aligned}$$

The result follows.\(\square \)

In particular, this means that max embedding dimension numerical semigroups have density 0, i.e.

$$\begin{aligned} \lim _{f\rightarrow \infty }\frac{MED(f)}{N(f)}=0. \end{aligned}$$

Conjecture 2

The following limit exists

$$\begin{aligned} \lim _{f\rightarrow \infty }\frac{\text {log}_{2}(MED(f))}{f}. \end{aligned}$$

Numerically the limit seems to be close to 0.375. The graph in Fig. 3 is plotted based on Table 1. This table was obtained using the python code from [7].

Fig. 3
figure 3

A plot of log(MED(f))/f

Table 1 Number of Max ED numerical semigroups

9 Counting by genus

So far in this paper we have considered the numerical semigroups of a fixed Frobenius number, now we will consider those with a fixed genus. In this case it is still true that most numerical semigroups have depth 2 or 3 as is proved in [9].

Theorem 16

([9], Section 3.3)

$$\begin{aligned} \lim _{g\rightarrow \infty }\frac{\#\{S|g(S)=g, F(S)>3m(S)\}}{\phi ^g}=0. \end{aligned}$$

We will therefore concentrate on numerical semigroups of depth 2, 3 as we go on to prove Theorem 8. Let \(F_n\) denote the \(n^{th}\) Fibonacci number, it is well known that

$$\begin{aligned} F_{n+1}=\sum _{k=0}^{\left\lfloor \frac{n}{2} \right\rfloor } {n-k\atopwithdelims ()k}. \end{aligned}$$

Theorem 17

Fix \(k\ge 1\) and \(g\ge k+1\), then the number of numerical semigroups with genus g and satisfying \(2m(S)-F(S)=k\) is \(F_{g-k}\).

Proof

If such a numerical semigroup has multiplicity m, then any number beyond \(2m-k\) must be in S, \(2m-k\) is not in S. Let \(R_0=|[m+1,2m-k-1]\cap Gap(S)|\) then \(0\le R_0\le m-k-1\) and \(g=m-1+R_0+1\), i.e. \(g-(k+1)=m-k-1+R_0\). Thus \(R_0\) varies from 0 to \(\left\lfloor \frac{g-(k+1)}{2}\right\rfloor \). Also for a particular \(R_0\), the number of numerical semigroups satisfying the conditions is \({m-k-1\atopwithdelims ()R_0}={g-(k+1)-R_0\atopwithdelims ()R_0}\). And hence the total number of such semigroups is

$$\begin{aligned} \sum _{R_0=0}^{\left\lfloor \frac{g-(k+1)}{2} \right\rfloor } {g-(k+1)-R_0\atopwithdelims ()R_0} =F_{g-k}. \end{aligned}$$

\(\square \)

Corollary 5

([6], Section 3, [10], Proposition 2.3) The number of depth 2 numerical semigroups with genus g is \(F_{g+1}-1\).

Proof

If a numerical semigroup S has depth 2 and genus g then \(2m(S)-F(S)\ge 1\) and \(2m(S)-F(S)\le m(S)-1\le g-1\). Therefore, by Theorem 17 the number of depth 2 numerical semigroups of genus g is

$$\begin{aligned} \sum _{k=1}^{g-1}F_{g-k} =\sum _{i=1}^{g-1}F_{i} =F_{g+1}-1. \end{aligned}$$

\(\square \)

We can now prove one part of Theorem 8.

Theorem 18

For any \(\epsilon >0\) there is an N such that for every g

$$\begin{aligned} \frac{\#\{S|g(S)=g, 2m(S)-F(S)>N\}}{\phi ^g}<\epsilon . \end{aligned}$$

Proof

By Theorem 17 it follows that

$$\begin{aligned} \frac{\#\{S|g(S)=g, 2m(S)-F(S)>N\}}{\phi ^g}= & {} \frac{1}{\phi ^g}\sum _{k=N+1}^{g-1} F_{g-k} \\= & {} \frac{1}{\phi ^g}\sum _{k=1}^{g-N-1} F_{k}<\frac{F_{g-N+1}}{\phi ^g} <\frac{2}{\sqrt{5}} \frac{\phi ^{g-N+1}}{\phi ^g}\\= & {} \frac{2\phi }{\sqrt{5}} \phi ^{-N}. \end{aligned}$$

\(\square \)

We now consider depth 3 numerical semigroups. In [10] the following definitions are made,

$$\begin{aligned} A_k=\{A\subseteq [0,k-1]\mid 0\in A, k\not \in A+A\}. \end{aligned}$$

Given a numerical semigroup S of depth 3, they defined the type of S to be (kA), where \(k=F(S)-2m(S)\) and \(A=(S\cap [m,m+k])-m\). So if S has type (kA) then \(A\in A_k\).

Theorem 19

([10], Proposition 3.) If \(A\in A_k\) then the number of numerical semigroups of genus g and type (kA) is at most

$$\begin{aligned} F_{g-|(A+A)\cap [0,k]|+|A|-k-1}. \end{aligned}$$

Theorem 20

The following sum converges

$$\begin{aligned} \sum _{k}^{\infty }\sum _{A\in A_k}\phi ^{-|(A+A)\cap [0,k]|+|A|-k-1}. \end{aligned}$$

Proof

See [9], Conjecture 2, Section 3.3, [10], Theorem 3.11. \(\square \)

Theorem 21

For any \(\epsilon >0\) there is an N such that for every g

$$\begin{aligned} \frac{\#\{S|g(S)=g, m(S)>F(S)-2m(S)>N\}}{\phi ^g}<\epsilon . \end{aligned}$$

Proof

By Theorem 19 we have

$$\begin{aligned}&\frac{\#\{S|g(S)=g, m(S)>F(S)-2m(S)>N\}}{\phi ^g} \\&\le \sum _{k=N+1}^{\infty }\sum _{A\in A_k}\frac{F_{g-|(A+A)\cap [0,k]|+|A|-k-1}}{\phi ^g} <\frac{2}{\sqrt{5}} \sum _{k=N+1}^{\infty }\sum _{A\in A_k} \phi ^{-|(A+A)\cap [0,k]|+|A|-k-1}. \end{aligned}$$

Therefore we can pick a sufficiently large N by Theorem 20.\(\square \)

Theorem 8 is therefore proved by combining Theorems 18 and 21.