  
  [1m[4m[31m9. Catenary and Tame degrees of numerical semigroups[0m
  
  
  [1m[4m[31m9.1 Factorizations in Numerical Semigroups[0m
  
  Let  S  be  a  numerical  semigroup  minimally  generated  by m_1,...,m_n. A
  factorization  of  an  element  sin  S  is  an  n-tuple  a=(a_1,...,a_n)  of
  nonnegative  integers  such that n=a_1 n_1+cdots+a_n m_n. The lenght of a is
  |a|=a_1+cdots+a_n.  Given  two  factorizations  a  and  b of n, the distance
  between   a   and   b   is   d(a,b)=max   |a-gcd(a,b)|,|b-gcd(a,b)|,   where
  gcd((a_1,...,a_n),(b_1,...,b_n))=(min(a_1,b_1),...,min(a_n,b_n)).
  
  If  l_1>cdots > l_k are the lenghts of all the factorizations of s in S, the
  Delta set associated to s is Delta(s)=l_1-l_2,...,l_k-l_k-1.
  
  The  catenary  degree of S is the least positive integer c such that for any
  two  factorizations  a  and  b  of  an element in S, there exists a chain of
  factorizations staring in a and ending in b and so that the distance between
  two consecutive links is at most c.
  
  The tame degree of S is the least positive integer t for any factorization a
  of  an  element  s in S, and any i such that s-m_iin S, there exists another
  factorization b of s so that the distance to a is at most t and b_inot = 0.
  
  The  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 [SR06] for numerical semigroup (see [SL]). The
  computation  of the elascitiy of a numerical semigroup reduces to m/n with m
  the  multiplicity  of the semigroup and n its largest minimal generator (see
  [SM] or [GH06]).
  
  [1m[4m[31m9.1-1 FactorizationsElementWRTNumericalSemigroup[0m
  
  [1m[34m> FactorizationsElementWRTNumericalSemigroup( [0m[22m[34mn, S[0m[1m[34m ) _______________[0mfunction
  
  [22m[34mS[0m  is  a  numerical semigroup and [22m[34mn[0m a nonnegative integer. The output is the
  set of factorizations of [22m[34mn[0m in terms of the minimal generating set of [22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> s:=NumericalSemigroup(101,113,196,272,278,286);[0m
    [22m[35m<Numerical semigroup with 6 generators>[0m
    [22m[35mgap> FactorizationsElementWRTNumericalSemigroup(1100,s);[0m
    [22m[35m[ [ 0, 0, 0, 2, 2, 0 ], [ 0, 2, 3, 0, 0, 1 ], [ 0, 8, 1, 0, 0, 0 ],[0m
    [22m[35m  [ 5, 1, 1, 0, 0, 1 ] ][0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.1-2 LengthsOfFactorizationsElementWRTNumericalSemigroup[0m
  
  [1m[34m> LengthsOfFactorizationsElementWRTNumericalSemigroup( [0m[22m[34mn, S[0m[1m[34m ) ______[0mfunction
  
  [22m[34mS[0m  is  a  numerical semigroup and [22m[34mn[0m a nonnegative integer. The output is the
  set of lengths of the factorizations of [22m[34mn[0m in terms of the minimal generating
  set of [22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> s:=NumericalSemigroup(101,113,196,272,278,286);[0m
    [22m[35m<Numerical semigroup with 6 generators>[0m
    [22m[35mgap> LengthsOfFactorizationsElementWRTNumericalSemigroup(1100,s);[0m
    [22m[35m[ 4, 6, 8, 9 ][0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.1-3 ElasticityOfFactorizationsElementWRTNumericalSemigroup[0m
  
  [1m[34m> ElasticityOfFactorizationsElementWRTNumericalSemigroup( [0m[22m[34mn, S[0m[1m[34m ) ___[0mfunction
  
  [22m[34mS[0m  is  a  numerical  semigroup  and  [22m[34mn[0m a positive integer. The output is the
  maximum  length  divided by the minimum length of the factorizations of [22m[34mn[0m in
  terms of the minimal generating set of [22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> s:=NumericalSemigroup(101,113,196,272,278,286);[0m
    [22m[35m<Numerical semigroup with 6 generators>[0m
    [22m[35mgap> ElasticityOfFactorizationsElementWRTNumericalSemigroup(1100,s);[0m
    [22m[35m9/4[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.1-4 ElasticityOfNumericalSemigroup[0m
  
  [1m[34m> ElasticityOfNumericalSemigroup( [0m[22m[34mS[0m[1m[34m ) ______________________________[0mfunction
  
  [22m[34mS[0m is a numerical semigroup. The output is the elasticity of [22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> s:=NumericalSemigroup(101,113,196,272,278,286);[0m
    [22m[35m<Numerical semigroup with 6 generators>[0m
    [22m[35mgap> ElasticityOfNumericalSemigroup(s);[0m
    [22m[35m286/101[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.1-5 DeltaSetOfFactorizationsElementWRTNumericalSemigroup[0m
  
  [1m[34m> DeltaSetOfFactorizationsElementWRTNumericalSemigroup( [0m[22m[34mn, S[0m[1m[34m ) _____[0mfunction
  
  [22m[34mS[0m  is  a  numerical semigroup and [22m[34mn[0m a nonnegative integer. The output is the
  Delta  set of the factorizations of [22m[34mn[0m in terms of the minimal generating set
  of [22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> s:=NumericalSemigroup(101,113,196,272,278,286);[0m
    [22m[35m<Numerical semigroup with 6 generators>[0m
    [22m[35mgap> DeltaSetOfFactorizationsElementWRTNumericalSemigroup(1100,s);[0m
    [22m[35m[ 1, 2 ][0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.1-6 MaximumDegreeOfElementWRTNumericalSemigroup[0m
  
  [1m[34m> MaximumDegreeOfElementWRTNumericalSemigroup( [0m[22m[34mn, S[0m[1m[34m ) ______________[0mfunction
  
  [22m[34mS[0m  is  a  numerical semigroup and [22m[34mn[0m a nonnegative integer. The output is the
  maximum length of the factorizations of [22m[34mn[0m in terms of the minimal generating
  set of [22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> s:=NumericalSemigroup(101,113,196,272,278,286);[0m
    [22m[35m<Numerical semigroup with 6 generators>[0m
    [22m[35mgap> MaximumDegreeOfElementWRTNumericalSemigroup(1100,s);[0m
    [22m[35m9[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.1-7 CatenaryDegreeNumericalSemigroup[0m
  
  [1m[34m> CatenaryDegreeNumericalSemigroup( [0m[22m[34mS[0m[1m[34m ) ____________________________[0mfunction
  
  [22m[34mS[0m is a numerical semigroup. The output is the catenary degree of [22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> s:=NumericalSemigroup(101,113,196,272,278,286);[0m
    [22m[35m<Numerical semigroup with 6 generators>[0m
    [22m[35mgap> CatenaryDegreeNumericalSemigroup(s);[0m
    [22m[35m8[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m9.1-8 TameDegreeNumericalSemigroup[0m
  
  [1m[34m> TameDegreeNumericalSemigroup( [0m[22m[34mS[0m[1m[34m ) ________________________________[0mfunction
  
  [22m[34mS[0m is a numerical semigroup. The output is the tame degree of [22m[34mS[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> s:=NumericalSemigroup(101,113,196,272,278,286);[0m
    [22m[35m<Numerical semigroup with 6 generators>[0m
    [22m[35mgap> TameDegreeNumericalSemigroup(s);[0m
    [22m[35m14[0m
  [22m[35m------------------------------------------------------------------[0m
  
