GAP Lesson 1
Start up GAP.
You learn: + - * / ^, terminating input with ;, last. Factors, mod, Int, Gcd, Lcm, Factorial.
Try the following. Press the return key at the end of each line.
gap> 2/3 + 3/4;
gap> Factors(2^32 + 1);
There are also variables last2 and last3. Guess what their values are.
Exercise: Find the first number of the form 111..1 which is prime. Note that such a number must have a prime number of digits. As well as Factors, another useful function is IsPrime.
gap> -5 mod 11;
gap> 6 mod -5;
gap> 6 mod 0;
What would you expect Int(-1/2) to be?
You learn: permutations are enclosed in (), operation s have the same form as for integers. Conjugation is built in.
When we come to them, other kinds of elements such as matrices, and elements of finite fields can be manipulated with the same syntax.
You learn: lines are not terminated with ; How to call up and browse sections of the manual.
gap> ?A f s
True and False; Assignment of Variables
You learn: The difference between = and :=, how to store things in memory.
Exercise: What response do you expect from
gap> true and false;
gap> true or false;
Permutation groups; groups from the library; operations on groups
You learn: how to input a group generated by permutations. The operations Size, Center, DerivedSubgroup, in, SylowSubgroup, Elements, SymmetricGroup, AlternatingGroup, DihedralGroup.
gap> (1,2) in h;
gap> (1,2,3) in h;
Exercise: Identify the Sylow 2-subgroups of