  
  [1X9 [33X[0;0YNonunique invariants for factorizations in numerical semigroups[133X[101X
  
  
  [1X9.1 [33X[0;0YFactorizations in Numerical Semigroups[133X[101X
  
  [33X[0;0YLet  [22XS[122X  be  a  numerical  semigroup  minimally generated by [22X{m_1,...,m_n}[122X. A
  factorization   of  an  element  [22Xs∈  S[122X  is  an  n-tuple  [22Xa=(a_1,...,a_n)[122X  of
  nonnegative  integers  such  that  [22Xn=a_1  n_1+⋯+a_n  m_n[122X. The lenght of [22Xa[122X is
  [22X|a|=a_1+⋯+a_n[122X. Given two factorizations [22Xa[122X and [22Xb[122X of [22Xn[122X, the distance between [22Xa[122X
  and     [22Xb[122X     is     [22Xd(a,b)=max    {    |a-gcd(a,b)|,|b-gcd(a,b)|}[122X,    where
  [22Xgcd((a_1,...,a_n),(b_1,...,b_n))=(min(a_1,b_1),...,min(a_n,b_n))[122X.[133X
  
  [33X[0;0YIf [22Xl_1>⋯ > l_k[122X are the lenghts of all the factorizations of [22Xs ∈ S[122X, the Delta
  set associated to [22Xs[122X is [22X∆(s)={l_1-l_2,...,l_k-l_k-1}[122X.[133X
  
  [33X[0;0YThe  catenary degree of an element in [22XS[122X is the least positive integer [22Xc[122X such
  that  for  any  two  of  its factorizations [22Xa[122X and [22Xb[122X, there exists a chain of
  factorizations  starting  in  [22Xa[122X  and  ending  in  [22Xb[122X and so that the distance
  between  two consecutive links is at most [22Xc[122X. The catenary degree of [22XS[122X is the
  supremum of the catenary degrees of the elements in [22XS[122X.[133X
  
  [33X[0;0YThe tame degree of [22XS[122X is the least positive integer [22Xt[122X for any factorization [22Xa[122X
  of  an  element  [22Xs[122X  in [22XS[122X, and any [22Xi[122X such that [22Xs-m_i∈ S[122X, there exists another
  factorization [22Xb[122X of [22Xs[122X so that the distance to [22Xa[122X is at most [22Xt[122X and [22Xb_inot = 0[122X.[133X
  
  [33X[0;0YThe  [22Xω[122X-primality  of  an  elment [22Xs[122X in [22XS[122X is the least positive integer [22Xk[122X such
  that if [22X(∑_i∈ I s_i)-s∈ S, s_i∈ S[122X, then there exists [22XΩ⊆ I[122X with cardinality [22Xk[122X
  such  that  [22X(∑_i∈  Ω  s_i)-s∈  S[122X.  The  [22Xω[122X-primality  is  the  maximum of the
  [22Xω[122X-primality of its minimal generators.[133X
  
  [33X[0;0YThe  basic  properties  of  these  constants  can  be  found  in [GH06]. The
  algorithm  used  to compute the catenary and tame degree is an adaptation of
  the algorithms appearing in [CGLPR06] for numerical semigroup (see [CGD07]).
  The  computation  of  the  elascitiy of a numerical semigroup reduces to [22Xm/n[122X
  with [22Xm[122X the multiplicity of the semigroup and [22Xn[122X its largest minimal generator
  (see [CHM06] or [GH06]).[133X
  
  [1X9.1-1 FactorizationsIntegerWRTList[101X
  
  [29X[2XFactorizationsIntegerWRTList[102X( [3Xn[103X, [3Xls[103X ) [32X function
  
  [33X[0;0Y[3Xls[103X  is  a  list  of  integers  and  [3Xn[103X  an  integer. The output is the set of
  factorizations  of  [3Xn[103X in terms of the elements in the list [3Xls[103X. This function
  uses RestrictedPartitions.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XFactorizationsIntegerWRTList(100,[11,13,15,19]);[127X[104X
    [4X[28X[ [ 2, 6, 0, 0 ], [ 3, 4, 1, 0 ], [ 4, 2, 2, 0 ], [ 5, 0, 3, 0 ], [128X[104X
    [4X[28X  [ 5, 2, 0, 1 ], [ 6, 0, 1, 1 ], [ 0, 1, 2, 3 ], [ 1, 1, 0, 4 ] ][128X[104X
  [4X[32X[104X
  
  [1X9.1-2 FactorizationsElementWRTNumericalSemigroup[101X
  
  [29X[2XFactorizationsElementWRTNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a  numerical semigroup and [3Xn[103X a nonnegative integer. The output is the
  set of factorizations of [3Xn[103X in terms of the minimal generating set of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);[127X[104X
    [4X[28X<Numerical semigroup with 6 generators>[128X[104X
    [4X[25Xgap>[125X [27XFactorizationsElementWRTNumericalSemigroup(1100,s);[127X[104X
    [4X[28X[ [ 0, 8, 1, 0, 0, 0 ], [ 0, 0, 0, 2, 2, 0 ], [ 5, 1, 1, 0, 0, 1 ], [128X[104X
    [4X[28X  [ 0, 2, 3, 0, 0, 1 ] ][128X[104X
  [4X[32X[104X
  
  [1X9.1-3 RClassesOfSetOfFactorizations[101X
  
  [29X[2XRClassesOfSetOfFactorizations[102X( [3Xls[103X ) [32X function
  
  [33X[0;0Y[3Xls[103X  is a set of factorizations (a list of lists of nonnegative integers with
  the  same lenght). The output is the set of [22Xmathcal R[122X-classes of this set of
  factorizations as defined in Chapter 7 of [RG09].[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(10,11,19,23);;[127X[104X
    [4X[25Xgap>[125X [27XBettiElementsOfNumericalSemigroup(s);[127X[104X
    [4X[28X[ 30, 33, 42, 57, 69 ][128X[104X
    [4X[25Xgap>[125X [27XFactorizationsElementWRTNumericalSemigroup(69,s);[127X[104X
    [4X[28X[ [ 5, 0, 1, 0 ], [ 2, 1, 2, 0 ], [ 0, 0, 0, 3 ] ][128X[104X
    [4X[25Xgap>[125X [27XRClassesOfSetOfFactorizations(last);[127X[104X
    [4X[28X[ [ [ 2, 1, 2, 0 ], [ 5, 0, 1, 0 ] ], [ [ 0, 0, 0, 3 ] ] ][128X[104X
  [4X[32X[104X
  
  [1X9.1-4 LShapesOfNumericalSemigroup[101X
  
  [29X[2XLShapesOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a numerical semigroup. The output is the number of LShapes associated
  to  [3XS[103X. These are ways of arranging the set of factorizations of the elements
  in the Apéry set of the largest generator, so that if one factorization [22Xx[122X is
  chosen  for [22Xw[122X and [22Xw-w'∈ S[122X, then only the factorization of [22Xx'[122X of [22Xw'[122X with [22Xx'le[122X
  can  be in the LShape (and if there is no such a factorization, then we have
  no LShape with [22Xx[122X in it), see [AG10].[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(4,6,9);;[127X[104X
    [4X[25Xgap>[125X [27XLShapesOfNumericalSemigroup(s);[127X[104X
    [4X[28X[ [ [ 0, 0 ], [ 1, 0 ], [ 0, 1 ], [ 2, 0 ], [ 1, 1 ], [ 0, 2 ], [ 2, 1 ], [128X[104X
    [4X[28X      [ 1, 2 ], [ 2, 2 ] ], [128X[104X
    [4X[28X  [ [ 0, 0 ], [ 1, 0 ], [ 0, 1 ], [ 2, 0 ], [ 1, 1 ], [ 3, 0 ], [ 2, 1 ], [128X[104X
    [4X[28X      [ 4, 0 ], [ 5, 0 ] ] ][128X[104X
  [4X[32X[104X
  
  [1X9.1-5 DenumerantOfElementInNumericalSemigroup[101X
  
  [29X[2XDenumerantOfElementInNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a  numerical  semigroup  and  [3Xn[103X a positive integer. The output is the
  number of factorizations of [3Xn[103X in terms of the minimal generating set of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,195,272,278,286);;[127X[104X
    [4X[25Xgap>[125X [27XDenumerantOfElementInNumericalSemigroup(1311,s);[127X[104X
    [4X[28X6[128X[104X
  [4X[32X[104X
  
  
  [1X9.2 [33X[0;0YInvariants based on lengths[133X[101X
  
  [1X9.2-1 LengthsOfFactorizationsIntegerWRTList[101X
  
  [29X[2XLengthsOfFactorizationsIntegerWRTList[102X( [3Xn[103X, [3Xls[103X ) [32X function
  
  [33X[0;0Y[3Xls[103X  is a list of integers and [3Xn[103X an integer. The output is the set of lengths
  of the factorizations of [3Xn[103X in terms of the elements in [3Xls[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XLengthsOfFactorizationsIntegerWRTList(100,[11,13,15,19]);[127X[104X
    [4X[28X[ 6, 8 ][128X[104X
  [4X[32X[104X
  
  [1X9.2-2 LengthsOfFactorizationsElementWRTNumericalSemigroup[101X
  
  [29X[2XLengthsOfFactorizationsElementWRTNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a  numerical semigroup and [3Xn[103X a nonnegative integer. The output is the
  set of lengths of the factorizations of [3Xn[103X in terms of the minimal generating
  set of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);[127X[104X
    [4X[28X<Numerical semigroup with 6 generators>[128X[104X
    [4X[25Xgap>[125X [27XLengthsOfFactorizationsElementWRTNumericalSemigroup(1100,s);[127X[104X
    [4X[28X[ 4, 6, 8, 9 ][128X[104X
  [4X[32X[104X
  
  [1X9.2-3 ElasticityOfFactorizationsElementWRTNumericalSemigroup[101X
  
  [29X[2XElasticityOfFactorizationsElementWRTNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a  numerical  semigroup  and  [3Xn[103X a positive integer. The output is the
  maximum  length  divided by the minimum length of the factorizations of [3Xn[103X in
  terms of the minimal generating set of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);[127X[104X
    [4X[28X<Numerical semigroup with 6 generators>[128X[104X
    [4X[25Xgap>[125X [27XElasticityOfFactorizationsElementWRTNumericalSemigroup(1100,s);[127X[104X
    [4X[28X9/4[128X[104X
  [4X[32X[104X
  
  [1X9.2-4 ElasticityOfNumericalSemigroup[101X
  
  [29X[2XElasticityOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X is a numerical semigroup. The output is the elasticity of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);[127X[104X
    [4X[28X<Numerical semigroup with 6 generators>[128X[104X
    [4X[25Xgap>[125X [27XElasticityOfNumericalSemigroup(s);[127X[104X
    [4X[28X286/101[128X[104X
  [4X[32X[104X
  
  [1X9.2-5 DeltaSetOfSetOfIntegers[101X
  
  [29X[2XDeltaSetOfSetOfIntegers[102X( [3Xls[103X ) [32X function
  
  [33X[0;0Y[3Xls[103X  is  list of integers. The output is the Delta set of the elements in [3Xls[103X,
  that is, the set of differences of consecutive elements in the list.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XLengthsOfFactorizationsIntegerWRTList(100,[11,13,15,19]);[127X[104X
    [4X[28X[ 6, 8 ][128X[104X
    [4X[25Xgap>[125X [27XDeltaSetOfSetOfIntegers(last);[127X[104X
    [4X[28X[ 2 ][128X[104X
  [4X[32X[104X
  
  [1X9.2-6 DeltaSetOfFactorizationsElementWRTNumericalSemigroup[101X
  
  [29X[2XDeltaSetOfFactorizationsElementWRTNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a  numerical semigroup and [3Xn[103X a nonnegative integer. The output is the
  Delta  set of the factorizations of [3Xn[103X in terms of the minimal generating set
  of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);[127X[104X
    [4X[28X<Numerical semigroup with 6 generators>[128X[104X
    [4X[25Xgap>[125X [27XDeltaSetOfFactorizationsElementWRTNumericalSemigroup(1100,s);[127X[104X
    [4X[28X[ 1, 2 ][128X[104X
  [4X[32X[104X
  
  [1X9.2-7 MaximumDegreeOfElementWRTNumericalSemigroup[101X
  
  [29X[2XMaximumDegreeOfElementWRTNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a  numerical semigroup and [3Xn[103X a nonnegative integer. The output is the
  maximum length of the factorizations of [3Xn[103X in terms of the minimal generating
  set of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);[127X[104X
    [4X[28X<Numerical semigroup with 6 generators>[128X[104X
    [4X[25Xgap>[125X [27XMaximumDegreeOfElementWRTNumericalSemigroup(1100,s);[127X[104X
    [4X[28X9[128X[104X
  [4X[32X[104X
  
  [1X9.2-8 MaximalDenumerantOfElementInNumericalSemigroup[101X
  
  [29X[2XMaximalDenumerantOfElementInNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a  numerical  semigroup  and  [3Xn[103X a positive integer. The output is the
  number  of  factorizations  of [3Xn[103X in terms of the minimal generating set of [3XS[103X
  with maximal length.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);;[127X[104X
    [4X[25Xgap>[125X [27XMaximalDenumerantOfElementInNumericalSemigroup(1100,s);[127X[104X
    [4X[28X1[128X[104X
    [4X[25Xgap>[125X [27XMaximalDenumerantOfElementInNumericalSemigroup(1311,s);[127X[104X
    [4X[28X2[128X[104X
  [4X[32X[104X
  
  [1X9.2-9 MaximalDenumerantOfSetOfFactorizations[101X
  
  [29X[2XMaximalDenumerantOfSetOfFactorizations[102X( [3Xls[103X ) [32X function
  
  [33X[0;0Y[3Xls[103X  is  list of factorizations (a list of lists of nonnegative integers with
  the  same  lenght).  The  output  is  number  of elements in [3Xls[103X with maximal
  length.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XFactorizationsIntegerWRTList(100,[11,13,15,19]);[127X[104X
    [4X[28X[ [ 2, 6, 0, 0 ], [ 3, 4, 1, 0 ], [ 4, 2, 2, 0 ], [ 5, 0, 3, 0 ], [ 5, 2, 0, 1 ], [128X[104X
    [4X[28X  [ 6, 0, 1, 1 ], [ 0, 1, 2, 3 ], [ 1, 1, 0, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XMaximalDenumerantOfSetOfFactorizations(last);[127X[104X
    [4X[28X6[128X[104X
  [4X[32X[104X
  
  [1X9.2-10 MaximalDenumerantOfNumericalSemigroup[101X
  
  [29X[2XMaximalDenumerantOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is a numerical semigroup. The output is the maximal denumerant of [3XS[103X, that
  is, the maximum of the maximal denumerant of the elements in [3XS[103X (see [BH13]).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);;[127X[104X
    [4X[25Xgap>[125X [27XMaximalDenumerantOfNumericalSemigroup(s);[127X[104X
    [4X[28X4[128X[104X
  [4X[32X[104X
  
  [1X9.2-11 AdjustmentOfNumericalSemigroup[101X
  
  [29X[2XAdjustmentOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is a numerical semigroup. The output is the adjustment of [3XS[103X as defined in
  [BH13].[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);;[127X[104X
    [4X[25Xgap>[125X [27XAdjustmentOfNumericalSemigroup(s);[127X[104X
    [4X[28X[ 0, 12, 24, 36, 48, 60, 72, 84, 95, 96, 107, 108, 119, 120, 131, 132, 143,[128X[104X
    [4X[28X  144, 155, 156, 167, 168, 171, 177, 179, 180, 183, 185, 189, 190, 191, 192, [128X[104X
    [4X[28X  195, 197, 201, 203, 204, 207, 209, 213, 215, 216, 219, 221, 225, 227, 228, [128X[104X
    [4X[28X  231, 233, 237, 239, 240, 243, 245, 249, 251, 252, 255, 257, 261, 263, 264, [128X[104X
    [4X[28X  266, 267, 269, 273, 275, 276, 279, 280, 281, 285, 287, 288, 292, 293, 299, [128X[104X
    [4X[28X  300, 304, 305, 311, 312, 316, 317, 323, 324, 328, 329, 335, 336, 340, 341, [128X[104X
    [4X[28X  342, 347, 348, 352, 353, 354, 356, 359, 360, 361, 362, 364, 365, 366, 368, [128X[104X
    [4X[28X  370, 371, 372, 374, 376, 377, 378, 380, 382, 383, 384, 388, 389, 390, 394, [128X[104X
    [4X[28X  395, 396, 400, 401, 402, 406, 407, 408, 412, 413, 414, 418, 419, 420, 424, [128X[104X
    [4X[28X  425, 426, 430, 431, 432, 436, 437, 438, 442, 444, 448, 450, 451, 454, 456, [128X[104X
    [4X[28X  460, 465, 466, 472, 477, 478, 484, 489, 490, 496, 501, 502, 508, 513, 514, [128X[104X
    [4X[28X  519, 520, 525, 526, 527, 531, 532, 533, 537, 539, 543, 545, 549, 551, 555, [128X[104X
    [4X[28X  561, 567, 573, 579, 585, 591, 597, 603, 609, 615, 621, 622, 627, 698, 704, [128X[104X
    [4X[28X  710, 716, 722 ][128X[104X
  [4X[32X[104X
  
  [1X9.2-12 IsAdditiveNumericalSemigroup[101X
  
  [29X[2XIsAdditiveNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X   is   a   numerical  semigroup.  Detects  if  [3XS[103X  is  additive,  that  is,
  [22Xord(m+x)=ord(x)+1[122X  for  all [22Xx[122X in [3XS[103X, where [22Xm[122X is the multiplicity of [3XS[103X and [22Xord[122X
  stands for MaximumDegreeOfElementWRTNumericalSemigroup. For these semigroups
  [22Xgr_m(K[[S]])[122X is Cohen-Macaulay(see [BH13]).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xl:=IrreducibleNumericalSemigroupsWithFrobeniusNumber(31);;[127X[104X
    [4X[25Xgap>[125X [27XLength(l);[127X[104X
    [4X[28X109[128X[104X
    [4X[25Xgap>[125X [27XLength(Filtered(l,IsAdditiveNumericalSemigroup));[127X[104X
    [4X[28X20[128X[104X
  [4X[32X[104X
  
  [1X9.2-13 IsSuperSymmetricNumericalSemigroup[101X
  
  [29X[2XIsSuperSymmetricNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a numerical semigroup. Detects if [3XS[103X is supersymmetric, that is, it is
  symmetric, additive and whenever [22Xw+w'=f+m[122X (with [22Xm[122X the multiplicity and [22Xf[122X the
  Frobenius  number)  we  have  [22Xord(w+w')=ord(w)+ord(w')[122X, where [22Xord[122X stands for
  MaximumDegreeOfElementWRTNumericalSemigroup.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xl:=IrreducibleNumericalSemigroupsWithFrobeniusNumber(31);;[127X[104X
    [4X[25Xgap>[125X [27XLength(l);[127X[104X
    [4X[28X109[128X[104X
    [4X[25Xgap>[125X [27XLength(Filtered(l,IsSuperSymmetricNumericalSemigroup));[127X[104X
    [4X[28X7[128X[104X
  [4X[32X[104X
  
  
  [1X9.3 [33X[0;0YInvariants based on distances[133X[101X
  
  [1X9.3-1 CatenaryDegreeOfSetOfFactorizations[101X
  
  [29X[2XCatenaryDegreeOfSetOfFactorizations[102X( [3Xls[103X ) [32X function
  
  [33X[0;0Y[3Xls[103X  is a set of factorizations (a list of lists of nonnegative integers with
  the  same  lenght).  The  output  is  the  catenary  degree  of  this set of
  factorizations.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XFactorizationsIntegerWRTList(100,[11,13,15,19]);[127X[104X
    [4X[28X[ [ 2, 6, 0, 0 ], [ 3, 4, 1, 0 ], [ 4, 2, 2, 0 ], [ 5, 0, 3, 0 ], [128X[104X
    [4X[28X  [ 5, 2, 0, 1 ], [ 6, 0, 1, 1 ], [ 0, 1, 2, 3 ], [ 1, 1, 0, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XCatenaryDegreeOfSetOfFactorizations(last);[127X[104X
    [4X[28X5[128X[104X
  [4X[32X[104X
  
  [1X9.3-2 AdjacentCatenaryDegreeOfSetOfFactorizations[101X
  
  [29X[2XAdjacentCatenaryDegreeOfSetOfFactorizations[102X( [3Xls[103X ) [32X function
  
  [33X[0;0Y[3Xls[103X  is a set of factorizations (a list of lists of nonnegative integers with
  the  same lenght). The output is the adjacent catenary degree of this set of
  factorizations,  that  is,  the  supremum of the distance between to sets of
  factorizations  with adjacet lengths. More precisely, if [22Xl_1,...,l_t[122X are the
  lengths of the factorizations of the elements in [3Xls[103X, and [22XZ_l_i[122X is the set of
  factorizations  in  [3Xls[103X  with length [22Xl_i[122X, then the adjacent catenary degre is
  the maximum of the distances [22Xmathrm d (Z_l_i,Z_l_i+1})[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XFactorizationsIntegerWRTList(100,[11,13,15,19]);[127X[104X
    [4X[28X[ [ 2, 6, 0, 0 ], [ 3, 4, 1, 0 ], [ 4, 2, 2, 0 ], [ 5, 0, 3, 0 ], [ 5, 2, 0, 1 ],[128X[104X
    [4X[28X  [ 6, 0, 1, 1 ], [ 0, 1, 2, 3 ], [ 1, 1, 0, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XAdjacentCatenaryDegreeOfSetOfFactorizations(last);[127X[104X
    [4X[28X5[128X[104X
  [4X[32X[104X
  
  [1X9.3-3 EqualCatenaryDegreeOfSetOfFactorizations[101X
  
  [29X[2XEqualCatenaryDegreeOfSetOfFactorizations[102X( [3Xls[103X ) [32X function
  
  [33X[0;0Y[3Xls[103X  is a set of factorizations (a list of lists of nonnegative integers with
  the  same  lenght). The same as CatenaryDegreeOfSetOfFactorizations, but now
  the  factorizations  joined  by the chain must have the same length, and the
  elements  in the chain also. Equivalently, if [22Xl_1,...,l_t[122X are the lengths of
  the  factorizations  of  the  elements  in  [3Xls[103X,  and  [22XZ_l_i[122X  is  the  set of
  factorizations  in  [3Xls[103X with length [22Xl_i[122X, then the equal catenary degre is the
  maximum    of    the   CatenaryDegreeOfSetOfFactorizations   of   [22Xmathrm   d
  (Z_l_i,Z_l_i+1})[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XFactorizationsIntegerWRTList(100,[11,13,15,19]);[127X[104X
    [4X[28X[ [ 2, 6, 0, 0 ], [ 3, 4, 1, 0 ], [ 4, 2, 2, 0 ], [ 5, 0, 3, 0 ], [ 5, 2, 0, 1 ],[128X[104X
    [4X[28X  [ 6, 0, 1, 1 ], [ 0, 1, 2, 3 ], [ 1, 1, 0, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XEqualCatenaryDegreeOfSetOfFactorizations(last);[127X[104X
    [4X[28X2[128X[104X
  [4X[32X[104X
  
  [1X9.3-4 MonotoneCatenaryDegreeOfSetOfFactorizations[101X
  
  [29X[2XMonotoneCatenaryDegreeOfSetOfFactorizations[102X( [3Xls[103X ) [32X function
  
  [33X[0;0Y[3Xls[103X  is a set of factorizations (a list of lists of nonnegative integers with
  the  same  lenght). The same as CatenaryDegreeOfSetOfFactorizations, but now
  the  factorizations  are  joined  by  a  chain  with  nondecreasing lengths.
  Equivalently,        it        is       the       maximum       of       the
  AdjacentCatenaryDegreeOfSetOfFactorizations              and             the
  EqualCatenaryDegreeOfSetOfFactorizations.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XFactorizationsIntegerWRTList(100,[11,13,15,19]);[127X[104X
    [4X[28X[ [ 2, 6, 0, 0 ], [ 3, 4, 1, 0 ], [ 4, 2, 2, 0 ], [ 5, 0, 3, 0 ], [ 5, 2, 0, 1 ],[128X[104X
    [4X[28X  [ 6, 0, 1, 1 ], [ 0, 1, 2, 3 ], [ 1, 1, 0, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XMonotoneCatenaryDegreeOfSetOfFactorizations(last);[127X[104X
    [4X[28X5[128X[104X
  [4X[32X[104X
  
  [1X9.3-5 CatenaryDegreeOfElementInNumericalSemigroup[101X
  
  [29X[2XCatenaryDegreeOfElementInNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3Xn[103X is a nonnegative integer and [3XS[103X is a numerical semigroup. The output is the
  catenary degree of [3Xn[103X relative to [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XCatenaryDegreeOfElementInNumericalSemigroup(157,NumericalSemigroup(13,18));[127X[104X
    [4X[28X0[128X[104X
    [4X[25Xgap>[125X [27XCatenaryDegreeOfElementInNumericalSemigroup(1157,NumericalSemigroup(13,18));[127X[104X
    [4X[28X18[128X[104X
  [4X[32X[104X
  
  [1X9.3-6 TameDegreeOfSetOfFactorizations[101X
  
  [29X[2XTameDegreeOfSetOfFactorizations[102X( [3Xls[103X ) [32X function
  
  [33X[0;0Y[3Xls[103X  is a set of factorizations (a list of lists of nonnegative integers with
  the   same   lenght).  The  output  is  the  tame  degree  of  this  set  of
  factorizations.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XFactorizationsIntegerWRTList(100,[11,13,15,19]);[127X[104X
    [4X[28X[ [ 2, 6, 0, 0 ], [ 3, 4, 1, 0 ], [ 4, 2, 2, 0 ], [ 5, 0, 3, 0 ], [128X[104X
    [4X[28X  [ 5, 2, 0, 1 ], [ 6, 0, 1, 1 ], [ 0, 1, 2, 3 ], [ 1, 1, 0, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XTameDegreeOfSetOfFactorizations(last);[127X[104X
    [4X[28X4[128X[104X
  [4X[32X[104X
  
  [1X9.3-7 CatenaryDegreeOfNumericalSemigroup[101X
  
  [29X[2XCatenaryDegreeOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X is a numerical semigroup. The output is the catenary degree of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);[127X[104X
    [4X[28X<Numerical semigroup with 6 generators>[128X[104X
    [4X[25Xgap>[125X [27XCatenaryDegreeOfNumericalSemigroup(s);[127X[104X
    [4X[28X8[128X[104X
  [4X[32X[104X
  
  [1X9.3-8 EqualPrimitiveElementsOfNumericalSemigroup[101X
  
  [29X[2XEqualPrimitiveElementsOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X is a numerical semigroup.[133X
  
  [33X[0;0YThe  output  is  the set of elements [22Xs[122X in [3XS[103X such that there exists a minimal
  solution  to  [22Xmsg⋅  x-msg⋅  y = 0[122X, such that [22Xx,y[122X are factorizations with the
  same  length  of  [22Xs[122X,  and  [22Xmsg[122X  is the minimal generating system of [3XS[103X. These
  elements are used to compute the equal catenary degree of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(3,5,7);;[127X[104X
    [4X[25Xgap>[125X [27XBettiElementsOfNumericalSemigroup(s);[127X[104X
    [4X[28X[ 10, 12, 14 ][128X[104X
    [4X[28X[128X[104X
    [4X[28X                        [128X[104X
  [4X[32X[104X
  
  [1X9.3-9 EqualCatenaryDegreeOfNumericalSemigroup[101X
  
  [29X[2XEqualCatenaryDegreeOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X is a numerical semigroup. The output is the equal catenary degree of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(3,5,7);;[127X[104X
    [4X[25Xgap>[125X [27XEqualPrimitiveElementsOfNumericalSemigroup(s);[127X[104X
    [4X[28X[ 3, 5, 7, 10 ][128X[104X
  [4X[32X[104X
  
  [1X9.3-10 MonotonePrimitiveElementsOfNumericalSemigroup[101X
  
  [29X[2XMonotonePrimitiveElementsOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X is a numerical semigroup.[133X
  
  [33X[0;0YThe  output  is  the set of elements [22Xs[122X in [3XS[103X such that there exists a minimal
  solution  to  [22Xmsg⋅ x-msg⋅ y = 0[122X, such that [22Xx,y[122X are factorizations of [22Xs[122X, with
  [22X|x|le |y|[122X; [22Xmsg[122X stands the minimal generating system of [3XS[103X. These elements are
  used to compute the monotone catenary degree of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(3,5,7);;[127X[104X
    [4X[25Xgap>[125X [27XMonotonePrimitiveElementsOfNumericalSemigroup(s);[127X[104X
    [4X[28X[ 3, 5, 7, 10, 12, 14, 15, 21, 28, 35 ][128X[104X
    [4X[28X[128X[104X
    [4X[28X                        [128X[104X
  [4X[32X[104X
  
  [1X9.3-11 MonotoneCatenaryDegreeOfNumericalSemigroup[101X
  
  [29X[2XMonotoneCatenaryDegreeOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X is a numerical semigroup. The output is the monotone catenary degree of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(10,23,31,44);;[127X[104X
    [4X[25Xgap>[125X [27XCatenaryDegreeOfNumericalSemigroup(s);[127X[104X
    [4X[28X9[128X[104X
    [4X[25Xgap>[125X [27XMonotoneCatenaryDegreeOfNumericalSemigroup(s);[127X[104X
    [4X[28X21[128X[104X
  [4X[32X[104X
  
  [1X9.3-12 TameDegreeOfNumericalSemigroup[101X
  
  [29X[2XTameDegreeOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X is a numerical semigroup. The output is the tame degree of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(101,113,196,272,278,286);[127X[104X
    [4X[28X<Numerical semigroup with 6 generators>[128X[104X
    [4X[25Xgap>[125X [27XTameDegreeOfNumericalSemigroup(s);[127X[104X
    [4X[28X14[128X[104X
  [4X[32X[104X
  
  [1X9.3-13 TameDegreeOfElementInNumericalSemigroup[101X
  
  [29X[2XTameDegreeOfElementInNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3Xn[103X  is  an elment of the numerical semigroup [3XS[103X. The output is the tame degree
  of [3Xn[103X in [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(10,11,13);[127X[104X
    [4X[28X<Numerical semigroup with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XTameDegreeOfElementInNumericalSemigroup(100,s); [127X[104X
    [4X[28X5[128X[104X
  [4X[32X[104X
  
  
  [1X9.4 [33X[0;0YPrimality[133X[101X
  
  [1X9.4-1 OmegaPrimalityOfElementInNumericalSemigroup[101X
  
  [29X[2XOmegaPrimalityOfElementInNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3Xn[103X  is  an elment of the numerical semigroup [3XS[103X. The output is the [22Xω[122X-primality
  of  [3Xn[103X  in  [3XS[103X  as  explained in [BGG11]. The current implementation is due to
  Chris O'Neill based on a work in progress with Pelayo and Thomas.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(10,11,13);        [127X[104X
    [4X[28X<Numerical semigroup with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XOmegaPrimalityOfElementInNumericalSemigroup(100,s);[127X[104X
    [4X[28X13[128X[104X
  [4X[32X[104X
  
  [1X9.4-2 OmegaPrimalityOfNumericalSemigroup[101X
  
  [29X[2XOmegaPrimalityOfNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a numerical semigroup. The output is the maximum of the [22Xω[122X-primalities
  of the minimal generators of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(10,11,13);        [127X[104X
    [4X[28X<Numerical semigroup with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XOmegaPrimalityOfNumericalSemigroup(s);[127X[104X
    [4X[28X5[128X[104X
  [4X[32X[104X
  
  
  [1X9.5 [33X[0;0YHomogenization of Numerical Semigroups[133X[101X
  
  [33X[0;0YLet  [22XS[122X  be  a  numerical semigroup minimally generated by [22X{m_1,...,m_n}[122X. The
  homogenization   of   [22XS[122X,   [22XS^mathrmhom[122X   is   the   semigroup  generated  by
  [22X{(1,0),(1,m_1),...,  (1,m_n)}[122X.  The catenary degree of [22XS^mathrmhom[122X coincides
  with  the  homogeneous  catenary degree of [22XS[122X, and it is between the catenary
  and the monotone catenary degree of [22XS[122X. The advantage of this catenary degree
  is that is less costly to compute than the monotone catenary degree, and has
  some  nice  interpretations  ([SO-13]).  This section contains the auxiliary
  functions needed to compute the homogeneous catenary degree.[133X
  
  [1X9.5-1 BelongsToHomogenizationOfNumericalSemigroup[101X
  
  [29X[2XBelongsToHomogenizationOfNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a  numerical  semigroup  and  [3Xn[103X a list with two entries (a pair). The
  output is true if the [3Xn[103X belongs to the homogenization of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(10,11,13);;[127X[104X
    [4X[25Xgap>[125X [27XBelongsToHomogenizationOfNumericalSemigroup([10,23],s);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XBelongsToHomogenizationOfNumericalSemigroup([1,23],s);[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  [1X9.5-2 FactorizationsInHomogenizationOfNumericalSemigroup[101X
  
  [29X[2XFactorizationsInHomogenizationOfNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a  numerical  semigroup  and  [3Xn[103X a list with two entries (a pair). The
  output  is  the  set  of factorizations [3Xn[103X in terms of the minimal generating
  system of the homogenization of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(10,11,13);;[127X[104X
    [4X[25Xgap>[125X [27XFactorizationsInHomogenizationOfNumericalSemigroup([20,230],s);[127X[104X
    [4X[28X[ [ 0, 0, 15, 5 ], [ 0, 2, 12, 6 ], [ 0, 4, 9, 7 ],[128X[104X
    [4X[28X  [ 0, 6, 6, 8 ], [ 0, 8, 3, 9 ], [ 0, 10, 0, 10 ],[128X[104X
    [4X[28X  [ 1, 1, 7, 11 ], [ 1, 3, 4, 12 ], [ 1, 5, 1, 13 ],[128X[104X
    [4X[28X  [ 2, 0, 2, 16 ] ][128X[104X
    [4X[25Xgap>[125X [27XFactorizationsElementWRTNumericalSemigroup(230,s);[127X[104X
    [4X[28X[ [ 23, 0, 0 ], [ 12, 10, 0 ], [ 1, 20, 0 ], [ 14, 7, 1 ],[128X[104X
    [4X[28X  [ 3, 17, 1 ], [ 16, 4, 2 ], [ 5, 14, 2 ], [ 18, 1, 3 ],[128X[104X
    [4X[28X  [ 7, 11, 3 ], [ 9, 8, 4 ], [ 11, 5, 5 ], [ 0, 15, 5 ],[128X[104X
    [4X[28X  [ 13, 2, 6 ], [ 2, 12, 6 ], [ 4, 9, 7 ], [ 6, 6, 8 ],[128X[104X
    [4X[28X  [ 8, 3, 9 ], [ 10, 0, 10 ], [ 1, 7, 11 ], [ 3, 4, 12 ],[128X[104X
    [4X[28X  [ 5, 1, 13 ], [ 0, 2, 16 ] ][128X[104X
  [4X[32X[104X
  
  [1X9.5-3 HomogeneousBettiElementsOfNumericalSemigroup[101X
  
  [29X[2XHomogeneousBettiElementsOfNumericalSemigroup[102X( [3Xn[103X, [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a numerical semigroup. The output is the set of Betti elements of the
  homogenization of [3XS[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(10,17,19);;[127X[104X
    [4X[25Xgap>[125X [27XBettiElementsOfNumericalSemigroup(s);[127X[104X
    [4X[28X[ 57, 68, 70 ][128X[104X
    [4X[25Xgap>[125X [27XHomogeneousBettiElementsOfNumericalSemigroup(s);[127X[104X
    [4X[28X[ [ 5, 57 ], [ 5, 68 ], [ 6, 95 ], [ 7, 70 ], [ 9, 153 ] ][128X[104X
  [4X[32X[104X
  
  [1X9.5-4 HomogeneousCatenaryDegreeOfNumericalSemigroup[101X
  
  [29X[2XHomogeneousCatenaryDegreeOfNumericalSemigroup[102X( [3XS[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is a numerical semigroup. The output is the homogeneus catenary degree of
  [3XS[103X.  Observe  that  for  a  single  element  in  the homogenization of [3XS[103X, its
  catenary degree can be computed with CatenaryDegreeOfSetOfFactorizations and
  FactorizationsInHomogenizationOfNumericalSemigroup.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(10,17,19);;[127X[104X
    [4X[25Xgap>[125X [27XCatenaryDegreeOfNumericalSemigroup(s);[127X[104X
    [4X[28X7[128X[104X
    [4X[25Xgap>[125X [27XHomogeneousCatenaryDegreeOfNumericalSemigroup(s);[127X[104X
    [4X[28X9[128X[104X
  [4X[32X[104X
  
  
  [1X9.6 [33X[0;0YDivisors, posets[133X[101X
  
  [33X[0;0YGiven a numerical semigroup [22XS[122X and two integers [22Xa,b[122X, we write [22Xale_S b[122X if [22Xb-a∈
  S[122X.  We  also say that [22Xa[122X divides [22Xb[122X (with respecto to [22XS[122X). The semigroup [22XS[122X with
  this binary relation is a poset.[133X
  
  [1X9.6-1 MoebiusFunctionAssociatedToNumericalSemigroup[101X
  
  [29X[2XMoebiusFunctionAssociatedToNumericalSemigroup[102X( [3XS[103X, [3Xn[103X ) [32X function
  
  [33X[0;0Y[3XS[103X  is  a numerical semigroup and [3Xn[103X is an integer. As [22X(S,le_S)[122X is a poset, we
  can  define the Möbius function associtate to it as in [CA13]. The output is
  the  value  of  the Möbius function in the integer [3Xn[103X, that is, the alternate
  sum of the number of chains from 0 to [3Xn[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(3,5,7);;[127X[104X
    [4X[25Xgap>[125X [27XMoebiusFunctionAssociatedToNumericalSemigroup(s,10);[127X[104X
    [4X[28X2[128X[104X
    [4X[25Xgap>[125X [27XMoebiusFunctionAssociatedToNumericalSemigroup(s,34);[127X[104X
    [4X[28X25[128X[104X
  [4X[32X[104X
  
