  
  [1m[4m[31m1. Introduction[0m
  
  A  [22m[36mnumerical semigroup[0m is a subset of the set N of nonnegative integers that
  is  closed  under  addition, contains 0 and whose complement in N is finite.
  The  smallest  positive  integer  belonging  to a numerical semigroup is its
  [22m[36mmultiplicity[0m.
  
  Let  S  be  a numerical semigroup and A be a subset of S. We say that A is a
  [22m[36msystem  of generators[0m of S if S= k_1 a_1+cdots+ k_n a_n | n,k_1,...,k_nin N,
  a_1,...,a_nin  A.  The  set  A  is a [22m[36mminimal system of generators[0m of S if no
  proper subset of A is a system of generators of S.
  
  Every numerical semigroup has a unique minimal system of generators. This is
  a  data  that can be used in order to uniquely define a numerical semigroup.
  Observe  that  since  the  complement of a numerical semigroup in the set of
  nonnegative  integers  is  finite,  this  implies  that  the greatest common
  divisor  of  the  elements  of  a  numerical  semigroup  is  1, and the same
  condition  must  be fulfilled by its minimal system of generators (or by any
  of its systems of generators).
  
  Given  a  numerical  semigroup  S  and  a  nonzero  element s in it, one can
  consider  for every integer i ranging from 0 to s-1, the smallest element in
  S  congruent  with  i  modulo  s,  say  w(i)  (this element exists since the
  complement  of  S  in  N  is  finite).  Clearly  w(0)=0. The set rm Ap(S,s)=
  w(0),w(1),...,  w(s-1)  is called the [22m[36mApry set[0m of S with respect to s. Note
  that  a  nonnegative integer x congruent with i modulo s belongs to S if and
  only  if  w(i)<=  x.  Thus  the  pair  (s,rm  Ap(S,s))  fully determines the
  numerical  semigroup  S  (and  can  be  used  to easily solve the membership
  problem to S). This set is in fact one of the most powerfull tools known for
  numerical semigroups, and it is used almost everywhere in the computation of
  components  and  invariants associated to a numerical semigroup. Usually the
  element  s  is taken to be the multiplicity, since in this way the resulting
  Apry set is the smallest possible.
  
  A  [22m[36mgap[0m  of a numerical semigroup S is a nonnegative integer not belonging to
  S.  The  set  of  gaps  of  S  is  usually  denoted  by rm H(S), and clearly
  determines  uniquely  S.  Note  that if x is a gap of S, then so are all the
  nonnegative integers dividing it. Thus in order to describe S we do not need
  to  know  all  its gaps, but only those that are maximal with respect to the
  partial  order  induced  by division in N. These gaps are called [22m[36mfundamental
  gaps[0m.
  
  The  largest nonnegative integer not belonging to a numerical semigroup S is
  the  [22m[36mFrobenius  number[0m  of  S. If S is the set of nonnegative integers, then
  clearly its Frobenius number is -1, otherwise its Frobenius number coincides
  with  the maximum of the gaps (or fundamental gaps) of S. In this package we
  refer  to  the  elements in the semigroup that are less than or equal to the
  Frobenius  number  plus  1  as [22m[36msmall elements[0m of the semigroup. Observe that
  from  the definition, if S is a numerical semigroup with Frobenius number f,
  then  f+  N\0subseteq  S.  An integer z is a [22m[36mpseudo-Frobenius number[0m of S if
  z+S\0subseteq   S.   Thus   the   Frobenius  number  of  S  is  one  of  its
  pseudo-Frobenius   numbers.  The  [22m[36mtype[0m  of  a  numerical  semigroup  is  the
  cardinality of the set of its pseudo-Frobenius numbers.
  
  The  number  of  numerical  semigroups  having  a  given Frobenius number is
  finite.  The  elements  in this set of numerical semigroups that are maximal
  with  respect to set inclusion are precisely those numerical semigroups that
  cannot  be  expressed  as  intersection  of  two  other numerical semigroups
  containing  them  properly, and thus they are known as [22m[36mirreducible[0m numerical
  semigroups.  Clearly,  every  numerical  semigroup  is  the  intersection of
  (finitely many) irreducible numerical semigroups.
  
  A  numerical  semigroup  S with Frobenius number f is [22m[36msymmetric[0m if for every
  integer  x,  either  xin  S  or  f-xin  S.  The set of irreducible numerical
  semigroups  with  odd  Frobenius  number coincides with the set of symmetric
  numerical  semigroups. The numerical semigroup S is [22m[36mpseudo-symmetric[0m if f is
  even  and  for every integer x not equal to f/2 either xin S or f-xin S. The
  set  of  irreducible  numerical  semigroups  with  even  Frobenius number is
  precisely  the  set  of  pseudo-symmetric  numerical  semigroups.  These two
  classes  of  numerical semigroups have been widely studied in the literature
  due  to  their nice applications in Algebraic Geometry. This is probably one
  of  the  main  reasons  that  made  people turn their attention on numerical
  semigroups  again in the last decades. Symmetric numerical semigroups can be
  also  characterized  as  those with type one, and pseudo-symmetric numerical
  semigroups  are  those  numerical semigroups with type two and such that its
  pseudo-Frobenius  numbers  are its Frobenius number and its Frobenius number
  divided by two.
  
  Another  class  of  numerical  semigroups  that  catched  the  attention  of
  researchers working on Algebraic Geometry and Commutative Ring Theory is the
  class   of  numerical  semigroups  with  maximal  embedding  dimension.  The
  [22m[36membedding  dimension[0m  of  a  numerical  semigroup  is the cardinality of its
  minimal  system  of generators. It can be shown that the embedding dimension
  is  at  most  the  multiplicity  of  the  numerical  semigroup. Thus [22m[36mmaximal
  embedding  dimension[0m numerical semigroups are those numerical semigroups for
  which  their  embedding dimension and multiplicity coincide. These numerical
  semigroups  have  nice  maximal  properties, not only (of course) related to
  their  embedding  dimension, but also by means of their presentations. Among
  maximal  embedding  dimension  there are two classes of numerical semigroups
  that  have  been  studied  due  to  the  connections with the equivalence of
  algebroid  branches. A numerical semigroup S is Arf if for every x>= y>= zin
  S,  then x+y-zin S; and it is [22m[36msaturated[0m if the following condition holds: if
  s,s_1,...,s_rin   S   are  such  that  s_i<=  s  for  all  iin  1,...,r  and
  z_1,...,z_rin  Z  are such that z_1s_1+cdots+z_rs_r>= 0, then s+z_1s_1+cdots
  +z_rs_rin S.
  
  If  we  look  carefully  inside  the  set of fundamental gaps of a numerical
  semigroup,  we see that there are some fulfilling the condition that if they
  are  added to the given numerical semigroup, then the resulting set is again
  a  numerical  semigroup.  These  elements  are  called  [22m[36mspecial  gaps[0m of the
  numerical semigroup. A numerical semigroup other than the set of nonnegative
  integers is irreducible if and only if it has only a special gap.
  
  The inverse operation to the one described in the above paragraph is that of
  removing  an  element of a numerical semigroup. If we want the resulting set
  to  be a numerical semigroup, then the only thing we can remove is a minimal
  generator.
  
  Let  a,b,c,d  be positive integers such that a/b < c/d, and let I=[a/b,c/d].
  Then  the  set rm S(I)= Ncap bigcup_n>= 0 n I is a numerical semigroup. This
  class  of  numerical  semigroups coincides with that of sets of solutions to
  equations  of  the  form  A  x  mod B <= C x with A,B,C positive integers. A
  numerical semigroup in this class is said to be [22m[36mproportionally modular[0m.
  
  A  sequence  of  positive  rational  numbers  a_1/b_1 < cdots < a_n/b_n with
  a_i,b_i positive integers is a [22m[36mBzout sequence[0m if a_i+1b_i - a_i b_i+1=1 for
  all  iin  1,...,n-1.  If  a/b=a_1/b_1  <  cdots  <  a_n/b_n  =c/d,  then  rm
  S([a/b,c/d])=<  a_1,...,a_n>.  Bzout sequences are not only interesting for
  this fact, they have shown to be a major tool in the study of proportionally
  modular numerical semigroups.
  
  If S is a numerical semigroup and k is a positive integer, then the set S/k=
  xin N | kxin S is a numerical semigroup, known as the [22m[36mquotient[0m S by k.
  
  Let  m  be a positive integer. A [22m[36msubadditive[0m function with period m is a map
  f:  N->  N  such  that f(0)=0, f(x+y)<= f(x)+f(y) and f(x+m)=f(x). If f is a
  subadditive function with period m, then the set rm M_f= xin N | f(x)<= x is
  a  numerical semigroup. Moreover, every numerical semigroup is of this form.
  Thus  a  numerical  semigroup  can be given by a subadditive function with a
  given  period.  If  S  is  a  numerical  semigroup and sin S, snot=0, and rm
  Ap(S,s)=  w(0),w(1),...,  w(s-1),  then  f(x)=w(x  mod  s)  is a subadditive
  function with period s such that rm M_f=S.
  
  Let  S be a numerical semigroup generated by n_1,...,n_k. Then we can define
  the  following  morphism  (called  sometimes  the factorization morphism) by
  varphi:  N^k  -> S, varphi(a_1,...,a_k)=a_1n_1+cdots+a_kn_k. If sigma is the
  kernel congruence of varphi (that is, asigma b if varphi(a)=varphi(b)), then
  S is isomorphic to N^k/sigma. A [22m[36mpresentation[0m for S is a system of generators
  (as  a  congruence)  of  sigma.  If  n_1,...,n_p  is  a  minimal  system  of
  generators,  then a [22m[36mminimal presentation[0m is a presentation such that none of
  its  proper  subsets  is  a presentation. Minimal presentations of numerical
  semigroups  coincide  with presentations with minimal cardinality, though in
  general  these  two  concepts  are not the same for an arbitrary commutative
  semigroup.
  
  A set I of integers is an [22m[36mideal relative to a numerical semigroup[0m S provided
  that  I+Ssubseteq  I and that there exists din S such that d+Isubseteq S. If
  Isubseteq  S, we simply say that I is an [22m[36mideal[0m of S. If I and J are relative
  ideals of S, then so is I-J=zin Z | z+Jsubseteq I, and it is tightly related
  to the operation ":" of ideals in a commutative ring.
  
  In  this  package  we have implemented the functions needed to deal with the
  elements exposed in this introduction.
  
