**GAP Lesson 1
**

*Start up GAP.*

Arithmetic Operations

Try the following. Press the return key at the end of each line.

gap> 5+7;

gap> 12/17;

gap> 2/3 + 3/4;

gap> 2^3*3^3;

gap> 3.14159;

gap> Factors(1111111);

gap> Factors(11111111111);

gap> Factors(2^32 + 1);

gap> Factors(216);

gap> last;

gap> Collected(last);

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;

gap> Int(295/7);

gap> Gcd(216,930);

gap> Lcm(216,930);

gap> Factorial(6);

gap> (1,2,3)*(1,2);

gap> (1,2,3)^-1;

gap> (1,2,3)^(2,5);

gap> 1^(1,2,3);

gap> ?

gap> ?Help

gap> ?Factor

gap> ?A f s

gap> ?>

gap> ??

gap> 216=2^3*3^3;

gap> 216=2^3;

gap> g=17;

gap> g;

gap> g:=17;

gap> g;

gap> g=17;

gap> g=21;

gap> g^2;

gap> 3<=2;

gap> 3>=2;

gap> true or false;

gap> a:=Group((2,3,5)(6,7,8),(1,2,4,7)(3,6,8,5));

gap> Size(a);

gap> Center(a);

gap> Size(last);

gap> g:=SymmetricGroup(6);

gap> Size(g);

gap> h:=DerivedSubgroup(g);

gap> Size(h);

gap> (1,2) in h;

gap> (1,2,3) in h;

gap> p:=SylowSubgroup(g,2);

gap> Size(p);

gap> Elements(p);

gap> Center(p);

gap> Size(last);

gap> d:=DihedralGroup(8);

gap> Size(d);