  
  [1XA Generalities[0X
  
  Here  we  describe  some  functions  which  are  not  specific for numerical
  semigroups  but  are  used  to  do  computations with them. As they may have
  interest by themselves, we decribe them here.
  
  
  [1XA.1 Bézout sequences[0X
  
  A  sequence  of  positive  rational  numbers  a_1/b_1 < cdots < a_n/b_n with
  a_i,b_i positive integers is a [13XBézout sequence[0m if a_i+1b_i - a_i b_i+1=1 for
  all iin {1,...,n-1}.
  
  The following function uses an algorithm presented in [BR08].
  
  [1XA.1-1 BezoutSequence[0m
  
  [2X> BezoutSequence( [0X[3Xarg[0X[2X ) ____________________________________________[0Xfunction
  
  [3Xarg[0m  consits  of two rational numbers or a list of two rational numbers. The
  output  is  a  Bézout  sequence  with  ends  the two rational numbers given.
  (Warning:   rational  numbers  are  silently  transformed  into  irreducible
  fractions.)
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> BezoutSequence(4/5,53/27);[0X
    [4X[ 4/5, 1, 3/2, 5/3, 7/4, 9/5, 11/6, 13/7, 15/8, 17/9, 19/10, 21/11, 23/12,[0X
    [4X  25/13, 27/14, 29/15, 31/16, 33/17, 35/18, 37/19, 39/20, 41/21, 43/22,[0X
    [4X  45/23, 47/24, 49/25, 51/26, 53/27 ][0X
    [4X[0X
  [4X------------------------------------------------------------------[0X
  
  [1XA.1-2 IsBezoutSequence[0m
  
  [2X> IsBezoutSequence( [0X[3XL[0X[2X ) ____________________________________________[0Xfunction
  
  [3XL[0m  is  a  list  of  rational numbers. [10XIsBezoutSequence[0m returns [9Xtrue[0m or [9Xfalse[0m
  according to whether [3XL[0m is a Bézout sequence or not.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> IsBezoutSequence([ 4/5, 1, 3/2, 5/3, 7/4, 9/5, 11/6]);[0X
    [4Xtrue[0X
    [4Xgap> IsBezoutSequence([ 4/5, 1, 3/2, 5/3, 7/4, 9/5, 11/3]);[0X
    [4XTake the 6 and the 7 elements of the sequence[0X
    [4Xfalse[0X
  [4X------------------------------------------------------------------[0X
  
  [1XA.1-3 CeilingOfRational[0m
  
  [2X> CeilingOfRational( [0X[3Xr[0X[2X ) ___________________________________________[0Xfunction
  
  Returns the smallest integer greater than or equal to the rational [3Xr[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> CeilingOfRational(3/5);[0X
    [4X1[0X
  [4X------------------------------------------------------------------[0X
  
  
  [1XA.2 Periodic subadditive functions[0X
  
  A  periodic  function  f  of period m from the set N of natural numbers into
  itself  may be specified through a list of m natural numbers. The function f
  is said to be [13Xsubadditive[0m if f(i+j)<= f(i)+f(j) and f(0)=0.
  
  [1XA.2-1 RepresentsPeriodicSubAdditiveFunction[0m
  
  [2X> RepresentsPeriodicSubAdditiveFunction( [0X[3XL[0X[2X ) _______________________[0Xfunction
  
  [3XL[0m  is a list of integers. [10XRepresentsPeriodicSubAdditiveFunction[0m returns [9Xtrue[0m
  or [9Xfalse[0m according to whether [3XL[0m represents a periodic subAdditive function f
  periodic  of  period m or not. To avoid defining f(0) (which we assume to be
  0)  we  define  f(m)=0  and  so the last element of the list must be 0. This
  technical  need is due to the fact that positions in a list must be positive
  (not a 0).
  
  [4X---------------------------  Example  ----------------------------[0X
    [4Xgap> RepresentsPeriodicSubAdditiveFunction([1,2,3,4,0]);[0X
    [4Xtrue[0X
  [4X------------------------------------------------------------------[0X
  
