For a given integer $n$, I am interested in the number of different numerical semigroups one can make with a generating set consisting only of integers in $[n]$.


I have done some small examples. For $n=1$ there is only $\langle 1\rangle$ and the same goes for $n=2$. For $n=3$ there are only $\langle 1\rangle$ and $\langle 2,3\rangle$ and for $n=4$ there are $\langle 1\rangle$, $\langle 2,3\rangle$, and $\langle 3,4\rangle$. For $n=5$ I won't list all the ones I found but I believe there to be $7$ of them, and for $n=6$ I found $8$ (of course I may have made a mistake).


I have found references online counting numerical subgroups by multiplicity $m$ and genus $g$, but was not able to find anything on this variant of the counting problem. In fact, it would be *really* great if I could figure out how to count the number of numerical semigroups with generating set in $[n]$ and with genus $g$, for given integers $n$ and $g$. Any remarks or pointers to the literature would be greatly appreciated. Thanks in advance!



Counting numerical semigroups by largest element of minimal generating set
A key observation is that two sets of generators $g, g'\subseteq [n]$ produce the same semigroup if and only if $\langle g\rangle \cap [n] = \langle g'\rangle \cap [n]$. Hence, the number of different semigroups equals the number of different $\langle g\rangle \cap [n]$ for $g\subseteq [n]$ (and this is what is computed in a naive way by the Sage code that I shared in the comments).


The question has an implicit restriction that the complement of $\langle g\rangle$ must be finite, which is equivalent to $g$ being set-wise coprime. Let's refer to the semigroups under this restriction as *primitive* and denote their number as $P(n)$. Without this restriction the semigroups (ie. both primitive and non-primitive) are enumerated by [OEIS A103580](https://oeis.org/A103580). It is easy to see the following connection between the two counts:
$${\tt A103580}(n) = \sum\_{k=1}^n P(\lfloor \tfrac{n}{k}\rfloor ),$$
which implies that $P(n)$ can be obtained via [Möbius inversion](https://en.wikipedia.org/wiki/M%C3%B6bius_inversion_formula#Generalizations):
$$P(n) = \sum\_{k=1}^n \mu(k)\cdot {\tt A103580}(\lfloor \tfrac{n}{k}\rfloor ).$$
From 100 terms provided in the OEIS for A103580, we can immediately obtain $P(n)$ for $n\leq 100$.


Efficient computation of A103580 is discussed in the paper [Counting numerical semigroups by Frobenius number, multiplicity, and depth](https://arxiv.org/abs/2208.14587) by Sean Li (see Remark on page 12).


*PS.* I've added $P(n)$ to the OEIS as [sequence A358392](https://oeis.org/A358392).


