  
  [1m[4m[31m4. Examples[0m
  
  This  chapter  lists  some "nice" examples of rcwa mappings and -groups. The
  rcwa   mappings  mentioned  in  this  chapter  can  be  found  in  the  file
  [1mpkg/rcwa/examples/examples.g[0m,  so  there is no need to extract them from the
  manual files. This file can be read into the current [1mGAP[0m session by issueing
  [22m[32mRCWAReadExamples( );[0m.
  
  
  [1m[4m[31m4.1 Factoring Collatz' permutation of the integers[0m
  
  In  1932, Lothar Collatz mentioned in his notebook the following permutation
  of the integers:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Collatz := RcwaMapping([[2,0,3],[4,-1,3],[4,1,3]]);;[0m
    [22m[35mgap> SetName(Collatz,"Collatz");[0m
    [22m[35mgap> Display(Collatz);[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 3[0m
    [22m[35m[0m
    [22m[35m                n mod 3                |              n^Collatz[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0                                    | 2n/3[0m
    [22m[35m  1                                    | (4n - 1)/3[0m
    [22m[35m  2                                    | (4n + 1)/3[0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  This  permutation  has  a few finite cycles, but its cycle structure has not
  been  determined  yet.  In  particular  it  is  not  known whether the cycle
  containing 8 is finite or infinite.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> List(ShortOrbits(Group(Collatz),[-100..100],100),[0m
    [22m[35m>         orb->Cycle(Collatz,Minimum(orb)));[0m
    [22m[35m[ [ -111, -74, -99, -66, -44, -59, -79, -105, -70, -93, -62, -83 ], [0m
    [22m[35m  [ -9, -6, -4, -5, -7 ], [ -3, -2 ], [ -1 ], [ 0 ], [ 1 ], [ 2, 3 ], [0m
    [22m[35m  [ 4, 5, 7, 9, 6 ], [ 44, 59, 79, 105, 70, 93, 62, 83, 111, 74, 99, 66 ] ][0m
    [22m[35mgap> List(last,Length);[0m
    [22m[35m[ 12, 5, 2, 1, 1, 1, 2, 5, 12 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Nevertheless,  the  factorization  routine  included  in  this  package  can
  determine a factorization of this permutation into involutions interchanging
  two  disjoint  residue  classes,  each (for reasons of saving a bit space in
  this  manual,  we  factor  the  inverse  mapping instead and revert the list
  afterwards):
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> RCWAInfo(2); # Switch Info output on.[0m
    [22m[35mgap> Reversed(FactorizationIntoGenerators(Collatz^-1:ExpandPrimeSwitches));[0m
    [22m[35m#I  Modulus(<g>) = 4, Multiplier(<g>) = 3, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by PrimeSwitch(3) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 16, Multiplier(<g>) = 3, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by PrimeSwitch(3) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 6, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by PrimeSwitch(3) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 12, Divisor(<g>) = 12[0m
    [22m[35m#I  p = 3, kmult = 1, kdiv = 1[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 3(6), 5(12), 7(12), 8(12), 0(48) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 6(8) ][0m
    [22m[35m#I  Found 5 pairs.[0m
    [22m[35m#I  After filtering and splitting: 5 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(3,6,6,8) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 12, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(6,8,5,12) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 12, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(6,8,7,12) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 12, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(6,8,8,12) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 12, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(6,8,0,48) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 6, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by PrimeSwitch(3) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 12, Divisor(<g>) = 12[0m
    [22m[35m#I  p = 3, kmult = 1, kdiv = 1[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 7(12), 8(12), 0(96) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 6(8) ][0m
    [22m[35m#I  Found 3 pairs.[0m
    [22m[35m#I  After filtering and splitting: 3 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(6,8,7,12) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 12, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(6,8,8,12) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 12, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(6,8,0,96) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 12, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by PrimeSwitch(3) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 24, Divisor(<g>) = 12[0m
    [22m[35m#I  p = 3, kmult = 1, kdiv = 1[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 7(12), 0(192) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 2(4) ][0m
    [22m[35m#I  Found 2 pairs.[0m
    [22m[35m#I  After filtering and splitting: 2 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(2,4,7,12) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 24, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(2,4,0,192) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 24, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by PrimeSwitch(3) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 48, Divisor(<g>) = 12[0m
    [22m[35m#I  p = 3, kmult = 1, kdiv = 1[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 0(384) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 2(4) ][0m
    [22m[35m#I  Found 1 pairs.[0m
    [22m[35m#I  After filtering and splitting: 1 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(2,4,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 128, Divisor(<g>) = 4[0m
    [22m[35m#I  p = 2, kmult = 7, kdiv = 2[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 384(1536) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 2(4), 3(6), 1(12), 11(12) ][0m
    [22m[35m#I  Found 3 pairs.[0m
    [22m[35m#I  After filtering and splitting: 5 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(2,12,384,1536) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 32, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(1,12,384,1536) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 32, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(6,12,384,1536) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 32, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(10,12,384,1536) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 32, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(11,12,384,1536) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 32, Divisor(<g>) = 4[0m
    [22m[35m#I  p = 2, kmult = 5, kdiv = 2[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 0(384) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 3(6), 1(12), 6(12), 10(12), 11(12) ][0m
    [22m[35m#I  Found 4 pairs.[0m
    [22m[35m#I  After filtering and splitting: 4 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(1,12,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 16, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(6,12,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 16, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(10,12,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 16, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(11,12,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 16, Divisor(<g>) = 4[0m
    [22m[35m#I  p = 2, kmult = 4, kdiv = 2[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 48(192), 192(384) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 3(6), 6(12), 10(12), 11(12) ][0m
    [22m[35m#I  Found 3 pairs.[0m
    [22m[35m#I  After filtering and splitting: 3 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(6,12,48,192) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 16, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(10,12,48,192) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 16, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(11,12,48,192) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 48, Multiplier(<g>) = 16, Divisor(<g>) = 4[0m
    [22m[35m#I  p = 2, kmult = 4, kdiv = 2[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 192(384) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 3(6), 10(12), 11(12) ][0m
    [22m[35m#I  Splitting classes being divided by q*p^kdiv.[0m
    [22m[35m#I  Found 4 pairs.[0m
    [22m[35m#I  After filtering and splitting: 4 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(10,24,192,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 96, Multiplier(<g>) = 8, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(11,24,192,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 96, Multiplier(<g>) = 8, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(22,24,192,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 96, Multiplier(<g>) = 8, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(23,24,192,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 96, Multiplier(<g>) = 8, Divisor(<g>) = 4[0m
    [22m[35m#I  p = 2, kmult = 3, kdiv = 2[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 72(96), 96(192), 0(384) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 3(6), 11(12), 22(24) ][0m
    [22m[35m#I  Found 2 pairs.[0m
    [22m[35m#I  After filtering and splitting: 2 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(11,12,72,96) from the right.[0m
    [22m[35m#I  Dividing by ClassTransposition(22,24,96,192) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 96, Multiplier(<g>) = 8, Divisor(<g>) = 4[0m
    [22m[35m#I  p = 2, kmult = 3, kdiv = 2[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 0(384) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 3(6) ][0m
    [22m[35m#I  Splitting classes being divided by q*p^kdiv.[0m
    [22m[35m#I  Splitting classes being divided by q*p^kdiv.[0m
    [22m[35m#I  Splitting classes being divided by q*p^kdiv.[0m
    [22m[35m#I  Found 8 pairs.[0m
    [22m[35m#I  After filtering and splitting: 8 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(3,48,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 4, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(9,48,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 4, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(15,48,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 4, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(21,48,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 4, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(27,48,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 4, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(33,48,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 4, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(39,48,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 4, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(45,48,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 4, Divisor(<g>) = 4[0m
    [22m[35m#I  p = 2, kmult = 2, kdiv = 2[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 44(48), 48(96), 192(384) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 9(12), 15(24), 27(48) ][0m
    [22m[35m#I  Found 2 pairs.[0m
    [22m[35m#I  After filtering and splitting: 2 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(9,12,44,48) from the right.[0m
    [22m[35m#I  Dividing by ClassTransposition(15,24,48,96) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 4, Divisor(<g>) = 4[0m
    [22m[35m#I  p = 2, kmult = 2, kdiv = 2[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 192(384) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 27(48) ][0m
    [22m[35m#I  Splitting classes being divided by q*p^kdiv.[0m
    [22m[35m#I  Found 2 pairs.[0m
    [22m[35m#I  After filtering and splitting: 2 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(27,96,192,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 384, Multiplier(<g>) = 2, Divisor(<g>) = 4[0m
    [22m[35m#I  Dividing by ClassTransposition(75,96,192,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 384, Multiplier(<g>) = 2, Divisor(<g>) = 4[0m
    [22m[35m#I  p = 2, kmult = 1, kdiv = 2[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 4(24), 17(24), 24(48), 96(192), 0(384) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 75(96) ][0m
    [22m[35m#I  Found 1 pairs.[0m
    [22m[35m#I  After filtering and splitting: 1 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(75,96,0,384) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 2, Divisor(<g>) = 2[0m
    [22m[35m#I  p = 2, kmult = 1, kdiv = 1[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 4(24), 17(24), 24(48), 96(192) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 7(12), 5(24), 12(24), 16(24), 75(96) ][0m
    [22m[35m#I  Found 6 pairs.[0m
    [22m[35m#I  After filtering and splitting: 6 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(7,12,4,24) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 2, Divisor(<g>) = 2[0m
    [22m[35m#I  Dividing by ClassTransposition(7,12,17,24) from the right.[0m
    [22m[35m#I  Dividing by ClassTransposition(5,24,24,48) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 2, Divisor(<g>) = 2[0m
    [22m[35m#I  Dividing by ClassTransposition(12,24,24,48) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 192, Multiplier(<g>) = 2, Divisor(<g>) = 2[0m
    [22m[35m#I  Dividing by ClassTransposition(16,24,24,48) from the right.[0m
    [22m[35m#I  Dividing by ClassTransposition(75,96,96,192) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 96, Multiplier(<g>) = 2, Divisor(<g>) = 2[0m
    [22m[35m#I  p = 2, kmult = 1, kdiv = 1[0m
    [22m[35m#I  Image of classes being multiplied by q*p^kmult:[0m
    [22m[35m#I  [ 17(24) ][0m
    [22m[35m#I  Image of classes being divided by q*p^kdiv:[0m
    [22m[35m#I  [ 12(24), 16(24) ][0m
    [22m[35m#I  Splitting classes being multiplied by q*p^kmult.[0m
    [22m[35m#I  Found 4 pairs.[0m
    [22m[35m#I  After filtering and splitting: 4 pairs.[0m
    [22m[35m#I  Dividing by ClassTransposition(12,24,17,48) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 96, Multiplier(<g>) = 2, Divisor(<g>) = 2[0m
    [22m[35m#I  Dividing by ClassTransposition(16,24,17,48) from the right.[0m
    [22m[35m#I  Dividing by ClassTransposition(12,24,41,48) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 96, Multiplier(<g>) = 2, Divisor(<g>) = 2[0m
    [22m[35m#I  Dividing by ClassTransposition(16,24,41,48) from the right.[0m
    [22m[35m#I  Modulus(<g>) = 96, Multiplier(<g>) = 1, Divisor(<g>) = 1[0m
    [22m[35m#I  Determining largest sources of affine mappings.[0m
    [22m[35m#I  Computing respected partition.[0m
    [22m[35m#I  Computing induced permutation on respected partition [0m
    [22m[35m[ 12(24), 14(24), 18(24), 13(48), 22(48), 23(48), 28(48), 31(48), 32(48), [0m
    [22m[35m  33(48), 34(48), 35(48), 39(48), 44(48), 45(48), 0(96), 1(96), 2(96), 3(96), [0m
    [22m[35m  4(96), 5(96), 6(96), 7(96), 8(96), 9(96), 10(96), 11(96), 15(96), 16(96), [0m
    [22m[35m  17(96), 19(96), 20(96), 21(96), 24(96), 25(96), 26(96), 27(96), 29(96), [0m
    [22m[35m  30(96), 37(96), 40(96), 41(96), 43(96), 46(96), 47(96), 48(96), 49(96), [0m
    [22m[35m  50(96), 51(96), 52(96), 53(96), 54(96), 55(96), 56(96), 57(96), 58(96), [0m
    [22m[35m  59(96), 63(96), 64(96), 65(96), 67(96), 68(96), 69(96), 72(96), 73(96), [0m
    [22m[35m  74(96), 75(96), 77(96), 78(96), 85(96), 88(96), 89(96), 91(96), 94(96), [0m
    [22m[35m  95(96) ].[0m
    [22m[35m#I  Factoring the rest into class shifts.[0m
    [22m[35m#I  Checking the result.[0m
    [22m[35m[ ClassTransposition(4,6,7,12), ClassTransposition(2,6,1,12), [0m
    [22m[35m  ClassTransposition(2,4,5,6), ClassTransposition(0,4,1,6), [0m
    [22m[35m  ClassTransposition(5,6,4,8), ClassTransposition(1,6,0,8), [0m
    [22m[35m  ClassTransposition(4,6,7,12), ClassTransposition(2,6,1,12), [0m
    [22m[35m  ClassTransposition(2,4,5,6), ClassTransposition(0,4,1,6), [0m
    [22m[35m  ClassTransposition(5,6,4,8), ClassTransposition(1,6,0,8), [0m
    [22m[35m  ClassTransposition(4,6,7,12), ClassTransposition(2,6,1,12), [0m
    [22m[35m  ClassTransposition(2,4,5,6), ClassTransposition(0,4,1,6), [0m
    [22m[35m  ClassTransposition(5,6,4,8), ClassTransposition(1,6,0,8), [0m
    [22m[35m  ClassTransposition(3,6,6,8), ClassTransposition(6,8,5,12), [0m
    [22m[35m  ClassTransposition(6,8,7,12), ClassTransposition(6,8,8,12), [0m
    [22m[35m  ClassTransposition(6,8,0,48), ClassTransposition(4,6,7,12), [0m
    [22m[35m  ClassTransposition(2,6,1,12), ClassTransposition(2,4,5,6), [0m
    [22m[35m  ClassTransposition(0,4,1,6), ClassTransposition(5,6,4,8), [0m
    [22m[35m  ClassTransposition(1,6,0,8), ClassTransposition(6,8,7,12), [0m
    [22m[35m  ClassTransposition(6,8,8,12), ClassTransposition(6,8,0,96), [0m
    [22m[35m  ClassTransposition(4,6,7,12), ClassTransposition(2,6,1,12), [0m
    [22m[35m  ClassTransposition(2,4,5,6), ClassTransposition(0,4,1,6), [0m
    [22m[35m  ClassTransposition(5,6,4,8), ClassTransposition(1,6,0,8), [0m
    [22m[35m  ClassTransposition(2,4,7,12), ClassTransposition(2,4,0,192), [0m
    [22m[35m  ClassTransposition(4,6,7,12), ClassTransposition(2,6,1,12), [0m
    [22m[35m  ClassTransposition(2,4,5,6), ClassTransposition(0,4,1,6), [0m
    [22m[35m  ClassTransposition(5,6,4,8), ClassTransposition(1,6,0,8), [0m
    [22m[35m  ClassTransposition(2,4,0,384), ClassTransposition(2,12,384,1536), [0m
    [22m[35m  ClassTransposition(1,12,384,1536), ClassTransposition(6,12,384,1536), [0m
    [22m[35m  ClassTransposition(10,12,384,1536), ClassTransposition(11,12,384,1536), [0m
    [22m[35m  ClassTransposition(1,12,0,384), ClassTransposition(6,12,0,384), [0m
    [22m[35m  ClassTransposition(10,12,0,384), ClassTransposition(11,12,0,384), [0m
    [22m[35m  ClassTransposition(6,12,48,192), ClassTransposition(10,12,48,192), [0m
    [22m[35m  ClassTransposition(11,12,48,192), ClassTransposition(10,24,192,384), [0m
    [22m[35m  ClassTransposition(11,24,192,384), ClassTransposition(22,24,192,384), [0m
    [22m[35m  ClassTransposition(23,24,192,384), ClassTransposition(11,12,72,96), [0m
    [22m[35m  ClassTransposition(22,24,96,192), ClassTransposition(3,48,0,384), [0m
    [22m[35m  ClassTransposition(9,48,0,384), ClassTransposition(15,48,0,384), [0m
    [22m[35m  ClassTransposition(21,48,0,384), ClassTransposition(27,48,0,384), [0m
    [22m[35m  ClassTransposition(33,48,0,384), ClassTransposition(39,48,0,384), [0m
    [22m[35m  ClassTransposition(45,48,0,384), ClassTransposition(9,12,44,48), [0m
    [22m[35m  ClassTransposition(15,24,48,96), ClassTransposition(27,96,192,384), [0m
    [22m[35m  ClassTransposition(75,96,192,384), ClassTransposition(75,96,0,384), [0m
    [22m[35m  ClassTransposition(7,12,4,24), ClassTransposition(7,12,17,24), [0m
    [22m[35m  ClassTransposition(5,24,24,48), ClassTransposition(12,24,24,48), [0m
    [22m[35m  ClassTransposition(16,24,24,48), ClassTransposition(75,96,96,192), [0m
    [22m[35m  ClassTransposition(12,24,17,48), ClassTransposition(16,24,17,48), [0m
    [22m[35m  ClassTransposition(12,24,41,48), ClassTransposition(16,24,41,48), [0m
    [22m[35m  ClassTransposition(3,96,43,96), ClassTransposition(3,96,40,96), [0m
    [22m[35m  ClassTransposition(3,96,26,96), ClassTransposition(3,96,30,96), [0m
    [22m[35m  ClassTransposition(3,96,24,96), ClassTransposition(3,96,25,96), [0m
    [22m[35m  ClassTransposition(3,96,29,96), ClassTransposition(3,96,11,96), [0m
    [22m[35m  ClassTransposition(3,96,10,96), ClassTransposition(3,96,15,96), [0m
    [22m[35m  ClassTransposition(3,96,27,96), ClassTransposition(3,96,51,96), [0m
    [22m[35m  ClassTransposition(3,96,91,96), ClassTransposition(3,96,88,96), [0m
    [22m[35m  ClassTransposition(3,96,74,96), ClassTransposition(3,96,78,96), [0m
    [22m[35m  ClassTransposition(3,96,72,96), ClassTransposition(3,96,73,96), [0m
    [22m[35m  ClassTransposition(3,96,77,96), ClassTransposition(3,96,59,96), [0m
    [22m[35m  ClassTransposition(3,96,58,96), ClassTransposition(3,96,63,96), [0m
    [22m[35m  ClassTransposition(3,96,75,96), ClassTransposition(0,96,95,96), [0m
    [22m[35m  ClassTransposition(0,96,94,96), ClassTransposition(0,96,85,96), [0m
    [22m[35m  ClassTransposition(0,96,89,96), ClassTransposition(0,96,49,96), [0m
    [22m[35m  ClassTransposition(0,96,53,96), ClassTransposition(0,96,57,96), [0m
    [22m[35m  ClassTransposition(0,96,56,96), ClassTransposition(0,96,55,96), [0m
    [22m[35m  ClassTransposition(0,96,52,96), ClassTransposition(0,96,69,96), [0m
    [22m[35m  ClassTransposition(0,96,68,96), ClassTransposition(0,96,65,96), [0m
    [22m[35m  ClassTransposition(0,96,67,96), ClassTransposition(0,96,64,96), [0m
    [22m[35m  ClassTransposition(0,96,50,96), ClassTransposition(0,96,54,96), [0m
    [22m[35m  ClassTransposition(0,96,48,96), ClassTransposition(0,96,47,96), [0m
    [22m[35m  ClassTransposition(0,96,46,96), ClassTransposition(0,96,37,96), [0m
    [22m[35m  ClassTransposition(0,96,41,96), ClassTransposition(0,96,1,96), [0m
    [22m[35m  ClassTransposition(0,96,5,96), ClassTransposition(0,96,9,96), [0m
    [22m[35m  ClassTransposition(0,96,8,96), ClassTransposition(0,96,7,96), [0m
    [22m[35m  ClassTransposition(0,96,4,96), ClassTransposition(0,96,21,96), [0m
    [22m[35m  ClassTransposition(0,96,20,96), ClassTransposition(0,96,17,96), [0m
    [22m[35m  ClassTransposition(0,96,19,96), ClassTransposition(0,96,16,96), [0m
    [22m[35m  ClassTransposition(0,96,2,96), ClassTransposition(0,96,6,96), [0m
    [22m[35m  ClassTransposition(13,48,35,48), ClassTransposition(13,48,34,48), [0m
    [22m[35m  ClassTransposition(13,48,39,48), ClassTransposition(13,48,33,48), [0m
    [22m[35m  ClassTransposition(13,48,32,48), ClassTransposition(13,48,31,48), [0m
    [22m[35m  ClassTransposition(13,48,28,48), ClassTransposition(13,48,45,48), [0m
    [22m[35m  ClassTransposition(13,48,44,48), ClassTransposition(13,48,23,48), [0m
    [22m[35m  ClassTransposition(13,48,22,48), ClassTransposition(12,24,14,24), [0m
    [22m[35m  ClassTransposition(12,24,18,24) ][0m
    [22m[35mgap> Product(last) = Collatz; # Check the result.[0m
    [22m[35mtrue[0m
    [22m[35mgap> Length(last2);[0m
    [22m[35m159[0m
    [22m[35mgap> RCWAInfo(0); # Switch Info output off again.[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  See  the  end of Section [1m4.6[0m for a much smaller factorization task performed
  "manually" for purposes of illustration.
  
  
  [1m[4m[31m4.2 An rcwa mapping which seems to be contracting, but very slow[0m
  
  The  iterates of an integer under the Collatz mapping T seem to approach its
  contraction  centre  -- this is the finite set where all trajectories end up
  after  a  finite number of steps -- rather quickly and do not get very large
  before  doing  so  (of  course  this  is a purely heuristic statement as the
  Collatz conjecture has not been proved so far!):
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> T := RcwaMapping([[1,0,2],[3,1,2]]);;[0m
    [22m[35mgap> S0 := LikelyContractionCentre(T,100,1000);[0m
    [22m[35m#I  Warning: `LikelyContractionCentre' is highly probabilistic.[0m
    [22m[35mThe returned result can only be regarded as a rough guess.[0m
    [22m[35mSee ?LikelyContractionCentre for information on how to improve this guess.[0m
    [22m[35m[ -136, -91, -82, -68, -61, -55, -41, -37, -34, -25, -17, -10, -7, -5, -1, 0, [0m
    [22m[35m  1, 2 ][0m
    [22m[35mgap> S0^T = S0; # This holds by definition of the contraction centre.[0m
    [22m[35mtrue[0m
    [22m[35mgap> Trajectory(T,27,S0,"stop");[0m
    [22m[35m[ 27, 41, 62, 31, 47, 71, 107, 161, 242, 121, 182, 91, 137, 206, 103, 155, [0m
    [22m[35m  233, 350, 175, 263, 395, 593, 890, 445, 668, 334, 167, 251, 377, 566, 283, [0m
    [22m[35m  425, 638, 319, 479, 719, 1079, 1619, 2429, 3644, 1822, 911, 1367, 2051, [0m
    [22m[35m  3077, 4616, 2308, 1154, 577, 866, 433, 650, 325, 488, 244, 122, 61, 92, 46, [0m
    [22m[35m  23, 35, 53, 80, 40, 20, 10, 5, 8, 4, 2 ][0m
    [22m[35mgap> List([1..40],n->Length(Trajectory(T,n,S0,"stop")));[0m
    [22m[35m[ 1, 1, 5, 2, 4, 6, 11, 3, 13, 5, 10, 7, 7, 12, 12, 4, 9, 14, 14, 6, 6, 11, [0m
    [22m[35m  11, 8, 16, 8, 70, 13, 13, 13, 67, 5, 18, 10, 10, 15, 15, 15, 23, 7 ][0m
    [22m[35mgap> Maximum(List([1..1000],n->Length(Trajectory(T,n,S0,"stop"))));[0m
    [22m[35m113[0m
    [22m[35mgap> Maximum(List([1..1000],n->Maximum(Trajectory(T,n,S0,"stop"))));[0m
    [22m[35m125252[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  The following mapping also seems to be contracting, but its trajectories are
  much longer:
  
  [22m[35m-----------------------------  Log  ------------------------------[0m
    [22m[35m[0m
    [22m[35mgap> f6 := RcwaMapping([[ 1,0,6],[ 5, 1,6],[ 7,-2,6],[0m
    [22m[35m>                       [11,3,6],[11,-2,6],[11,-1,6]]);;[0m
    [22m[35mgap> SetName(f6,"f6");[0m
    [22m[35mgap> Display(f6);[0m
    [22m[35m[0m
    [22m[35mIntegral rcwa mapping with modulus 6[0m
    [22m[35m[0m
    [22m[35m                n mod 6                |                 n^f6[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0                                    | n/6[0m
    [22m[35m  1                                    | (5n + 1)/6[0m
    [22m[35m  2                                    | (7n - 2)/6[0m
    [22m[35m  3                                    | (11n + 3)/6[0m
    [22m[35m  4                                    | (11n - 2)/6[0m
    [22m[35m  5                                    | (11n - 1)/6[0m
    [22m[35m[0m
    [22m[35mgap> S0 := LikelyContractionCentre(f6,1000,100000);;[0m
    [22m[35m#I  Warning: `LikelyContractionCentre' is highly probabilistic.[0m
    [22m[35mThe returned result can only be regarded as a rough guess.[0m
    [22m[35mgap> Trajectory(f6,25,S0,"stop");[0m
    [22m[35m[ 25, 21, 39, 72, 12, 2 ][0m
    [22m[35mgap> List([1..100],n->Length(Trajectory(f6,n,S0,"stop")));[0m
    [22m[35m[ 2, 2, 3, 4, 2, 2, 3, 2, 2, 5, 7, 2, 8, 17, 3, 16, 2, 4, 17, 6, 5, 2, 5, 5, [0m
    [22m[35m  6, 2, 4, 2, 15, 2, 2, 3, 2, 5, 13, 3, 2, 3, 4, 2, 8, 4, 4, 2, 7, 19, 23517, [0m
    [22m[35m  3, 9, 3, 2, 18, 14, 2, 20, 23512, 14, 2, 6, 6, 2, 4, 19, 12, 23511, 8, [0m
    [22m[35m  23513, 10, 2, 13, 13, 3, 2, 23517, 7, 20, 7, 9, 9, 6, 12, 8, 6, 18, 14, [0m
    [22m[35m  23516, 31, 12, 23545, 4, 21, 19, 5, 2, 17, 17, 13, 19, 6, 23515 ][0m
    [22m[35mgap> Maximum(Trajectory(f6,47,S0,"stop"));;[0m
    [22m[35m736339177776247330443187705477107581873369010805146980871580925673774229545698\[0m
    [22m[35m886054[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Computing  the  trajectory  of  3224  takes quite a while -- this trajectory
  ascends  to  about 3 * 10^2197, before it approaches the fixed point2 after
  19949562 steps.
  
  When  constructing  the mapping [22m[32mf6[0m, the denominators of the partial mappings
  have  been  chosen  to  be  equal  and the numerators have been chosen to be
  numbers  coprime  to  the common denominator, whose product is just a little
  bit  smaller than the [22m[32mModulus(f6)[0mth power of the denominator. In the example
  we have 5 * 7 * 11^3 = 46585 and 6^6 = 46656.
  
  Although  the  trajectories of [22m[32mT[0m are much shorter than those of [22m[32mf6[0m, it seems
  likely that this does not make the problem of deciding whether the mapping[22m[32mT[0m
  is  contracting  essentially  easier  -- even for mappings with much shorter
  trajectories  than[22m[32mT[0m  the  problem  seems to be equally hard. A solution can
  usually  only be found in trivial cases, i.e. for example when there is some
  k  such that applying the kth power of the respective mapping to any integer
  decreases its absolute value.
  
  
  [1m[4m[31m4.3 Checking a result by P. Andaloro[0m
  
  In [A00], P.Andaloro has shown that proving that trajectories of integers n
  in  1(16) under the Collatz mapping always end up with1 would be sufficient
  for  proving  the Collatz conjecture. In the sequel, this result is verified
  with  [1mRCWA[0m. Checking that the union of the images of the residue class 1(16)
  under  powers  of  the  Collatz  mappingT  contains  Z  \ 0(3) is obviously
  sufficient.  Thus  we proceed by setting S := 1(16) and successively uniting
  the set S with its image underT:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> S := ResidueClass(Integers,16,1);[0m
    [22m[35m1(16)[0m
    [22m[35mgap> S := Union(S,S^T);[0m
    [22m[35m1(16) U 2(24)[0m
    [22m[35mgap> S := Union(S,S^T);[0m
    [22m[35m1(12) U 2(24) U 17(48) U 33(48)[0m
    [22m[35mgap> S := Union(S,S^T);[0m
    [22m[35m<union of 30 residue classes (mod 144)>[0m
    [22m[35mgap> S := Union(S,S^T);[0m
    [22m[35m<union of 42 residue classes (mod 144)>[0m
    [22m[35mgap> S := Union(S,S^T);[0m
    [22m[35m<union of 172 residue classes (mod 432)>[0m
    [22m[35mgap> S := Union(S,S^T);[0m
    [22m[35m<union of 676 residue classes (mod 1296)>[0m
    [22m[35mgap> S := Union(S,S^T);[0m
    [22m[35m<union of 810 residue classes (mod 1296)>[0m
    [22m[35mgap> S := Union(S,S^T);[0m
    [22m[35m<union of 2638 residue classes (mod 3888)>[0m
    [22m[35mgap> S := Union(S,S^T);[0m
    [22m[35m<union of 33 residue classes (mod 48)>[0m
    [22m[35mgap> S := Union(S,S^T);[0m
    [22m[35m<union of 33 residue classes (mod 48)>[0m
    [22m[35mgap> Union(S,ResidueClass(Integers,3,0)); # Et voila ...[0m
    [22m[35mIntegers[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Further similar computations are shown in Section[1m4.14[0m.
  
  
  [1m[4m[31m4.4 Two examples by Matthews and Leigh[0m
  
  In  [ML87],  K.R.Matthews and G.M.Leigh have shown that two trajectories
  of  the  following  (surjective,  but  not  injective)  mappings are acyclic
  (modx) and divergent:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> x := Indeterminate(GF(4),1);; SetName(x,"x");[0m
    [22m[35mgap> R := PolynomialRing(GF(2),1);[0m
    [22m[35mGF(2)[x][0m
    [22m[35mgap> ML1 := RcwaMapping(R,x,[[1,0,x],[(x+1)^3,1,x]]*One(R));;[0m
    [22m[35mgap> ML2 := RcwaMapping(R,x,[[1,0,x],[(x+1)^2,1,x]]*One(R));;[0m
    [22m[35mgap> SetName(ML1,"ML1"); SetName(ML2,"ML2");[0m
    [22m[35mgap> Display(ML1);[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of GF(2)[x] with modulus x[0m
    [22m[35m[0m
    [22m[35m         P mod x          |                       P^ML1[0m
    [22m[35m--------------------------+---------------------------------------------------[0m
    [22m[35m 0*Z(2)                   | P/x[0m
    [22m[35m Z(2)^0                   | ((x^3+x^2+x+Z(2)^0)*P + Z(2)^0)/x[0m
    [22m[35m[0m
    [22m[35mgap> Display(ML2);[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of GF(2)[x] with modulus x[0m
    [22m[35m[0m
    [22m[35m         P mod x          |                       P^ML2[0m
    [22m[35m--------------------------+---------------------------------------------------[0m
    [22m[35m 0*Z(2)                   | P/x[0m
    [22m[35m Z(2)^0                   | ((x^2+Z(2)^0)*P + Z(2)^0)/x[0m
    [22m[35m[0m
    [22m[35mgap> List([ML1,ML2],IsSurjective);[0m
    [22m[35m[ true, true ][0m
    [22m[35mgap> List([ML1,ML2],IsInjective);[0m
    [22m[35m[ false, false ][0m
    [22m[35mgap> traj1 := Trajectory(ML1,One(R),16,"length");[0m
    [22m[35m[ Z(2)^0, x^2+x+Z(2)^0, x^4+x^2+x, x^3+x+Z(2)^0, x^5+x^4+x^2, x^4+x^3+x, [0m
    [22m[35m  x^3+x^2+Z(2)^0, x^5+x^2+Z(2)^0, x^7+x^6+x^5+x^3+Z(2)^0, [0m
    [22m[35m  x^9+x^7+x^6+x^5+x^3+x+Z(2)^0, x^11+x^10+x^8+x^7+x^6+x^5+x^2, [0m
    [22m[35m  x^10+x^9+x^7+x^6+x^5+x^4+x, x^9+x^8+x^6+x^5+x^4+x^3+Z(2)^0, [0m
    [22m[35m  x^11+x^8+x^7+x^6+x^4+x+Z(2)^0, x^13+x^12+x^11+x^8+x^7+x^6+x^4, [0m
    [22m[35m  x^12+x^11+x^10+x^7+x^6+x^5+x^3 ][0m
    [22m[35mgap> traj2 := Trajectory(ML2,(x^3+x+1)*One(R),16,"length");[0m
    [22m[35m[ x^3+x+Z(2)^0, x^4+x+Z(2)^0, x^5+x^3+x^2+x+Z(2)^0, x^6+x^3+Z(2)^0, [0m
    [22m[35m  x^7+x^5+x^4+x^2+x, x^6+x^4+x^3+x+Z(2)^0, x^7+x^4+x^3+x+Z(2)^0, [0m
    [22m[35m  x^8+x^6+x^5+x^4+x^3+x+Z(2)^0, x^9+x^6+x^3+x+Z(2)^0, [0m
    [22m[35m  x^10+x^8+x^7+x^5+x^4+x+Z(2)^0, x^11+x^8+x^7+x^5+x^4+x^3+x^2+x+Z(2)^0, [0m
    [22m[35m  x^12+x^10+x^9+x^8+x^7+x^5+Z(2)^0, x^13+x^10+x^7+x^4+x, [0m
    [22m[35m  x^12+x^9+x^6+x^3+Z(2)^0, x^13+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x, [0m
    [22m[35m  x^12+x^10+x^9+x^7+x^6+x^4+x^3+x+Z(2)^0 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  The  pattern  which  Matthews  and  Leigh used to show the divergence of the
  above  trajectories can be recognized easily by looking at the corresponding
  Markov chains with the two states 0modx and 1modx:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> traj1modx := Trajectory(ML1,One(R),400,"length") mod x;;[0m
    [22m[35mgap> traj2modx := Trajectory(ML2,(x^3+x+1)*One(R),600,"length") mod x;;[0m
    [22m[35mgap> List(traj1modx{[1..200]},val->Position([Zero(R),One(R)],val)-1);[0m
    [22m[35m[ 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, [0m
    [22m[35m  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, [0m
    [22m[35m  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, [0m
    [22m[35m  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ][0m
    [22m[35mgap> List(traj2modx{[1..200]},val->Position([Zero(R),One(R)],val)-1);[0m
    [22m[35m[ 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, [0m
    [22m[35m  1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, [0m
    [22m[35m  0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  What  is important here are the lengths of the intervals between two changes
  from one state to the other:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> ChangePoints := l -> Filtered([1..Length(l)-1],pos->l[pos]<>l[pos+1]);;[0m
    [22m[35mgap> Diffs := l -> List([1..Length(l)-1],pos->l[pos+1]-l[pos]);;[0m
    [22m[35mgap> Diffs(ChangePoints(traj1modx)); # The pattern in the first ...[0m
    [22m[35m[ 1, 1, 2, 4, 2, 2, 4, 8, 4, 4, 8, 16, 8, 8, 16, 32, 16, 16, 32, 64, 32, 32, [0m
    [22m[35m  64 ][0m
    [22m[35mgap> Diffs(ChangePoints(traj2modx)); # ... and in the second example.[0m
    [22m[35m[ 1, 7, 1, 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, 25, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 49, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 97, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 193, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, [0m
    [22m[35m  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ][0m
    [22m[35mgap> Diffs(ChangePoints(last)); # Make this a bit more obvious.[0m
    [22m[35m[ 1, 3, 1, 7, 1, 15, 1, 31, 1, 63, 1 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  This  looks  clearly acyclic, thus the trajectories diverge. Needless to say
  however  that  this  computational evidence does not replace the proof along
  these  lines given in the article cited above, but just sheds a light on the
  idea behind it.
  
  
  [1m[4m[31m4.5 Exploring the structure of a wild rcwa group[0m
  
  In  this  example,  a  simple  attempt  to should be made to investigate the
  structure  of  a  given wild group by finding orders of torsion elements. In
  general,  determining  the  structure  of a given wild group computationally
  seems  to be a very hard task. First of all, the group in question has to be
  defined:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> u := RcwaMapping([[3,0,5],[9,1,5],[3,-1,5],[9,-2,5],[9,4,5]]);;[0m
    [22m[35mgap> SetName(u,"u");[0m
    [22m[35mgap> Display(u);[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 5[0m
    [22m[35m[0m
    [22m[35m                n mod 5                |                 n^u[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0                                    | 3n/5[0m
    [22m[35m  1                                    | (9n + 1)/5[0m
    [22m[35m  2                                    | (3n - 1)/5[0m
    [22m[35m  3                                    | (9n - 2)/5[0m
    [22m[35m  4                                    | (9n + 4)/5[0m
    [22m[35m[0m
    [22m[35mgap> nu := RcwaMapping([[1,1,1]]);[0m
    [22m[35mRcwa mapping of Z: n -> n + 1[0m
    [22m[35mgap> SetName(nu,"nu");[0m
    [22m[35mgap> G := Group(u,nu);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> IsTame(G);[0m
    [22m[35mfalse[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Now  we  would  like  to know which orders torsion elements of[22m[32mG[0m can have --
  taking  a  look  at  the  above  generators  it  seems  to make sense to try
  commutators:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> l := Filtered([0..100],k->IsTame(Comm(u,nu^k)));[0m
    [22m[35m[ 0, 2, 3, 5, 6, 9, 10, 12, 13, 15, 17, 18, 20, 21, 24, 25, 27, 28, 30, 32, [0m
    [22m[35m  33, 35, 36, 39, 40, 42, 43, 45, 47, 48, 50, 51, 54, 55, 57, 58, 60, 62, 63, [0m
    [22m[35m  65, 66, 69, 70, 72, 73, 75, 77, 78, 80, 81, 84, 85, 87, 88, 90, 92, 93, 95, [0m
    [22m[35m  96, 99, 100 ][0m
    [22m[35mgap> List(l,k->Order(Comm(u,nu^k)));[0m
    [22m[35m[ 1, 6, 5, 3, 5, 5, 3, infinity, 7, infinity, 7, 5, 3, infinity, infinity, 3, [0m
    [22m[35m  5, 7, infinity, 7, infinity, 3, 5, 5, 3, 5, infinity, infinity, infinity, [0m
    [22m[35m  5, 3, 5, 5, 3, infinity, 7, infinity, 7, 5, 3, infinity, infinity, 3, 5, 7, [0m
    [22m[35m  infinity, 7, infinity, 3, 5, 5, 3, 5, infinity, infinity, infinity, 5, 3, [0m
    [22m[35m  5, 5, 3 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Display(Comm(u,nu^13));[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 9[0m
    [22m[35m[0m
    [22m[35m                n mod 9                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 3 6                                | n + 5[0m
    [22m[35m  1 4 7                                | 3n - 9[0m
    [22m[35m  2 8                                  | n - 11[0m
    [22m[35m  5                                    | (n + 16)/3[0m
    [22m[35m[0m
    [22m[35mgap> Order(Comm(u,nu^13));[0m
    [22m[35m7[0m
    [22m[35mgap> u2 := u^2;[0m
    [22m[35m<wild bijective rcwa mapping of Z with modulus 25>[0m
    [22m[35mgap> Filtered([1..16],k->IsTame(Comm(u2,nu^k))); # k < 15 -> commutator wild![0m
    [22m[35m[ 15 ][0m
    [22m[35mgap> Order(Comm(u2,nu^15));[0m
    [22m[35minfinity[0m
    [22m[35mgap> u2nu17 := Comm(u2,nu^17);[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 81>[0m
    [22m[35mgap> orbs := ShortOrbits(Group(u2nu17),[-100..100],100);;[0m
    [22m[35mgap> List(orbs,Length);[0m
    [22m[35m[ 72, 72, 73, 72, 73, 72, 72, 73, 72, 72, 72, 73, 72, 72, 73, 72, 72, 73, 72, [0m
    [22m[35m  72, 73, 72, 72 ][0m
    [22m[35mgap> Lcm(last);[0m
    [22m[35m5256[0m
    [22m[35mgap> u2nu17^5256; # This element has indeed order 2^3*3^2*73 = 5256.[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35mgap> u2nu18 := Comm(u2,nu^18);[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 81>[0m
    [22m[35mgap> orbs := ShortOrbits(Group(u2nu18),[-100..100],100);;[0m
    [22m[35mgap> List(orbs,Length);[0m
    [22m[35m[ 22, 22, 22, 21, 22, 22, 22, 21, 21, 22, 22, 21, 22, 21, 22, 22, 21, 22, 22, [0m
    [22m[35m  21, 22, 22, 21 ][0m
    [22m[35mgap> Lcm(last);[0m
    [22m[35m462[0m
    [22m[35mgap> u2nu18^462; # This is an element of order 2*3*7*11 = 462.[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35mgap> Order(Comm(u2,nu^20));[0m
    [22m[35m29[0m
    [22m[35mgap> Order(Comm(u2,nu^25));[0m
    [22m[35m9[0m
    [22m[35mgap> Order(Comm(u2,nu^30));[0m
    [22m[35m15[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Thus  even  this  rather  simple-minded  approach  reveals various different
  orders  of  torsion elements, and the involved primes are also not all quite
  "small".
  
  
  [1m[4m[31m4.6 A wild rcwa mapping which has only finite cycles[0m
  
  Some  wild  rcwa  mappings  of Z have only finite cycles. In this section, a
  permutation is examined which can be shown to be such a mapping and which is
  likely to be something like a "minimal" example.
  
  Over  R  =  GF(q)[x],  constructing  such  mappings is easy since the degree
  function  gives  rise  to  a  partition  of R into finite sets which is left
  invariant  by  suitable wild rcwa mappings. Over R = Z however the situation
  looks  different  --  there  is no such "natural" partition into finite sets
  which can be fixed by a wild rcwa mapping.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> kappa := RcwaMapping([[1,0,1],[1,0,1],[3,2,2],[1,-1,1],[0m
    [22m[35m>                          [2,0,1],[1,0,1],[3,2,2],[1,-1,1],[0m
    [22m[35m>                          [1,1,3],[1,0,1],[3,2,2],[2,-2,1]]);;[0m
    [22m[35mgap> SetName(kappa,"kappa");[0m
    [22m[35mgap> List([-5..5],k->Modulus(kappa^k));[0m
    [22m[35m[ 7776, 1296, 432, 72, 24, 1, 12, 72, 144, 864, 1728 ][0m
    [22m[35mgap> Display(kappa);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 12[0m
    [22m[35m[0m
    [22m[35m               n mod 12                |               n^kappa[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0  1  5  9                          | n[0m
    [22m[35m   2  6 10                             | (3n + 2)/2[0m
    [22m[35m   3  7                                | n - 1[0m
    [22m[35m   4                                   | 2n[0m
    [22m[35m   8                                   | (n + 1)/3[0m
    [22m[35m  11                                   | 2n - 2[0m
    [22m[35m[0m
    [22m[35mgap> List([-32..32],n->Length(Cycle(kappa,n)));[0m
    [22m[35m[ 4, 1, 4, 4, 7, 1, 10, 10, 1, 1, 4, 4, 7, 1, 10, 10, 4, 1, 7, 7, 1, 1, 7, 7, [0m
    [22m[35m  4, 1, 4, 4, 2, 1, 1, 2, 1, 1, 4, 4, 4, 1, 7, 7, 4, 1, 7, 7, 1, 1, 10, 10, [0m
    [22m[35m  7, 1, 4, 4, 7, 1, 10, 10, 1, 1, 4, 4, 4, 1, 13, 13, 7 ][0m
    [22m[35mgap> List([2..14],k->Maximum(List([1..2^k],n->Length(Cycle(kappa,n)))));[0m
    [22m[35m[ 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40 ][0m
    [22m[35mgap> List([2..14],k->Length(Cycle(kappa,2^k-2)));[0m
    [22m[35m[ 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40 ][0m
    [22m[35mgap> Cycle(kappa,2^12-2);[0m
    [22m[35m[ 4094, 6142, 9214, 13822, 20734, 31102, 46654, 69982, 104974, 157462, [0m
    [22m[35m  236194, 354292, 708584, 236195, 472388, 157463, 314924, 104975, 209948, [0m
    [22m[35m  69983, 139964, 46655, 93308, 31103, 62204, 20735, 41468, 13823, 27644, [0m
    [22m[35m  9215, 18428, 6143, 12284, 4095 ][0m
    [22m[35mgap> last mod 12;[0m
    [22m[35m[ 2, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 4, 8, 11, 8, 11, 8, 11, 8, 11, [0m
    [22m[35m  8, 11, 8, 11, 8, 11, 8, 11, 8, 11, 8, 11, 8, 3 ][0m
    [22m[35mgap> lengthstatistics := Collected(List(ShortOrbits(Group(kappa),[0m
    [22m[35m>                                                   [1..12^4],100),Length));[0m
    [22m[35m[ [ 1, 6912 ], [ 4, 1728 ], [ 7, 864 ], [ 10, 432 ], [ 13, 216 ], [0m
    [22m[35m  [ 16, 108 ], [ 19, 54 ], [ 22, 27 ], [ 25, 13 ], [ 28, 7 ], [ 31, 3 ], [0m
    [22m[35m  [ 34, 2 ], [ 37, 1 ], [ 40, 1 ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  We  would  like to determine a partition ofZ into unions of cycles of equal
  length:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> C := [Difference(Integers,MovedPoints(kappa))];; pow := [kappa^0];;[0m
    [22m[35mgap> rc := function(r,m) return ResidueClass(r,m); end;;[0m
    [22m[35mgap> for i in [1..3] do[0m
    [22m[35m>      Add(pow,kappa^i);[0m
    [22m[35m>      C[i+1] := Difference(rc(2,4),[0m
    [22m[35m>                           Union(Union(C{[1..i]}),[0m
    [22m[35m>                                 Union(List([0..i],[0m
    [22m[35m>                                       j->Intersection(rc(2,4)^pow[j+1],[0m
    [22m[35m>                                                       rc(2,4)^(pow[i-j+1]^-1))))));[0m
    [22m[35m>    od;[0m
    [22m[35mgap> C;[0m
    [22m[35m[ 1(4) U 0(12) U [ -2 ], 2(24) U 18(24), 6(48) U 38(48) U 10(72) U 58(72), [0m
    [22m[35m  <union of 38 residue classes (mod 864)> ][0m
    [22m[35mgap> List(C,S->Length(Cycle(kappa,S)));[0m
    [22m[35m[ 1, 4, 7, 10 ][0m
    [22m[35mgap> Cycle(kappa,C[1]);[0m
    [22m[35m[ 1(4) U 0(12) U [ -2 ] ][0m
    [22m[35mgap> Cycle(kappa,C[2]);[0m
    [22m[35m[ 2(24) U 18(24), 4(36) U 28(36), 8(72) U 56(72), 3(24) U 19(24) ][0m
    [22m[35mgap> cycle7 := Cycle(kappa,C[3]);;[0m
    [22m[35mgap> for S in cycle7 do View(S); Print("\n"); od;[0m
    [22m[35m6(48) U 38(48) U 10(72) U 58(72)[0m
    [22m[35m10(72) U 58(72) U 16(108) U 88(108)[0m
    [22m[35m16(108) U 88(108) U 32(216) U 176(216)[0m
    [22m[35m11(72) U 59(72) U 32(216) U 176(216)[0m
    [22m[35m11(72) U 59(72) U 20(144) U 116(144)[0m
    [22m[35m7(48) U 39(48) U 20(144) U 116(144)[0m
    [22m[35m6(48) U 7(48) U 38(48) U 39(48)[0m
    [22m[35mgap> cycle10 := Cycle(kappa,C[4]);;[0m
    [22m[35mgap> for S in cycle10 do View(S); Print("\n"); od;[0m
    [22m[35m<union of 38 residue classes (mod 864)>[0m
    [22m[35m<union of 38 residue classes (mod 1296)>[0m
    [22m[35m<union of 12 residue classes (mod 648)>[0m
    [22m[35m<union of 12 residue classes (mod 648)>[0m
    [22m[35m<union of 22 residue classes (mod 1296)>[0m
    [22m[35m<union of 12 residue classes (mod 432)>[0m
    [22m[35m<union of 22 residue classes (mod 864)>[0m
    [22m[35m<union of 12 residue classes (mod 288)>[0m
    [22m[35m<union of 14 residue classes (mod 288)>[0m
    [22m[35m<union of 16 residue classes (mod 288)>[0m
    [22m[35mgap> List(cycle10,Density);[0m
    [22m[35m[ 19/432, 19/648, 1/54, 1/54, 11/648, 1/36, 11/432, 1/24, 7/144, 1/18 ][0m
    [22m[35mgap> List(last,Float);[0m
    [22m[35m[ 0.0439815, 0.029321, 0.0185185, 0.0185185, 0.0169753, 0.0277778, 0.025463, [0m
    [22m[35m  0.0416667, 0.0486111, 0.0555556 ][0m
    [22m[35mgap> Sum(last2);[0m
    [22m[35m47/144[0m
    [22m[35mgap> Density(Union(cycle10));[0m
    [22m[35m47/432[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> P := List(C,S->Union(Cycle(kappa,S)));;[0m
    [22m[35mgap> for S in P do View(S); Print("\n"); od;[0m
    [22m[35m1(4) U 0(12) U [ -2 ][0m
    [22m[35m<union of 18 residue classes (mod 72)>[0m
    [22m[35m<union of 78 residue classes (mod 432)>[0m
    [22m[35m<union of 282 residue classes (mod 2592)>[0m
    [22m[35mgap> P2 := AsUnionOfFewClasses(P[2]);[0m
    [22m[35m[ 2(24), 3(24), 18(24), 19(24), 4(36), 28(36), 8(72), 56(72) ][0m
    [22m[35mgap> Permutation(kappa,P2);[0m
    [22m[35m(1,5,7,2)(3,6,8,4)[0m
    [22m[35mgap> P3 := AsUnionOfFewClasses(P[3]);[0m
    [22m[35m[ 6(48), 7(48), 38(48), 39(48), 10(72), 11(72), 58(72), 59(72), 16(108), [0m
    [22m[35m  88(108), 20(144), 116(144), 32(216), 176(216) ][0m
    [22m[35mgap> Permutation(kappa,P3);[0m
    [22m[35m(1,5,9,13,6,11,2)(3,7,10,14,8,12,4)[0m
    [22m[35mgap> P4 := AsUnionOfFewClasses(P[4]);[0m
    [22m[35m[ 14(96), 15(96), 78(96), 79(96), 22(144), 23(144), 118(144), 119(144), [0m
    [22m[35m  34(216), 35(216), 178(216), 179(216), 44(288), 236(288), 52(324), 268(324), [0m
    [22m[35m  68(432), 356(432), 104(648), 536(648) ][0m
    [22m[35mgap> Permutation(kappa,P4);[0m
    [22m[35m(1,5,9,15,19,10,17,6,13,2)(3,7,11,16,20,12,18,8,14,4)[0m
    [22m[35mgap> List(P,S->Set(List(Intersection([1..12^4],S),n->Length(Cycle(kappa,n)))));[0m
    [22m[35m[ [ 1 ], [ 4 ], [ 7 ], [ 10 ] ][0m
    [22m[35mgap> Set(List(Intersection([1..12^4],Difference(Integers,Union(P))),[0m
    [22m[35m>             n->Length(Cycle(kappa,n))));[0m
    [22m[35m[ 13, 16, 19, 22, 25, 28, 31, 34, 37, 40 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Finally,  the  permutation  [22m[32mkappa[0m  should be factored into involutions (this
  time "by hand", for purposes of illustration):
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> elm1 := kappa;[0m
    [22m[35mkappa[0m
    [22m[35mgap> Multpk(elm1,2,1)^elm1;[0m
    [22m[35m8(12)[0m
    [22m[35mgap> Multpk(elm1,2,-1)^elm1;[0m
    [22m[35m4(6)[0m
    [22m[35mgap> Multpk(elm1,3,1)^elm1;[0m
    [22m[35m4(6)[0m
    [22m[35mgap> Multpk(elm1,3,-1)^elm1;[0m
    [22m[35m3(4)[0m
    [22m[35mgap> fact1 := RcwaMapping([[rc(4,6),rc(8,12)]]);[0m
    [22m[35m<rcwa mapping of Z with modulus 12>[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> elm2 := elm1/fact1;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 12>[0m
    [22m[35mgap> Display(elm2);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 12[0m
    [22m[35m[0m
    [22m[35m               n mod 12                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0  1  4  5  9                       | n[0m
    [22m[35m   2  6 10                             | 3n + 2[0m
    [22m[35m   3  7 11                             | n - 1[0m
    [22m[35m   8                                   | (n + 1)/3[0m
    [22m[35m[0m
    [22m[35mgap> Multpk(elm2,3,1)^elm2;[0m
    [22m[35m8(12)[0m
    [22m[35mgap> Multpk(elm2,3,-1)^elm2;[0m
    [22m[35m3(4)[0m
    [22m[35mgap> fact2 := RcwaMapping([[rc(3,4),rc(8,12)]]);[0m
    [22m[35m<rcwa mapping of Z with modulus 12>[0m
    [22m[35mgap> elm3 := elm2/fact2;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 4>[0m
    [22m[35mgap> Display(elm3);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 4[0m
    [22m[35m[0m
    [22m[35m                n mod 4                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 1                                  | n[0m
    [22m[35m  2                                    | n + 1[0m
    [22m[35m  3                                    | n - 1[0m
    [22m[35m[0m
    [22m[35mgap> fact3 := RcwaMapping([[rc(2,4),rc(3,4)]]);[0m
    [22m[35m<rcwa mapping of Z with modulus 4>[0m
    [22m[35mgap> elm4 := elm3/fact3;[0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35mgap> kappafacts := [ fact3, fact2, fact1 ];[0m
    [22m[35m[ <bijective rcwa mapping of Z with modulus 4>, [0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 12>, [0m
    [22m[35m  <bijective rcwa mapping of Z with modulus 12> ][0m
    [22m[35mgap> List(kappafacts,Order);[0m
    [22m[35m[ 2, 2, 2 ][0m
    [22m[35mgap> kappa = Product(kappafacts);[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.7 An abelian rcwa group over a polynomial ring[0m
  
  In  this  section,  a  wild  rcwa group over GF(4)[x] should be invstigated,
  which  happens  to  be  abelian. Of course in general, rcwa groups also over
  this  ring  are  usually  far  from  being  abelian (see below). We start by
  defining this group:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> x := Indeterminate(GF(4),1);; SetName(x,"x");[0m
    [22m[35mgap> R := PolynomialRing(GF(4),1);[0m
    [22m[35mGF(4)[x][0m
    [22m[35mgap> e := One(GF(4));;[0m
    [22m[35mgap> p := x^2 + x + e;;    q := x^2 + e;;[0m
    [22m[35mgap> r := x^2 + x + Z(4);; s := x^2 + x + Z(4)^2;;[0m
    [22m[35mgap> cg := List( AllResidues(R,x^2), pol -> [ p, p * pol mod q, q ] );;[0m
    [22m[35mgap> ch := List( AllResidues(R,x^2), pol -> [ r, r * pol mod s, s ] );;[0m
    [22m[35mgap> g := RcwaMapping( R, q, cg );[0m
    [22m[35m<rcwa mapping of GF(4)[x] with modulus x^2+Z(2)^0>[0m
    [22m[35mgap> h := RcwaMapping( R, s, ch );[0m
    [22m[35m<rcwa mapping of GF(4)[x] with modulus x^2+x+Z(2^2)^2>[0m
    [22m[35mgap> List([g,h],Order);[0m
    [22m[35m[ infinity, infinity ][0m
    [22m[35mgap> List([g,h],IsTame);[0m
    [22m[35m[ false, false ][0m
    [22m[35mgap> G := Group(g,h);[0m
    [22m[35m<rcwa group over GF(4)[x] with 2 generators>[0m
    [22m[35mgap> IsAbelian(G);[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Now we compute the action of the group [22m[32mG[0m on one of its orbits, and make some
  statistics of the orbits of [22m[32mG[0m containing polynomials of degree less than4:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> orb := Orbit(G,x^5);[0m
    [22m[35m[ x^5, x^5+x^4+x^2+Z(2)^0, x^5+x^3+x^2+Z(2^2)*x+Z(2)^0, x^5+x^3, [0m
    [22m[35m  x^5+x^4+x^3+x^2+Z(2^2)^2*x+Z(2^2)^2, x^5+x, x^5+x^4+x^3, x^5+x^2+Z(2^2)^2*x,[0m
    [22m[35m  x^5+x^4+x^2+x, x^5+x^3+x^2+Z(2^2)^2*x+Z(2)^0, x^5+x^4+Z(2^2)*x+Z(2^2), [0m
    [22m[35m  x^5+x^3+x, x^5+x^4+x^3+x^2+Z(2^2)*x+Z(2^2), x^5+x^4+x^3+x+Z(2)^0, [0m
    [22m[35m  x^5+x^2+Z(2^2)*x, x^5+x^4+Z(2^2)^2*x+Z(2^2)^2 ][0m
    [22m[35mgap> H := Action(G,orb);[0m
    [22m[35mGroup([ (1,2,4,7,6,9,12,14)(3,5,8,11,10,13,15,16), [0m
    [22m[35m  (1,3,6,10)(2,5,9,13)(4,8,12,15)(7,11,14,16) ])[0m
    [22m[35mgap> IsAbelian(H); # check ...[0m
    [22m[35mtrue[0m
    [22m[35mgap> Exponent(H);[0m
    [22m[35m8[0m
    [22m[35mgap> Collected(List(ShortOrbits(G,AllResidues(R,x^4),100),Length));[0m
    [22m[35m[ [ 1, 4 ], [ 2, 6 ], [ 4, 12 ], [ 8, 24 ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Changing the generators a little causes the group structure to change a lot:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> cg[1][2] := cg[1][2] + (x^2 + e) * p * q;;[0m
    [22m[35mgap> ch[7][2] := ch[7][2] + x * r * s;;[0m
    [22m[35mgap> g := RcwaMapping( R, q, cg );; h := RcwaMapping( R, s, ch );;[0m
    [22m[35mgap> G := Group(g,h);[0m
    [22m[35m<rcwa group over GF(4)[x] with 2 generators>[0m
    [22m[35mgap> orb := Orbit(G,Zero(R));;[0m
    [22m[35mgap> Length(orb);[0m
    [22m[35m87[0m
    [22m[35mgap> Collected(List(orb,DegreeOfLaurentPolynomial));[0m
    [22m[35m[ [ 1, 2 ], [ 2, 4 ], [ 3, 16 ], [ 4, 64 ], [ infinity, 1 ] ][0m
    [22m[35mgap> H := Action(G,orb);[0m
    [22m[35m<permutation group with 2 generators>[0m
    [22m[35mgap> IsNaturalAlternatingGroup(H);[0m
    [22m[35mtrue[0m
    [22m[35mgap> orb := Orbit(G,x^6);;[0m
    [22m[35mgap> Length(orb);[0m
    [22m[35m512[0m
    [22m[35mgap> H := Action(G,orb);[0m
    [22m[35m<permutation group with 2 generators>[0m
    [22m[35mgap> IsNaturalSymmetricGroup(H) or IsNaturalAlternatingGroup(H);[0m
    [22m[35mfalse[0m
    [22m[35mgap> blk := Blocks(H,[1..512]);;[0m
    [22m[35mgap> List(blk,Length);[0m
    [22m[35m[ 128, 128, 128, 128 ][0m
    [22m[35mgap> Action(H,blk,OnSets);[0m
    [22m[35mGroup([ (1,2)(3,4), (1,3)(2,4) ])[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Thus  the  modified group has a quotient isomorphic to the alternating group
  of degree87, and a quotient isomorphic to some wreath product or a subgroup
  thereof acting transitively, but not primitively on 512 points.
  
  
  [1m[4m[31m4.8 An rcwa representation of a small group[0m
  
  In  the  sequel,  an  rcwa  representation  of  the  3-Sylow-subgroup of the
  symmetric  group  on 9points is given. Of course this group has a very nice
  permutation  representation,  hence  for computational purposes one does not
  gain anything here.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> r := RcwaMapping([[1,0,1],[1,1,1],[3,-3,1],[0m
    [22m[35m>                      [1,0,3],[1,1,1],[3,-3,1],[0m
    [22m[35m>                      [1,0,1],[1,1,1],[3,-3,1]]);;[0m
    [22m[35mgap> s := RcwaMapping([[1,0,1],[1,1,1],[3,6,1],[0m
    [22m[35m>                      [1,0,3],[1,1,1],[3,6,1],[0m
    [22m[35m>                      [1,0,1],[1,1,1],[3,-21,1]]);;[0m
    [22m[35mgap> SetName(r,"r"); SetName(s,"s");[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Display(r);[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 9[0m
    [22m[35m[0m
    [22m[35m                n mod 9                |                 n^r[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 6                                  | n[0m
    [22m[35m  1 4 7                                | n + 1[0m
    [22m[35m  2 5 8                                | 3n - 3[0m
    [22m[35m  3                                    | n/3[0m
    [22m[35m[0m
    [22m[35mgap> Display(s);[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 9[0m
    [22m[35m[0m
    [22m[35m                n mod 9                |                 n^s[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 6                                  | n[0m
    [22m[35m  1 4 7                                | n + 1[0m
    [22m[35m  2 5                                  | 3n + 6[0m
    [22m[35m  3                                    | n/3[0m
    [22m[35m  8                                    | 3n - 21[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(r,s);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> H := SylowSubgroup(SymmetricGroup(9),3);[0m
    [22m[35mGroup([ (1,2,3), (4,5,6), (7,8,9), (1,4,7)(2,5,8)(3,6,9) ])[0m
    [22m[35mgap> phi := InverseGeneralMapping(IsomorphismGroups(G,H));;[0m
    [22m[35mgap> (1,2,3)^phi;[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 27>[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.9 An rcwa representation of the symmetric group on 10 points[0m
  
  In  this section, an rcwa representation of the symmetric group on 10points
  should  be  investigated.  We  start by defining some bijections of infinite
  order and computing commutators:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> a := RcwaMapping([[3,0,2],[3, 1,4],[3,0,2],[3,-1,4]]);;[0m
    [22m[35mgap> b := RcwaMapping([[3,0,2],[3,13,4],[3,0,2],[3,-1,4]]);;[0m
    [22m[35mgap> c := RcwaMapping([[3,0,2],[3, 1,4],[3,0,2],[3,11,4]]);;[0m
    [22m[35mgap> SetName(a,"a"); SetName(b,"b"); SetName(c,"c");[0m
    [22m[35mgap> List([a,b,c],Order);[0m
    [22m[35m[ infinity, infinity, infinity ][0m
    [22m[35mgap> ab := Comm(a,b);; ac := Comm(a,c);; bc := Comm(b,c);;[0m
    [22m[35mgap> SetName(ab,"[a,b]"); SetName(ac,"[a,c]"); SetName(bc,"[b,c]");[0m
    [22m[35mgap> List([ab,ac,bc],Order);[0m
    [22m[35m[ 6, 6, 12 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Now we would like to have a look at [[22m[34ma[0m,[22m[34mb[0m] ...
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Display(ab);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 18, of order 6[0m
    [22m[35m[0m
    [22m[35m               n mod 18                |               n^[a,b][0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0  2  3  8  9 11 12 17              | n[0m
    [22m[35m   1 10                                | 2n - 5[0m
    [22m[35m   4  7 13 16                          | n + 3[0m
    [22m[35m   5 14                                | 2n - 4[0m
    [22m[35m   6                                   | (n + 2)/2[0m
    [22m[35m  15                                   | (n - 5)/2[0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  ...  form  the  group generated by [[22m[34ma[0m,[22m[34mb[0m] and [[22m[34ma[0m,[22m[34mc[0m] and compute its action on
  one of its orbits:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ab,ac);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> orb := Orbit(G,1);[0m
    [22m[35m[ -15, -12, -7, -6, -5, -4, -3, -2, -1, 1 ][0m
    [22m[35mgap> H := Action(G,orb);[0m
    [22m[35mGroup([ (2,5,8,10,7,6), (1,3,6,9,4,5) ])[0m
    [22m[35mgap> Size(H);[0m
    [22m[35m3628800[0m
    [22m[35mgap> Size(G); # G acts faithful on orb.[0m
    [22m[35m3628800[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Hence the group [22m[34mG[0m is isomorphic to the symmetric group on 10points and acts
  faithfully on the orbit containing1. Another question is which groups arise
  if  we  take as generators either [22m[34mab[0m, [22m[34mac[0m or [22m[34mbc[0m and the mapping[22m[34mt[0m, which maps
  each integer to its additive inverse:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> t := RcwaMapping([[-1,0,1]]);[0m
    [22m[35mRcwa mapping of Z: n -> -n[0m
    [22m[35mgap> Order(t);[0m
    [22m[35m2[0m
    [22m[35mgap> G := Group(ab,t);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> Size(G);[0m
    [22m[35m7257600[0m
    [22m[35mgap> H := Image(IsomorphismPermGroup(G));;[0m
    [22m[35mgap> H2 := Group((1,2),(1,2,3,4,5,6,7,8,9,10),(11,12));;[0m
    [22m[35mgap> IsomorphismGroups(H,H2) <> fail; # H = C2 x S10[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Thus  the  group generated by [22m[34mab[0m and [22m[34mt[0m is isomorphic to C_2 x S_10. The next
  group is an extension of a perfect group of order960:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ac,t);;[0m
    [22m[35mgap> Size(G);[0m
    [22m[35m3840[0m
    [22m[35mgap> H := Image(IsomorphismPermGroup(G));;[0m
    [22m[35mgap> P := DerivedSubgroup(H);;[0m
    [22m[35mgap> Size(P);[0m
    [22m[35m960[0m
    [22m[35mgap> IsPerfect(P);[0m
    [22m[35mtrue[0m
    [22m[35mgap> PerfectGroup(PerfectIdentification(P));[0m
    [22m[35mA5 2^4'[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  The last group is infinite:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(bc,t);;[0m
    [22m[35mgap> Size(G);[0m
    [22m[35minfinity[0m
    [22m[35mgap> Order(bc*t);[0m
    [22m[35minfinity[0m
    [22m[35mgap> Modulus(G);[0m
    [22m[35m18[0m
    [22m[35mgap> ResidueClassUnionViewingFormat("short");[0m
    [22m[35mgap> RespectedPartition(G);[0m
    [22m[35m[ 0(18), 1(18), 2(18), 4(18), 5(18), 7(18), 8(18), 9(18), 10(18), 11(18), [0m
    [22m[35m  13(18), 14(18), 16(18), 17(18), 3(36), 6(36), 12(36), 15(36), 21(36), [0m
    [22m[35m  24(36), 30(36), 33(36) ][0m
    [22m[35mgap> D := DerivedSubgroup(ActionOnRespectedPartition(G));;[0m
    [22m[35mgap> DegreeAction(D);[0m
    [22m[35m20[0m
    [22m[35mgap> IsPerfect(D);[0m
    [22m[35mtrue[0m
    [22m[35mgap> Size(D);[0m
    [22m[35m928972800[0m
    [22m[35mgap> RankOfKernelOfActionOnRespectedPartition(G:ProperSubgroupAllowed);[0m
    [22m[35m9[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.10 Checking for solvability[0m
  
  Is  the  group  generated  by  the  mappings [22m[34ma[0m and [22m[34mb[0m from the last paragraph
  solvable?
  
  This  group  is  wild.  Presently  there  is no general method available for
  testing  wild  rcwa  groups for solvability. But nevertheless, for the given
  group  this  question  can be decided to the negative. The idea is to find a
  subgroup  [22m[34mU[0m  which  acts  on  a finite set [22m[34mS[0m of integers, and induces on [22m[34mS[0m a
  non-solvable finite permutation group:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(a,b);;[0m
    [22m[35mgap> ShortOrbits(Group(Comm(a,b)),[-10..10],100);[0m
    [22m[35m[ [ -10 ], [ -9 ], [ -30, -21, -14, -13, -11, -8 ], [ -7 ], [ -6 ], [0m
    [22m[35m  [ -12, -5, -4, -3, -2, 1 ], [ -1 ], [ 0 ], [ 2 ], [ 3 ], [0m
    [22m[35m  [ 4, 5, 6, 7, 10, 15 ], [ 8 ], [ 9 ] ][0m
    [22m[35mgap> S := [ 4, 5, 6, 7, 10, 15 ];;[0m
    [22m[35mgap> Cycle(Comm(a,b),4);[0m
    [22m[35m[ 4, 7, 10, 15, 5, 6 ][0m
    [22m[35mgap> elm := RepresentativeAction(G,S,Permuted(S,(1,4)),OnTuples);[0m
    [22m[35m<bijective rcwa mapping of Z with modulus 81>[0m
    [22m[35mgap> List(S,n->n^elm);[0m
    [22m[35m[ 7, 5, 6, 4, 10, 15 ][0m
    [22m[35mgap> U := Group(Comm(a,b),elm);[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> Action(U,S);[0m
    [22m[35mGroup([ (1,4,5,6,2,3), (1,4) ])[0m
    [22m[35mgap> IsNaturalSymmetricGroup(last);[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Thus,  the  subgroup  [22m[34mU[0m  induces on [22m[34mS[0m a natural symmetric group of degree6.
  Hence  the  group[22m[34mG[0m  is  not solvable, as claimed. We finish this example by
  factoring the group element [22m[34melm[0m into generators:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> F := FreeGroup("a","b");[0m
    [22m[35m<free group on the generators [ a, b ]>[0m
    [22m[35mgap> RepresentativeActionPreImage(G,S,Permuted(S,(1,4)),OnTuples,F);[0m
    [22m[35ma^-2*b^-2*a*b*a^-1*b*a*b^-2*a[0m
    [22m[35mgap> a^-2*b^-2*a*b*a^-1*b*a*b^-2*a = elm;[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.11 Some examples over (semi)localizations of the integers[0m
  
  We  start  with  something one can observe when trying to "transfer" an rcwa
  mapping  from  the ring of integers to one of its localizations (we take the
  mapping [22m[32ma[0m from the previous examples):
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> a2 := RcwaMapping(Z_pi(2),ShallowCopy(Coefficients(a)));[0m
    [22m[35m<rcwa mapping of Z_( 2 ) with modulus 4>[0m
    [22m[35mgap> IsSurjective(a2); # As expected[0m
    [22m[35mtrue[0m
    [22m[35mgap> IsInjective(a2); # Why not??[0m
    [22m[35mfalse[0m
    [22m[35mgap> 0^a2;[0m
    [22m[35m0[0m
    [22m[35mgap> (1/3)^a2; # That's the reason![0m
    [22m[35m0[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  The  above  can also be explained easily by pointing out that the modulus of
  the  inverse  of  [22m[32ma[0m  is  3, and that 3 is a unit of Z_(2). Moving to Z_(2,3)
  solves this problem:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> a23 := RcwaMapping(Z_pi([2,3]),ShallowCopy(Coefficients(a)));[0m
    [22m[35m<rcwa mapping of Z_( 2, 3 ) with modulus 4>[0m
    [22m[35mgap> IsBijective(a23);[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  We get additional finite cycles, e.g.:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> List(ShortOrbits(Group(a23),[0..50]/5,50),orb->Cycle(a23,orb[1]));[0m
    [22m[35m[ [ 0 ], [ 1/5, 2/5, 3/5 ], [0m
    [22m[35m  [ 4/5, 6/5, 9/5, 8/5, 12/5, 18/5, 27/5, 19/5, 13/5, 11/5, 7/5 ], [ 1 ], [0m
    [22m[35m  [ 2, 3 ], [ 14/5, 21/5, 17/5 ], [0m
    [22m[35m  [ 16/5, 24/5, 36/5, 54/5, 81/5, 62/5, 93/5, 71/5, 52/5, 78/5, 117/5, 89/5, [0m
    [22m[35m      68/5, 102/5, 153/5, 116/5, 174/5, 261/5, 197/5, 149/5, 113/5, 86/5, [0m
    [22m[35m      129/5, 98/5, 147/5, 109/5, 83/5, 61/5, 47/5, 34/5, 51/5, 37/5, 29/5, [0m
    [22m[35m      23/5 ], [ 4, 6, 9, 7, 5 ] ][0m
    [22m[35mgap> List(last,Length);[0m
    [22m[35m[ 1, 3, 11, 1, 2, 3, 34, 5 ][0m
    [22m[35mgap> List(ShortOrbits(Group(a23),[0..50]/7,50),orb->Cycle(a23,orb[1]));[0m
    [22m[35m[ [ 0 ], [ -1/7, 1/7 ], [ 2/7, 3/7, 4/7, 6/7, 9/7, 5/7 ], [ 1 ], [ 2, 3 ], [0m
    [22m[35m  [ 4, 6, 9, 7, 5 ] ][0m
    [22m[35mgap> List(last,Length);[0m
    [22m[35m[ 1, 2, 6, 1, 2, 5 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  But  the  group  structure remains invariant under the "transfer" of a group
  with prime set 2,3 from Z to Z_(2,3):
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> b23 := RcwaMapping(Z_pi([2,3]),ShallowCopy(Coefficients(b)));;[0m
    [22m[35mgap> c23 := RcwaMapping(Z_pi([2,3]),ShallowCopy(Coefficients(c)));;[0m
    [22m[35mgap> ab23 := Comm(a23,b23);[0m
    [22m[35m<rcwa mapping of Z_( 2, 3 ) with modulus 18>[0m
    [22m[35mgap> ac23 := Comm(a23,c23);[0m
    [22m[35m<rcwa mapping of Z_( 2, 3 ) with modulus 18>[0m
    [22m[35mgap> G := Group(ab23,ac23);[0m
    [22m[35m<rcwa group over Z_( 2, 3 ) with 2 generators>[0m
    [22m[35mgap> S := Intersection(Enumerator(Rationals){[1..200]},Z_pi([2,3]));[0m
    [22m[35m[ -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -12/5, -11/5, -2, -9/5, -12/7, [0m
    [22m[35m  -8/5, -11/7, -10/7, -7/5, -9/7, -6/5, -8/7, -12/11, -1, -10/11, -6/7, [0m
    [22m[35m  -9/11, -4/5, -8/11, -5/7, -7/11, -3/5, -4/7, -6/11, -5/11, -3/7, -2/5, [0m
    [22m[35m  -4/11, -2/7, -3/11, -1/5, -2/11, -1/7, -1/11, 0, 1/13, 1/11, 1/7, 2/13, [0m
    [22m[35m  2/11, 1/5, 3/13, 3/11, 2/7, 4/13, 4/11, 5/13, 2/5, 3/7, 5/11, 6/13, 7/13, [0m
    [22m[35m  6/11, 4/7, 3/5, 8/13, 7/11, 9/13, 5/7, 8/11, 10/13, 4/5, 9/11, 11/13, 6/7, [0m
    [22m[35m  10/11, 12/13, 1, 12/11, 8/7, 13/11, 6/5, 9/7, 7/5, 10/7, 11/7, 8/5, 12/7, [0m
    [22m[35m  9/5, 2, 11/5, 12/5, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ][0m
    [22m[35mgap> orbs := ShortOrbits(G,S,50);;[0m
    [22m[35mgap> List(orbs,Length);[0m
    [22m[35m[ 10, 10, 1, 10, 1, 10, 10, 10, 10, 10, 1, 10, 10, 10, 1, 10, 10, 10, 10, 10, [0m
    [22m[35m  10, 10, 10, 10, 10, 10, 10, 10, 1, 10, 10, 10, 10, 10, 10, 10, 10, 10, 1, [0m
    [22m[35m  10, 1, 10, 10, 10, 1, 1, 10, 1, 10 ][0m
    [22m[35mgap> ForAll(orbs,orb->IsNaturalSymmetricGroup(Action(G,orb)));[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  "Transferring"  a  non-invertible  rcwa mapping from the ring of integers to
  some of its (semi)localizations can also turn it into an invertible one:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> v := RcwaMapping([[6,0,1],[1,-7,2],[6,0,1],[1,-1,1],[0m
    [22m[35m>                      [6,0,1],[1, 1,2],[6,0,1],[1,-1,1]]);;[0m
    [22m[35mgap> SetName(v,"v");[0m
    [22m[35mgap> Display(v);[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 8[0m
    [22m[35m[0m
    [22m[35m                n mod 8                |                 n^v[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 2 4 6                              | 6n[0m
    [22m[35m  1                                    | (n - 7)/2[0m
    [22m[35m  3 7                                  | n - 1[0m
    [22m[35m  5                                    | (n + 1)/2[0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> IsInjective(v);[0m
    [22m[35mtrue[0m
    [22m[35mgap> IsSurjective(v);[0m
    [22m[35mfalse[0m
    [22m[35mgap> Image(v);[0m
    [22m[35m1(2) U 2(4) U 0(12)[0m
    [22m[35mgap> Difference(Integers,last);[0m
    [22m[35m4(12) U 8(12)[0m
    [22m[35mgap> v2 := RcwaMapping(Z_pi(2),ShallowCopy(Coefficients(v)));[0m
    [22m[35m<rcwa mapping of Z_( 2 ) with modulus 8>[0m
    [22m[35mgap> IsBijective(v2);[0m
    [22m[35mtrue[0m
    [22m[35mgap> Display(v2^-1);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z_( 2 ) with modulus 4[0m
    [22m[35m[0m
    [22m[35m                n mod 4                |                 n^f[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0                                    | 1/3 n / 2[0m
    [22m[35m  1                                    | 2 n + 7[0m
    [22m[35m  2                                    | n + 1[0m
    [22m[35m  3                                    | 2 n - 1[0m
    [22m[35m[0m
    [22m[35mgap> S := ResidueClass(Z_pi(2),2,0);; l := [S];;[0m
    [22m[35mgap> for i in [1..10] do Add(l,l[Length(l)]^v2); od;[0m
    [22m[35mgap> l; # Visibly v2 is wild ...[0m
    [22m[35m[ 0(2), 0(4), 0(8), 0(16), 0(32), 0(64), 0(128), 0(256), 0(512), 0(1024), [0m
    [22m[35m  0(2048) ][0m
    [22m[35mgap> w2 := RcwaMapping(Z_pi(2),[[1,0,2],[2,-1,1],[1,1,1],[2,-1,1]]);;[0m
    [22m[35mgap> v2w2 := Comm(v2,w2);; SetName(v2w2,"[v2,w2]"); v2w2^-1;;[0m
    [22m[35mgap> Display(v2w2);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z_( 2 ) with modulus 8[0m
    [22m[35m[0m
    [22m[35m                n mod 8                |              n^[v2,w2][0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 3 4 7                              | n[0m
    [22m[35m  1                                    | n + 4[0m
    [22m[35m  2 6                                  | 3 n[0m
    [22m[35m  5                                    | n - 4[0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Again, viewed as an rcwa mapping of the integers the commutator given at the
  end of the example would not be surjective.
  
  
  [1m[4m[31m4.12 Twisting 257-cycles into an rcwa mapping with modulus 32[0m
  
  We define an rcwa mapping [22m[34mx[0m of order257 with modulus32. The easiest way to
  construct  such  a  mapping  is  to prescribe a transition graph and then to
  assign suitable affine mappings to its vertices.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> x := RcwaMapping([0m
    [22m[35m>           [[ 16,  2,  1], [ 16, 18,  1], [  1, 16,  1], [ 16, 18,  1],[0m
    [22m[35m>            [  1, 16,  1], [ 16, 18,  1], [  1, 16,  1], [ 16, 18,  1],[0m
    [22m[35m>            [  1, 16,  1], [ 16, 18,  1], [  1, 16,  1], [ 16, 18,  1],[0m
    [22m[35m>            [  1, 16,  1], [ 16, 18,  1], [  1, 16,  1], [ 16, 18,  1],[0m
    [22m[35m>            [  1,  0, 16], [ 16, 18,  1], [  1,-14,  1], [ 16, 18,  1],[0m
    [22m[35m>            [  1,-14,  1], [ 16, 18,  1], [  1,-14,  1], [ 16, 18,  1],[0m
    [22m[35m>            [  1,-14,  1], [ 16, 18,  1], [  1,-14,  1], [ 16, 18,  1],[0m
    [22m[35m>            [  1,-14,  1], [ 16, 18,  1], [  1,-14,  1], [  1,-31,  1]]);;[0m
    [22m[35mgap> SetName(x,"x"); Display(x);[0m
    [22m[35m[0m
    [22m[35mRcwa mapping of Z with modulus 32[0m
    [22m[35m[0m
    [22m[35m               n mod 32                |                 n^x[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0                                   | 16n + 2[0m
    [22m[35m   1  3  5  7  9 11 13 15 17 19 21 23  | [0m
    [22m[35m  25 27 29                             | 16n + 18[0m
    [22m[35m   2  4  6  8 10 12 14                 | n + 16[0m
    [22m[35m  16                                   | n/16[0m
    [22m[35m  18 20 22 24 26 28 30                 | n - 14[0m
    [22m[35m  31                                   | n - 31[0m
    [22m[35m[0m
    [22m[35mgap> Order(x);[0m
    [22m[35m257[0m
    [22m[35mgap> Cycle(x,[1],0);[0m
    [22m[35m[ 0, 2, 18, 4, 20, 6, 22, 8, 24, 10, 26, 12, 28, 14, 30, 16, 1, 34, 50, 36, [0m
    [22m[35m  52, 38, 54, 40, 56, 42, 58, 44, 60, 46, 62, 48, 3, 66, 82, 68, 84, 70, 86, [0m
    [22m[35m  72, 88, 74, 90, 76, 92, 78, 94, 80, 5, 98, 114, 100, 116, 102, 118, 104, [0m
    [22m[35m  120, 106, 122, 108, 124, 110, 126, 112, 7, 130, 146, 132, 148, 134, 150, [0m
    [22m[35m  136, 152, 138, 154, 140, 156, 142, 158, 144, 9, 162, 178, 164, 180, 166, [0m
    [22m[35m  182, 168, 184, 170, 186, 172, 188, 174, 190, 176, 11, 194, 210, 196, 212, [0m
    [22m[35m  198, 214, 200, 216, 202, 218, 204, 220, 206, 222, 208, 13, 226, 242, 228, [0m
    [22m[35m  244, 230, 246, 232, 248, 234, 250, 236, 252, 238, 254, 240, 15, 258, 274, [0m
    [22m[35m  260, 276, 262, 278, 264, 280, 266, 282, 268, 284, 270, 286, 272, 17, 290, [0m
    [22m[35m  306, 292, 308, 294, 310, 296, 312, 298, 314, 300, 316, 302, 318, 304, 19, [0m
    [22m[35m  322, 338, 324, 340, 326, 342, 328, 344, 330, 346, 332, 348, 334, 350, 336, [0m
    [22m[35m  21, 354, 370, 356, 372, 358, 374, 360, 376, 362, 378, 364, 380, 366, 382, [0m
    [22m[35m  368, 23, 386, 402, 388, 404, 390, 406, 392, 408, 394, 410, 396, 412, 398, [0m
    [22m[35m  414, 400, 25, 418, 434, 420, 436, 422, 438, 424, 440, 426, 442, 428, 444, [0m
    [22m[35m  430, 446, 432, 27, 450, 466, 452, 468, 454, 470, 456, 472, 458, 474, 460, [0m
    [22m[35m  476, 462, 478, 464, 29, 482, 498, 484, 500, 486, 502, 488, 504, 490, 506, [0m
    [22m[35m  492, 508, 494, 510, 496, 31 ][0m
    [22m[35mgap> Length(last);[0m
    [22m[35m257[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.13 The behaviour of the moduli of powers[0m
  
  In  this section some examples are given, which illustrate how different the
  series  of  the moduli of powers of a given rcwa mapping of the integers can
  look like.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> List([0..4],i->Modulus(a^i));[0m
    [22m[35m[ 1, 4, 16, 64, 256 ][0m
    [22m[35mgap> List([0..6],i->Modulus(ab^i));[0m
    [22m[35m[ 1, 18, 18, 18, 18, 18, 1 ][0m
    [22m[35mgap> List([0..3],i->Modulus(r^i));[0m
    [22m[35m[ 1, 9, 9, 1 ][0m
    [22m[35mgap> List([0..9],i->Modulus(s^i));[0m
    [22m[35m[ 1, 9, 9, 27, 27, 27, 27, 27, 27, 1 ][0m
    [22m[35mgap> g := RcwaMapping([[2,2,1],[1,4,1],[1,0,2],[2,2,1],[1,-4,1],[1,-2,1]]);;[0m
    [22m[35mgap> List([0..7],i->Modulus(g^i));[0m
    [22m[35m[ 1, 6, 12, 12, 12, 12, 6, 1 ][0m
    [22m[35mgap> u := RcwaMapping([[3,0,5],[9,1,5],[3,-1,5],[9,-2,5],[9,4,5]]);;[0m
    [22m[35mgap> List([0..3],i->Modulus(u^i));[0m
    [22m[35m[ 1, 5, 25, 125 ][0m
    [22m[35mgap> v6 := RcwaMapping([[-1,2,1],[1,-1,1],[1,-1,1]]);;[0m
    [22m[35mgap> List([0..6],i->Modulus(v6^i));[0m
    [22m[35m[ 1, 3, 3, 3, 3, 3, 1 ][0m
    [22m[35mgap> w8 := RcwaMapping([[-1,3,1],[1,-1,1],[1,-1,1],[1,-1,1]]);;[0m
    [22m[35mgap> List([0..8],i->Modulus(w8^i));[0m
    [22m[35m[ 1, 4, 4, 4, 4, 4, 4, 4, 1 ][0m
    [22m[35mgap> z := RcwaMapping([[2,  1, 1],[1,  1,1],[2, -1,1],[2, -2,1],[0m
    [22m[35m>                      [1,  6, 2],[1,  1,1],[1, -6,2],[2,  5,1],[0m
    [22m[35m>                      [1,  6, 2],[1,  1,1],[1,  1,1],[2, -5,1],[0m
    [22m[35m>                      [1,  0, 1],[1, -4,1],[1,  0,1],[2,-10,1]]);;[0m
    [22m[35mgap> SetName(z,"z");[0m
    [22m[35mgap> IsBijective(z);[0m
    [22m[35mtrue[0m
    [22m[35mgap> Display(z);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 16[0m
    [22m[35m[0m
    [22m[35m               n mod 16                |                 n^z[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m   0                                   | 2n + 1[0m
    [22m[35m   1  5  9 10                          | n + 1[0m
    [22m[35m   2                                   | 2n - 1[0m
    [22m[35m   3                                   | 2n - 2[0m
    [22m[35m   4  8                                | (n + 6)/2[0m
    [22m[35m   6                                   | (n - 6)/2[0m
    [22m[35m   7                                   | 2n + 5[0m
    [22m[35m  11                                   | 2n - 5[0m
    [22m[35m  12 14                                | n[0m
    [22m[35m  13                                   | n - 4[0m
    [22m[35m  15                                   | 2n - 10[0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> List([0..25],i->Modulus(z^i));[0m
    [22m[35m[ 1, 16, 32, 64, 64, 128, 128, 128, 128, 128, 128, 256, 256, 256, 256, 256, [0m
    [22m[35m  256, 512, 512, 512, 512, 512, 512, 1024, 1024, 1024 ][0m
    [22m[35mgap> e1 := RcwaMapping([[1,4,1],[2,0,1],[1,0,2],[2,0,1]]);;[0m
    [22m[35mgap> e2 := RcwaMapping([[1,4,1],[2,0,1],[1,0,2],[1,0,1],[0m
    [22m[35m>                       [1,4,1],[2,0,1],[1,0,1],[1,0,1]]);;[0m
    [22m[35mgap> List([e1,e2],Order);[0m
    [22m[35m[ infinity, infinity ][0m
    [22m[35mgap> List([1..20],i->Modulus(e1^i));[0m
    [22m[35m[ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 ][0m
    [22m[35mgap> List([1..20],i->Modulus(e2^i));[0m
    [22m[35m[ 8, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 4, 8, 4 ][0m
    [22m[35mgap> SetName(e1,"e1"); SetName(e2,"e2");[0m
    [22m[35mgap> Display(e2);[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 8, of order infinity[0m
    [22m[35m[0m
    [22m[35m                n mod 8                |                 n^e2[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0 4                                  | n + 4[0m
    [22m[35m  1 5                                  | 2n[0m
    [22m[35m  2                                    | n/2[0m
    [22m[35m  3 6 7                                | n[0m
    [22m[35m[0m
    [22m[35mgap> e2^2 = Restriction(RcwaMapping([[1,2,1]]),RcwaMapping([[4,0,1]]));[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.14 Images and preimages under the Collatz mapping[0m
  
  We  have  a look at the images of the residue class 1(2) under powers of the
  Collatz mapping.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> T := RcwaMapping([[1,0,2],[3,1,2]]);; S0 := ResidueClass(Integers,2,1);;[0m
    [22m[35mgap> S1 := S0^T;[0m
    [22m[35m2(3)[0m
    [22m[35mgap> S2 := S1^T;[0m
    [22m[35m1(3) U 8(9)[0m
    [22m[35mgap> S3 := S2^T;[0m
    [22m[35m2(3) U 4(9)[0m
    [22m[35mgap> S4 := S3^T;[0m
    [22m[35m1(3) U 2(9) U 8(9)[0m
    [22m[35mgap> S5 := S4^T;[0m
    [22m[35m2(3) U 1(9) U 4(9)[0m
    [22m[35mgap> S6 := S5^T;[0m
    [22m[35m1(3) U 2(3)[0m
    [22m[35mgap> S7 := S6^T;[0m
    [22m[35m1(3) U 2(3)[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Thus  the  image  gets stable after applying the mapping T for the 6th time.
  Hence  T^6  maps  the  residue class 1(2) surjectively onto the union of the
  residue  classes  1(3)  and 2(3), which is setwisely stabilized by T. Now we
  would  like to determine the preimages of 1(3) resp. 2(3) in 1(2) under T^6.
  The residue class 1(2) has to be the disjoint union of these sets.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> U := Intersection(PreImage(T^6,ResidueClass(Integers,3,1)),S0);[0m
    [22m[35m<union of 11 residue classes (mod 64)>[0m
    [22m[35mgap> V := Intersection(PreImage(T^6,ResidueClass(Integers,3,2)),S0);[0m
    [22m[35m<union of 21 residue classes (mod 64)>[0m
    [22m[35mgap> AsUnionOfFewClasses(U);[0m
    [22m[35m[ 1(64), 5(64), 7(64), 9(64), 21(64), 23(64), 29(64), 31(64), 49(64), 51(64), [0m
    [22m[35m  59(64) ][0m
    [22m[35mgap> AsUnionOfFewClasses(V);[0m
    [22m[35m[ 3(32), 11(32), 13(32), 15(32), 25(32), 17(64), 19(64), 27(64), 33(64), [0m
    [22m[35m  37(64), 39(64), 41(64), 53(64), 55(64), 61(64), 63(64) ][0m
    [22m[35mgap> Union(U,V) = S0 and Intersection(U,V) = [];  # consistency check[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  The images of the residue class 0(3) under powers ofT look as follows:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> S0 := ResidueClass(Integers,3,0);[0m
    [22m[35m0(3)[0m
    [22m[35mgap> S1 := S0^T;[0m
    [22m[35m0(3) U 5(9)[0m
    [22m[35mgap> S2 := S1^T;[0m
    [22m[35m0(3) U 5(9) U 7(9) U 8(27)[0m
    [22m[35mgap> S3 := S2^T;[0m
    [22m[35m<union of 20 residue classes (mod 27)>[0m
    [22m[35mgap> S4 := S3^T;[0m
    [22m[35m<union of 73 residue classes (mod 81)>[0m
    [22m[35mgap> S5 := S4^T;[0m
    [22m[35m<union of 79 residue classes (mod 81)>[0m
    [22m[35mgap> S6 := S5^T;[0m
    [22m[35mIntegers[0m
    [22m[35mgap> S7 := S6^T;[0m
    [22m[35mIntegers[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Thus,  every  integer  is the image of a multiple of3 underT^6. This means
  that  it  would  be sufficient to prove the Collatz conjecture for multiples
  of3. We can obtain the corresponding result for multiples of5 as follows:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> S := [ResidueClass(Integers,5,0)];[0m
    [22m[35m[ 0(5) ][0m
    [22m[35mgap> for i in [1..12] do Add(S,S[i]^T); od;[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> for s in S do View(s); Print("\n"); od;[0m
    [22m[35m0(5)[0m
    [22m[35m0(5) U 8(15)[0m
    [22m[35m0(5) U 4(15) U 8(15)[0m
    [22m[35m0(5) U 2(15) U 4(15) U 8(15) U 29(45)[0m
    [22m[35m<union of 73 residue classes (mod 135)>[0m
    [22m[35m<union of 244 residue classes (mod 405)>[0m
    [22m[35m<union of 784 residue classes (mod 1215)>[0m
    [22m[35m<union of 824 residue classes (mod 1215)>[0m
    [22m[35m<union of 2593 residue classes (mod 3645)>[0m
    [22m[35m<union of 2647 residue classes (mod 3645)>[0m
    [22m[35m<union of 2665 residue classes (mod 3645)>[0m
    [22m[35m<union of 2671 residue classes (mod 3645)>[0m
    [22m[35m1(3) U 2(3) U 0(15)[0m
    [22m[35mgap> Union(S[13],ResidueClass(Integers,3,0));[0m
    [22m[35mIntegers[0m
    [22m[35mgap> List(S,Si->Float(Density(Si)));[0m
    [22m[35m[ 0.2, 0.266667, 0.333333, 0.422222, 0.540741, 0.602469, 0.645267, 0.678189, [0m
    [22m[35m  0.711385, 0.7262, 0.731139, 0.732785, 0.733333 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.15 A group which acts 4-transitively on the positive integers[0m
  
  In this section, we would like to show that the group G generated by the two
  wild mappings
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> a := RcwaMapping([[3,0,2],[3,1,4],[3,0,2],[3,-1,4]]);;[0m
    [22m[35mgap> u := RcwaMapping([[3,0,5],[9,1,5],[3,-1,5],[9,-2,5],[9,4,5]]);;[0m
    [22m[35mgap> SetName(a,"a"); SetName(u,"u"); G := Group(a,u);;[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  which  we  have already investigated in earlier examples acts 4-transitively
  on  the  set of positive integers. Obviously, it acts on the set of positive
  integers. First we show that this action is transitive. We start by checking
  in  which residue classes sufficiently large positive integers are mapped to
  smaller ones by a suitable group element:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> List([a,a^-1,u,u^-1],DecreasingOn);[0m
    [22m[35m[ 1(2), 0(3), 0(5) U 2(5), 2(3) ][0m
    [22m[35mgap> Union(last);[0m
    [22m[35m<union of 27 residue classes (mod 30)>[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  We  see  that  we  cannot always choose such a group element from the set of
  generators and their inverses -- otherwise the union would be [22m[32mIntegers[0m.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> List([a,a^-1,u,u^-1,a^2,a^-2,u^2,u^-2],DecreasingOn);[0m
    [22m[35m[ 1(2), 0(3), 0(5) U 2(5), 2(3), 1(8) U 7(8), 0(3) U 2(9) U 7(9), [0m
    [22m[35m  0(25) U 12(25) U 17(25) U 20(25), 2(3) U 1(9) U 3(9) ][0m
    [22m[35mgap> Union(last); # Still not enough ...[0m
    [22m[35m<union of 87 residue classes (mod 90)>[0m
    [22m[35mgap> List([a,a^-1,u,u^-1,a^2,a^-2,u^2,u^-2,a*u,u*a,(a*u)^-1,(u*a)^-1],[0m
    [22m[35m>         DecreasingOn);[0m
    [22m[35m[ 1(2), 0(3), 0(5) U 2(5), 2(3), 1(8) U 7(8), 0(3) U 2(9) U 7(9), [0m
    [22m[35m  0(25) U 12(25) U 17(25) U 20(25), 2(3) U 1(9) U 3(9), [0m
    [22m[35m  3(5) U 0(10) U 7(20) U 9(20), 0(5) U 2(5), 2(3), 3(9) U 4(9) U 8(9) ][0m
    [22m[35mgap> Union(last); # ... but that's it![0m
    [22m[35mIntegers[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Finally,  we have to deal with "small" integers. We use the notation for the
  coefficients  of  rcwa  mappings introduced at the beginning of this manual.
  Let  c_r(m)  >  a_r(m).  Then we easily see that (a_r(m)n+b_r(m))/c_r(m) > n
  implies  n < b_r(m)/(c_r(m)-a_r(m)). Thus we can restrict our considerations
  to  integers  n  < b_rm max, where b_rm max is the largest second entry of a
  coefficient triple of one of the group elements in our list:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> List([a,a^-1,u,u^-1,a^2,a^-2,u^2,u^-2,a*u,u*a,(a*u)^-1,(u*a)^-1],[0m
    [22m[35m>         f->Maximum(List(Coefficients(f),c->c[2])));[0m
    [22m[35m[ 1, 1, 4, 2, 7, 7, 56, 28, 25, 17, 17, 11 ][0m
    [22m[35mgap> Maximum(last);[0m
    [22m[35m56[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Thus  this  upper  bound  is 56. The rest is easy -- all we have to do is to
  check  that the orbit containing1 contains also all other positive integers
  less than or equal to56:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> S := [1];;[0m
    [22m[35mgap> while not IsSubset(S,[1..56]) do[0m
    [22m[35m>      S := Union(S,S^a,S^u,S^(a^-1),S^(u^-1));[0m
    [22m[35m>    od;[0m
    [22m[35mgap> IsSubset(S,[1..56]);[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Checking 2-transitivity is computationally harder, and in the sequel we will
  omit  some  steps which are in practice needed to find out "whattodo". The
  approach  taken  here  is  to  show  that  the  stabilizer  of1  inG  acts
  transitively  on  the set of positive integers greater than1. We do this by
  similar  means as used above for showing the transitivity of the action of G
  on  the positive integers. We start by determining all products of at most 5
  generators and their inverses, which stabilize1 (taking at most 4-generator
  products would not suffice!):
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> gens := [a,u,a^-1,u^-1];;[0m
    [22m[35mgap> tups := Concatenation(List([1..5],k->Tuples([1..4],k)));;[0m
    [22m[35mgap> Length(tups);[0m
    [22m[35m1364[0m
    [22m[35mgap> tups := Filtered(tups,tup->ForAll([[1,3],[3,1],[2,4],[4,2]],[0m
    [22m[35m>                                      l->PositionSublist(tup,l)=fail));;[0m
    [22m[35mgap> Length(tups);[0m
    [22m[35m484[0m
    [22m[35mgap> stab := [];;[0m
    [22m[35mgap> for tup in tups do[0m
    [22m[35m>      n := 1;[0m
    [22m[35m>      for i in tup do n := n^gens[i]; od;[0m
    [22m[35m>      if n = 1 then Add(stab,tup); fi;[0m
    [22m[35m>    od;[0m
    [22m[35mgap> Length(stab);[0m
    [22m[35m118[0m
    [22m[35mgap> stabelm := List(stab,tup->Product(List(tup,i->gens[i])));;[0m
    [22m[35mgap> ForAll(stabelm,elm->1^elm=1); # Check.[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  The resulting products have various different not quite small moduli:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> List(stabelm,Modulus);[0m
    [22m[35m[ 4, 3, 16, 25, 9, 81, 64, 100, 108, 100, 25, 75, 27, 243, 324, 243, 256, [0m
    [22m[35m  400, 144, 400, 100, 432, 324, 400, 80, 400, 625, 25, 75, 135, 150, 75, 225, [0m
    [22m[35m  81, 729, 486, 729, 144, 144, 81, 729, 1296, 729, 6561, 1024, 1600, 192, [0m
    [22m[35m  1600, 400, 576, 432, 1600, 320, 1600, 2500, 100, 100, 180, 192, 192, 108, [0m
    [22m[35m  972, 1728, 972, 8748, 1600, 400, 320, 80, 1600, 2500, 300, 2500, 625, 625, [0m
    [22m[35m  75, 675, 75, 75, 135, 405, 600, 120, 600, 1875, 75, 225, 405, 225, 225, [0m
    [22m[35m  675, 243, 2187, 729, 2187, 216, 216, 243, 2187, 1944, 2187, 19683, 576, [0m
    [22m[35m  144, 576, 432, 81, 81, 729, 2187, 5184, 324, 8748, 243, 2187, 19683, 26244, [0m
    [22m[35m  19683 ][0m
    [22m[35mgap> Lcm(last);[0m
    [22m[35m12597120000[0m
    [22m[35mgap> Collected(Factors(last));[0m
    [22m[35m[ [ 2, 10 ], [ 3, 9 ], [ 5, 4 ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Similar  as  before,  we determine for any of the above mappings the residue
  classes  whose  elements larger than the largest b_r(m) - coefficient of the
  respective mapping are mapped to smaller integers:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> decs := List(stabelm,DecreasingOn);;[0m
    [22m[35mgap> List(decs,Modulus);[0m
    [22m[35m[ 2, 3, 8, 25, 9, 9, 16, 100, 12, 50, 25, 75, 27, 81, 54, 81, 64, 400, 48, [0m
    [22m[35m  200, 100, 72, 108, 400, 80, 200, 625, 25, 75, 45, 75, 75, 225, 81, 243, 81, [0m
    [22m[35m  243, 144, 144, 81, 243, 216, 243, 243, 128, 1600, 64, 400, 400, 48, 144, [0m
    [22m[35m  1600, 320, 400, 2500, 100, 100, 60, 96, 192, 108, 324, 144, 324, 972, 400, [0m
    [22m[35m  400, 80, 80, 400, 2500, 100, 1250, 625, 625, 25, 75, 75, 75, 45, 135, 600, [0m
    [22m[35m  120, 150, 1875, 75, 225, 135, 225, 225, 675, 243, 729, 243, 729, 108, 216, [0m
    [22m[35m  243, 729, 162, 729, 2187, 144, 144, 144, 144, 81, 81, 243, 729, 1296, 324, [0m
    [22m[35m  972, 243, 729, 2187, 1458, 2187 ][0m
    [22m[35mgap> Lcm(last);[0m
    [22m[35m174960000[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Since  the  least  common  multiple of the moduli of these unions of residue
  classes  is as large as 174960000, directly forming their union and checking
  whether  it  is equal to the set of integers would take relatively much time
  and  memory.  However, starting with the set of integers and subtracting the
  above sets one-by-one in a suitably chosen order is cheap:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> SortParallel(decs,stabelm,[0m
    [22m[35m>                 function(S1,S2)[0m
    [22m[35m>                   return First([1..100],k->Factorial(k) mod Modulus(S1) = 0)[0m
    [22m[35m>                        < First([1..100],k->Factorial(k) mod Modulus(S2) = 0);[0m
    [22m[35m>                 end);[0m
    [22m[35mgap> S := Integers;;[0m
    [22m[35mgap> for i in [1..Length(decs)] do[0m
    [22m[35m>      S_old := S; S := Difference(S,decs[i]);[0m
    [22m[35m>      if S <> S_old then ViewObj(S); Print("\n"); fi;[0m
    [22m[35m>      if S = [] then maxind := i; break; fi;[0m
    [22m[35m>    od;[0m
    [22m[35m0(2)[0m
    [22m[35m2(6) U 4(6)[0m
    [22m[35m<union of 8 residue classes (mod 30)>[0m
    [22m[35m<union of 19 residue classes (mod 90)>[0m
    [22m[35m<union of 114 residue classes (mod 720)>[0m
    [22m[35m<union of 99 residue classes (mod 720)>[0m
    [22m[35m<union of 57 residue classes (mod 720)>[0m
    [22m[35m<union of 54 residue classes (mod 720)>[0m
    [22m[35m<union of 41 residue classes (mod 720)>[0m
    [22m[35m<union of 35 residue classes (mod 720)>[0m
    [22m[35m<union of 8 residue classes (mod 720)>[0m
    [22m[35m4(720) U 94(720) U 148(720) U 238(720)[0m
    [22m[35m<union of 24 residue classes (mod 5760)>[0m
    [22m[35m<union of 72 residue classes (mod 51840)>[0m
    [22m[35m<union of 48 residue classes (mod 51840)>[0m
    [22m[35m<union of 192 residue classes (mod 259200)>[0m
    [22m[35m<union of 168 residue classes (mod 259200)>[0m
    [22m[35m<union of 120 residue classes (mod 259200)>[0m
    [22m[35m<union of 96 residue classes (mod 259200)>[0m
    [22m[35m<union of 72 residue classes (mod 259200)>[0m
    [22m[35m<union of 60 residue classes (mod 259200)>[0m
    [22m[35m<union of 48 residue classes (mod 259200)>[0m
    [22m[35m<union of 24 residue classes (mod 259200)>[0m
    [22m[35m<union of 12 residue classes (mod 259200)>[0m
    [22m[35m<union of 24 residue classes (mod 777600)>[0m
    [22m[35m<union of 12 residue classes (mod 777600)>[0m
    [22m[35m<union of 6 residue classes (mod 777600)>[0m
    [22m[35m[  ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Similar  as  above, it remains to check that the "small" integers all lie in
  the  orbit  containing2.  Obviously,  it  is  sufficient  to check that any
  integer  greater  than2  is mapped to a smaller one by some suitably chosen
  element of the stabilizer under consideration:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Maximum(List(stabelm{[1..maxind]},[0m
    [22m[35m>                 f->Maximum(List(Coefficients(f),c->c[2]))));[0m
    [22m[35m6581[0m
    [22m[35mgap> Filtered([3..6581],n->Minimum(List(stabelm,elm->n^elm))>=n);[0m
    [22m[35m[ 4 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  We have to treat 4 separately:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> 1^(u*a*u^2*a^-1*u);[0m
    [22m[35m1[0m
    [22m[35mgap> 4^(u*a*u^2*a^-1*u);[0m
    [22m[35m3[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Now  we know that any positive integer greater than1 lies in the same orbit
  under the action of the stabilizer of1 inG as2, thus that this stabilizer
  acts  transitively  on  N  \  1. But this means that we have established the
  2-transitivity of the action of G onN.
  
  In  the  following,  we essentially repeat the above steps to show that this
  action is indeed 3-transitive:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> tups := Concatenation(List([1..6],k->Tuples([1..4],k)));;[0m
    [22m[35mgap> tups := Filtered(tups,tup->ForAll([[1,3],[3,1],[2,4],[4,2]],[0m
    [22m[35m>                                      l->PositionSublist(tup,l)=fail));;[0m
    [22m[35mgap> stab := [];;[0m
    [22m[35mgap> for tup in tups do[0m
    [22m[35m>      l := [1,2];[0m
    [22m[35m>      for i in tup do l := List(l,n->n^gens[i]); od;[0m
    [22m[35m>      if l = [1,2] then Add(stab,tup); fi;[0m
    [22m[35m>    od;[0m
    [22m[35mgap> Length(stab);[0m
    [22m[35m212[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> stabelm := List(stab,tup->Product(List(tup,i->gens[i])));;[0m
    [22m[35mgap> decs := List(stabelm,DecreasingOn);;[0m
    [22m[35mgap> SortParallel(decs,stabelm,[0m
    [22m[35m>      function(S1,S2) return First([1..100],k->Factorial(k) mod Modulus(S1) = 0)[0m
    [22m[35m>                           < First([1..100],k->Factorial(k) mod Modulus(S2) = 0);[0m
    [22m[35m>      end);[0m
    [22m[35mgap> S := Integers;;[0m
    [22m[35mgap> for i in [1..Length(decs)] do[0m
    [22m[35m>      S_old := S; S := Difference(S,decs[i]);[0m
    [22m[35m>      if S <> S_old then ViewObj(S); Print("\n"); fi;[0m
    [22m[35m>      if S = [] then break; fi;[0m
    [22m[35m>    od;[0m
    [22m[35m0(2) U 3(8) U 5(8)[0m
    [22m[35m<union of 151 residue classes (mod 240)>[0m
    [22m[35m<union of 208 residue classes (mod 720)>[0m
    [22m[35m<union of 51 residue classes (mod 720)>[0m
    [22m[35m<union of 45 residue classes (mod 720)>[0m
    [22m[35m<union of 39 residue classes (mod 720)>[0m
    [22m[35m<union of 33 residue classes (mod 720)>[0m
    [22m[35m<union of 23 residue classes (mod 720)>[0m
    [22m[35m<union of 19 residue classes (mod 720)>[0m
    [22m[35m<union of 17 residue classes (mod 720)>[0m
    [22m[35m<union of 16 residue classes (mod 720)>[0m
    [22m[35m<union of 14 residue classes (mod 720)>[0m
    [22m[35m<union of 8 residue classes (mod 720)>[0m
    [22m[35m<union of 7 residue classes (mod 720)>[0m
    [22m[35m238(360) U 4(720) U 148(720) U 454(720)[0m
    [22m[35m<union of 38 residue classes (mod 5760)>[0m
    [22m[35m<union of 37 residue classes (mod 5760)>[0m
    [22m[35m<union of 25 residue classes (mod 5760)>[0m
    [22m[35m<union of 21 residue classes (mod 5760)>[0m
    [22m[35m<union of 17 residue classes (mod 5760)>[0m
    [22m[35m<union of 16 residue classes (mod 5760)>[0m
    [22m[35m<union of 138 residue classes (mod 51840)>[0m
    [22m[35m<union of 48 residue classes (mod 51840)>[0m
    [22m[35m<union of 32 residue classes (mod 51840)>[0m
    [22m[35m<union of 20 residue classes (mod 51840)>[0m
    [22m[35m<union of 16 residue classes (mod 51840)>[0m
    [22m[35m<union of 68 residue classes (mod 259200)>[0m
    [22m[35m<union of 42 residue classes (mod 259200)>[0m
    [22m[35m<union of 32 residue classes (mod 259200)>[0m
    [22m[35m<union of 26 residue classes (mod 259200)>[0m
    [22m[35m<union of 25 residue classes (mod 259200)>[0m
    [22m[35m<union of 11 residue classes (mod 259200)>[0m
    [22m[35m<union of 10 residue classes (mod 259200)>[0m
    [22m[35m<union of 7 residue classes (mod 259200)>[0m
    [22m[35m2164(259200) U 13414(259200) U 66964(259200) U 143014(259200) U 228964(259200)[0m
    [22m[35m2164(259200) U 66964(259200) U 228964(259200)[0m
    [22m[35m[  ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Maximum(List(stabelm,f->Maximum(List(Coefficients(f),c->c[2]))));[0m
    [22m[35m515816[0m
    [22m[35mgap> smallnum := [4..515816];;[0m
    [22m[35mgap> for i in [1..Length(stabelm)] do[0m
    [22m[35m>      smallnum := Filtered(smallnum,n->n^stabelm[i]>=n);[0m
    [22m[35m>    od;[0m
    [22m[35mgap> smallnum;[0m
    [22m[35m[  ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  The same for 4-transitivity:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> tups := Concatenation(List([1..8],k->Tuples([1..4],k)));;[0m
    [22m[35mgap> tups := Filtered(tups,tup->ForAll([[1,3],[3,1],[2,4],[4,2]],[0m
    [22m[35m>                                      l->PositionSublist(tup,l)=fail));;[0m
    [22m[35mgap> stab := [];;[0m
    [22m[35mgap> for tup in tups do[0m
    [22m[35m>      l := [1,2,3];[0m
    [22m[35m>      for i in tup do l := List(l,n->n^gens[i]); od;[0m
    [22m[35m>      if l = [1,2,3] then Add(stab,tup); fi;[0m
    [22m[35m>    od;[0m
    [22m[35mgap> Length(stab);[0m
    [22m[35m528[0m
    [22m[35mgap> stabelm := [];;[0m
    [22m[35mgap> for i in [1..Length(stab)] do[0m
    [22m[35m>      elm := One(G);[0m
    [22m[35m>      for j in stab[i] do[0m
    [22m[35m>        if Modulus(elm) > 10000 then elm := fail; break; fi;[0m
    [22m[35m>        elm := elm * gens[j];[0m
    [22m[35m>      od;[0m
    [22m[35m>      if elm <> fail then Add(stabelm,elm); fi;[0m
    [22m[35m>    od;[0m
    [22m[35mgap> Length(stabelm);[0m
    [22m[35m334[0m
    [22m[35mgap> decs := List(stabelm,DecreasingOn);;[0m
    [22m[35mgap> SortParallel(decs,stabelm,[0m
    [22m[35m>                 function(S1,S2)[0m
    [22m[35m>                   return First([1..100],k->Factorial(k) mod Modulus(S1) = 0)[0m
    [22m[35m>                        < First([1..100],k->Factorial(k) mod Modulus(S2) = 0);[0m
    [22m[35m>                 end);[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> S := Integers;;[0m
    [22m[35mgap> for i in [1..Length(decs)] do[0m
    [22m[35m>      S_old := S; S := Difference(S,decs[i]);[0m
    [22m[35m>      if S <> S_old then ViewObj(S); Print("\n"); fi;[0m
    [22m[35m>      if S = [] then maxind := i; break; fi;[0m
    [22m[35m>    od;[0m
    [22m[35m0(2) U 3(8) U 5(8)[0m
    [22m[35m<union of 46 residue classes (mod 72)>[0m
    [22m[35m<union of 20 residue classes (mod 72)>[0m
    [22m[35m4(18)[0m
    [22m[35m<union of 28 residue classes (mod 576)>[0m
    [22m[35m<union of 22 residue classes (mod 576)>[0m
    [22m[35m<union of 21 residue classes (mod 576)>[0m
    [22m[35m40(72) U 4(144) U 94(144) U 346(576) U 418(576)[0m
    [22m[35m<union of 16 residue classes (mod 576)>[0m
    [22m[35m<union of 15 residue classes (mod 576)>[0m
    [22m[35m4(144) U 94(144) U 346(576) U 418(576)[0m
    [22m[35m<union of 30 residue classes (mod 5184)>[0m
    [22m[35m<union of 26 residue classes (mod 5184)>[0m
    [22m[35m<union of 6 residue classes (mod 1296)>[0m
    [22m[35m<union of 504 residue classes (mod 129600)>[0m
    [22m[35m<union of 324 residue classes (mod 129600)>[0m
    [22m[35m<union of 282 residue classes (mod 129600)>[0m
    [22m[35m<union of 239 residue classes (mod 129600)>[0m
    [22m[35m<union of 218 residue classes (mod 129600)>[0m
    [22m[35m<union of 194 residue classes (mod 129600)>[0m
    [22m[35m<union of 154 residue classes (mod 129600)>[0m
    [22m[35m<union of 97 residue classes (mod 129600)>[0m
    [22m[35m<union of 85 residue classes (mod 129600)>[0m
    [22m[35m<union of 77 residue classes (mod 129600)>[0m
    [22m[35m<union of 67 residue classes (mod 129600)>[0m
    [22m[35m<union of 125 residue classes (mod 259200)>[0m
    [22m[35m<union of 108 residue classes (mod 259200)>[0m
    [22m[35m<union of 107 residue classes (mod 259200)>[0m
    [22m[35m<union of 101 residue classes (mod 259200)>[0m
    [22m[35m<union of 100 residue classes (mod 259200)>[0m
    [22m[35m<union of 84 residue classes (mod 259200)>[0m
    [22m[35m<union of 80 residue classes (mod 259200)>[0m
    [22m[35m<union of 76 residue classes (mod 259200)>[0m
    [22m[35m<union of 70 residue classes (mod 259200)>[0m
    [22m[35m<union of 66 residue classes (mod 259200)>[0m
    [22m[35m<union of 54 residue classes (mod 259200)>[0m
    [22m[35m<union of 53 residue classes (mod 259200)>[0m
    [22m[35m<union of 47 residue classes (mod 259200)>[0m
    [22m[35m<union of 43 residue classes (mod 259200)>[0m
    [22m[35m<union of 31 residue classes (mod 259200)>[0m
    [22m[35m<union of 24 residue classes (mod 259200)>[0m
    [22m[35m<union of 23 residue classes (mod 259200)>[0m
    [22m[35m<union of 13 residue classes (mod 259200)>[0m
    [22m[35m<union of 6 residue classes (mod 259200)>[0m
    [22m[35m<union of 14 residue classes (mod 777600)>[0m
    [22m[35m57406(259200) U 187006(259200) U 192676(259200) U 250276(259200)[0m
    [22m[35m<union of 8 residue classes (mod 777600)>[0m
    [22m[35m316606(777600) U 451876(777600) U 509476(777600) U 705406(777600) U 768676([0m
    [22m[35m777600)[0m
    [22m[35m<union of 18 residue classes (mod 3110400)>[0m
    [22m[35m<union of 17 residue classes (mod 3110400)>[0m
    [22m[35m<union of 13 residue classes (mod 3110400)>[0m
    [22m[35m<union of 9 residue classes (mod 3110400)>[0m
    [22m[35m<union of 7 residue classes (mod 3110400)>[0m
    [22m[35m<union of 14 residue classes (mod 9331200)>[0m
    [22m[35m<union of 7 residue classes (mod 9331200)>[0m
    [22m[35m<union of 7 residue classes (mod 27993600)>[0m
    [22m[35m<union of 14 residue classes (mod 83980800)>[0m
    [22m[35m<union of 7 residue classes (mod 83980800)>[0m
    [22m[35m[  ][0m
    [22m[35mgap> Maximum(List(stabelm{[1..maxind]},[0m
    [22m[35m>                 f->Maximum(List(Coefficients(f),c->c[2]))));[0m
    [22m[35m58975[0m
    [22m[35mgap> smallnum := [5..58975];;[0m
    [22m[35mgap> for i in [1..maxind] do[0m
    [22m[35m>      smallnum := Filtered(smallnum,n->n^stabelm[i]>=n);[0m
    [22m[35m>    od;[0m
    [22m[35mgap> smallnum;[0m
    [22m[35m[  ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  There is even some evidence that the degree of transitivity of the action of
  G on the positive integers is higher than4:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> phi := EpimorphismFromFreeGroup(G);[0m
    [22m[35m[ a, u ] -> [ a, u ][0m
    [22m[35mgap> F := Source(phi);[0m
    [22m[35m<free group on the generators [ a, u ]>[0m
    [22m[35mgap> words := List([5..20],[0m
    [22m[35m>                  n->RepresentativeActionPreImage(G,[1,2,3,4,5],[0m
    [22m[35m>                                                    [1,2,3,4,n],OnTuples,F));[0m
    [22m[35m[ <identity ...>, a^-3*u^4*a*u^-2*a^2, a^-2*u*a^-1*u*a^-1*u*a^-1*u*a^-1*u^-1*a[0m
    [22m[35m    , a^4*u^-2*a^-4, a^-1*u^-4*a, u^2*a^-1*u^2*a^-1*u^-2, u^-2*a^-2*u^4, [0m
    [22m[35m  a^-1*u^2*a, a^-1*u^-6*a, a^2*u^4*a^2*u^2, u^-4*a*u^-2*a^-3, [0m
    [22m[35m  a^-1*u^-2*a^-3*u^4*a^2, a^3*u^2*a*u^2, a*u^-4*a*u^-4*a^-2, [0m
    [22m[35m  u^-2*a*u^2*a*u^-2, u^-4*a^2*u^2 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  
  [1m[4m[31m4.16 A group which acts 3-transitively, but not 4-transitively on Z[0m
  
  In  this  section,  we would like to show that the wild group G generated by
  the  two tame mappings n -> n + 1 and tau_1(2),0(4) acts 3-transitively, but
  not 4-transitively on the set of integers.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := Group(ClassShift(0,1),ClassTransposition(1,2,0,4));[0m
    [22m[35m<rcwa group over Z with 2 generators>[0m
    [22m[35mgap> IsTame(G);[0m
    [22m[35mfalse[0m
    [22m[35mgap> (G.1^-2*G.2)^3*(G.1^2*G.2)^3; # G is not the free product C_infty * C_2. [0m
    [22m[35mIdentityMapping( Integers )[0m
    [22m[35mgap> Display(G);[0m
    [22m[35m[0m
    [22m[35mWild rcwa group over Z, generated by[0m
    [22m[35m[0m
    [22m[35m[[0m
    [22m[35mTame bijective rcwa mapping of Z: n -> n + 1[0m
    [22m[35m[0m
    [22m[35mBijective rcwa mapping of Z with modulus 4, of order 2[0m
    [22m[35m[0m
    [22m[35m                n mod 4                |    n^ClassTransposition(1,2,0,4)[0m
    [22m[35m---------------------------------------+--------------------------------------[0m
    [22m[35m  0                                    | (n + 2)/2[0m
    [22m[35m  1 3                                  | 2n - 2[0m
    [22m[35m  2                                    | n[0m
    [22m[35m[0m
    [22m[35m][0m
    [22m[35m[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  This  group acts transitively on Z, since already the cyclic group generated
  by  the  first  of  the two generators does so. Next we have to show that it
  acts  2-transitively.  We  essentially  proceed  as  in  the  example in the
  previous  section, by checking that the stabilizer of0 acts transitively on
  Z \ 0.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> gens := [ClassShift(0,1)^-1,ClassTransposition(1,2,0,4),ClassShift(0,1)];;[0m
    [22m[35mgap> tups := Concatenation(List([1..6],k->Tuples([-1,0,1],k)));;[0m
    [22m[35mgap> tups := Filtered(tups,tup->ForAll([[0,0],[-1,1],[1,-1]],[0m
    [22m[35m>                                      l->PositionSublist(tup,l)=fail));;[0m
    [22m[35mgap> Length(tups);[0m
    [22m[35m189[0m
    [22m[35mgap> stab := [];;[0m
    [22m[35mgap> for tup in tups do[0m
    [22m[35m>      n := 0;[0m
    [22m[35m>      for i in tup do n := n^gens[i+2]; od;[0m
    [22m[35m>      if n = 0 then Add(stab,tup); fi;[0m
    [22m[35m>    od;[0m
    [22m[35mgap> stabelm := List(stab,tup->Product(List(tup,i->gens[i+2])));;[0m
    [22m[35mgap> Collected(List(stabelm,Modulus));[0m
    [22m[35m[ [ 4, 6 ], [ 8, 4 ], [ 16, 3 ] ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> decs := List(stabelm,DecreasingOn);[0m
    [22m[35m[ 0(4), 3(4), 0(4), 3(4), 2(4), 0(4), 4(8), 2(4), 2(4), 0(4), 1(4), 0(8), [0m
    [22m[35m  3(8) ][0m
    [22m[35mgap> Union(decs);[0m
    [22m[35mIntegers[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Similar  as  in  the previous section, it remains to check that the integers
  with  "small"  absolute  value  all  lie in the orbit containing1 under the
  action of the stabilizer of0:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> Maximum(List(stabelm,f->Maximum(List(Coefficients(f),c->AbsInt(c[2])))));[0m
    [22m[35m21[0m
    [22m[35mgap> S := [1];;[0m
    [22m[35mgap> for elm in stabelm do S := Union(S,S^elm,S^(elm^-1)); od;[0m
    [22m[35mgap> IsSubset(S,Difference([-21..21],[0])); # Not yet ..[0m
    [22m[35mfalse[0m
    [22m[35mgap> for elm in stabelm do S := Union(S,S^elm,S^(elm^-1)); od;[0m
    [22m[35mgap> IsSubset(S,Difference([-21..21],[0])); # ... but now![0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Now  we  have  to  check  for 3-transitivity. Since we cannot find for every
  residue  class  an element of the pointwise stabilizer of 0,1 which properly
  divides  its  elements, we also have to take additions and subtractions into
  consideration.  Since the moduli of all of our stabilizer elements are quite
  small, simply looking at sets of representatives is cheap:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> tups := Concatenation(List([1..10],k->Tuples([-1,0,1],k)));;[0m
    [22m[35mgap> tups := Filtered(tups,tup->ForAll([[0,0],[-1,1],[1,-1]],[0m
    [22m[35m>                                      l->PositionSublist(tup,l)=fail));;[0m
    [22m[35mgap> Length(tups);[0m
    [22m[35m3069[0m
    [22m[35mgap> stab := [];[0m
    [22m[35m[  ][0m
    [22m[35mgap> for tup in tups do[0m
    [22m[35m>      l := [0,1];[0m
    [22m[35m>      for i in tup do l := List(l,n->n^gens[i+2]); od;[0m
    [22m[35m>      if l = [0,1] then Add(stab,tup); fi;[0m
    [22m[35m>    od;[0m
    [22m[35mgap> Length(stab);[0m
    [22m[35m10[0m
    [22m[35mgap> stabelm := List(stab,tup->Product(List(tup,i->gens[i+2])));;[0m
    [22m[35mgap> Maximum(List(stabelm,Modulus));[0m
    [22m[35m8[0m
    [22m[35mgap> Maximum(List(stabelm,f->Maximum(List(Coefficients(f),c->AbsInt(c[2])))));[0m
    [22m[35m8[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> decsp := List(stabelm,elm->Filtered([9..16],n->n^elm<n));[0m
    [22m[35m[ [ 9, 13 ], [ 10, 12, 14, 16 ], [ 12, 16 ], [ 9, 13 ], [ 12, 16 ], [0m
    [22m[35m  [ 9, 11, 13, 15 ], [ 9, 11, 13, 15 ], [ 12, 16 ], [ 12, 16 ], [0m
    [22m[35m  [ 9, 11, 13, 15 ] ][0m
    [22m[35mgap> Union(decsp);[0m
    [22m[35m[ 9, 10, 11, 12, 13, 14, 15, 16 ][0m
    [22m[35mgap> decsm := List(stabelm,elm->Filtered([-16..-9],n->n^elm>n));[0m
    [22m[35m[ [ -15, -13, -11, -9 ], [ -16, -12 ], [ -16, -12 ], [ -15, -11 ], [0m
    [22m[35m  [ -16, -14, -12, -10 ], [ -15, -11 ], [ -15, -11 ], [ -16, -14, -12, -10 ], [0m
    [22m[35m  [ -16, -14, -12, -10 ], [ -15, -11 ] ][0m
    [22m[35mgap> Union(decsm);[0m
    [22m[35m[ -16, -15, -14, -13, -12, -11, -10, -9 ][0m
    [22m[35mgap> S := [2];;[0m
    [22m[35mgap> for elm in stabelm do S := Union(S,S^elm,S^(elm^-1)); od;[0m
    [22m[35mgap> IsSubset(S,Difference([-8..8],[0,1]));[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  At  this  point we have established 3-transitivity. It remains to check that
  the  group  G does not act 4-transitively. We do this by checking that it is
  not  transitive on 4-tuples (mod4). Since nmod8 determines the image of n
  under a generator of G (mod4), it suffices to compute (mod8):
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> orb := [[0,1,2,3]];;[0m
    [22m[35mgap> extend := function ()[0m
    [22m[35m>      local gen;[0m
    [22m[35m>      for gen in gens do[0m
    [22m[35m>        orb := Union(orb,List(orb,l->List(l,n->n^gen) mod 8));[0m
    [22m[35m>      od;[0m
    [22m[35m>    end;;[0m
    [22m[35mgap> repeat[0m
    [22m[35m>      old := ShallowCopy(orb);[0m
    [22m[35m>      extend(); Print(Length(orb),"\n");[0m
    [22m[35m>    until orb = old;[0m
    [22m[35m7[0m
    [22m[35m27[0m
    [22m[35m97[0m
    [22m[35m279[0m
    [22m[35m573[0m
    [22m[35m916[0m
    [22m[35m1185[0m
    [22m[35m1313[0m
    [22m[35m1341[0m
    [22m[35m1344[0m
    [22m[35m1344[0m
    [22m[35mgap> Length(Set(List(orb,l->l mod 4)));[0m
    [22m[35m120[0m
    [22m[35mgap> last < 4^4;[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  This  shows  that  G is not 4-transitive on Z. The corresponding calculation
  for 3-tuples looks as follows:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> orb := [[0,1,2]];;[0m
    [22m[35mgap> repeat[0m
    [22m[35m>      old := ShallowCopy(orb);[0m
    [22m[35m>      extend(); Print(Length(orb),"\n");[0m
    [22m[35m>    until orb = old;[0m
    [22m[35m7[0m
    [22m[35m27[0m
    [22m[35m84[0m
    [22m[35m207[0m
    [22m[35m363[0m
    [22m[35m459[0m
    [22m[35m503[0m
    [22m[35m512[0m
    [22m[35m512[0m
    [22m[35mgap> Length(Set(List(orb,l->l mod 4)));[0m
    [22m[35m64[0m
    [22m[35mgap> last = 4^3;[0m
    [22m[35mtrue[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  Needless  to  say  that the latter kind of argumentation is not suitable for
  proving, but only for disproving k-transitivity.
  
  
  [1m[4m[31m4.17 Grigorchuk groups[0m
  
  In  this section, we show how construct finite quotients of the two infinite
  periodic groups introduced by Rostislav Grigorchuk in[G80] with the help of
  [1mRCWA[0m.  The  first  of  these,  nowadays  known  as  "Grigorchuk  group",  is
  investigated   in   an   example   given   on   the   [1mGAP[0m   website  --  see
  [34mhttp://www.gap-system.org/Doc/Examples/grigorchuk.html[0m.   The  [1mRCWA[0m  package
  permits  a  simpler and more elegant construction of the finite quotients of
  this  group:  The  function  [22m[32mTopElement[0m  given on the mentioned webpage gets
  unnecessary, and the function [22m[32mSequenceElement[0m can be simplified as follows:
  
  [22m[35m------------------------------------------------------------------[0m
    [22m[35m[0m
    [22m[35mSequenceElement := function ( r, level )[0m
    [22m[35m[0m
    [22m[35m  return Permutation(Product(Filtered([1..level-1],k->k mod 3 <> r),[0m
    [22m[35m                             k->ClassTransposition(    2^(k-1)-1, 2^(k+1),[0m
    [22m[35m                                                   2^k+2^(k-1)-1, 2^(k+1))),[0m
    [22m[35m                     [0..2^level-1]);[0m
    [22m[35mend;[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  The actual constructors for the generators are modified as follows:
  
  [22m[35m------------------------------------------------------------------[0m
    [22m[35m[0m
    [22m[35ma := level -> Permutation(ClassTransposition(0,2,1,2),[0..2^level-1]);[0m
    [22m[35mb := level -> SequenceElement(0,level);[0m
    [22m[35mc := level -> SequenceElement(2,level);[0m
    [22m[35md := level -> SequenceElement(1,level);[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  All  computations  given  on  the  webpage  can now be done just as with the
  "original"  construction  of  the  quotients of the Grigorchuk group. In the
  sequel,  finite  quotients  of  the  second  group  introduced  in[G80] are
  constructed:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> FourCycle := RcwaMapping((4,5,6,7),[4..7]);[0m
    [22m[35m<rcwa mapping of Z with modulus 4>[0m
    [22m[35mgap> GrigorchukGroup2Generator := function ( level )[0m
    [22m[35m>      if level = 1 then return FourCycle; else[0m
    [22m[35m>        return   Restriction(FourCycle, RcwaMapping([[4,1,1]]))[0m
    [22m[35m>               * Restriction(FourCycle, RcwaMapping([[4,3,1]]))[0m
    [22m[35m>               * Restriction(GrigorchukGroup2Generator(level-1),[0m
    [22m[35m>                             RcwaMapping([[4,0,1]]));[0m
    [22m[35m>      fi;[0m
    [22m[35m>    end;;[0m
    [22m[35mgap> GrigorchukGroup2 := level -> Group(FourCycle,[0m
    [22m[35m>                                       GrigorchukGroup2Generator(level));;[0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
  We  can do similar things as shown in the example on the [1mGAP[0m webpage for the
  "first" Grigorchuk group:
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35m[0m
    [22m[35mgap> G := List([1..4],lev->GrigorchukGroup2(lev)); # The first 4 quotients.[0m
    [22m[35m[ <rcwa group over Z with 2 generators>, <rcwa group over Z with 2 generators>[0m
    [22m[35m    , <rcwa group over Z with 2 generators>, [0m
    [22m[35m  <rcwa group over Z with 2 generators> ][0m
    [22m[35mgap> H := List([1..4],lev->Action(G[lev],[0..4^lev-1])); # Isomorphic perm.-gps.[0m
    [22m[35m[ Group([ (1,2,3,4), (1,2,3,4) ]), [0m
    [22m[35m  Group([ (1,2,3,4)(5,6,7,8)(9,10,11,12)(13,14,15,16), [0m
    [22m[35m      (1,5,9,13)(2,6,10,14)(4,8,12,16) ]), [0m
    [22m[35m  <permutation group with 2 generators>, [0m
    [22m[35m  <permutation group with 2 generators> ][0m
    [22m[35mgap> List(H,Size);[0m
    [22m[35m[ 4, 1024, 4294967296, 1329227995784915872903807060280344576 ][0m
    [22m[35mgap> List(last,n->Collected(Factors(n)));[0m
    [22m[35m[ [ [ 2, 2 ] ], [ [ 2, 10 ] ], [ [ 2, 32 ] ], [ [ 2, 120 ] ] ][0m
    [22m[35mgap> List(H,NilpotencyClassOfGroup);      [0m
    [22m[35m[ 1, 6, 14, 40 ][0m
    [22m[35m[0m
  [22m[35m------------------------------------------------------------------[0m
  
