Chapter5.mws

Abstract Algebra with Maple
Chapter 5: Cyclic Groups

by Alec Mihailovs

5. Cyclic Groups

Primitive Roots

Group Z[n] has phi(n) generators. To find them, we can use procedure un . For example,

> un:=n->select(m->evalb(igcd(m,n)=1),[$1..n]):

> un(20);

[1, 3, 7, 9, 11, 13, 17, 19]

The generators of U ( n ) if they exist, are called primitive roots mod n . One of them can be found using the function primroot from the numtheory package that we already loaded in section 2. For example,

> with(numtheory):

> primroot(43);

3

It fails when the group U ( n ) is not cyclic, so it doesn't have a generator. For example,

> primroot(45);

FAIL

To find all generators, we can use the following procedure:

> primroots:=n->{seq(primroot(n)^un(phi(n))[i] mod n, i=1..phi(phi(n)))}:

For example,

> primroots(43);

{3, 5, 12, 18, 19, 20, 26, 28, 29, 30, 33, 34}

> primroots(45);

{FAIL}

The number of generators of U ( n ) equals phi(phi(n)) when it is a cyclic group. For example,

> phi(phi(43));

12

Elements of Order d

Theorem 4.4 on p. 80 of Dr. Gallian's text tells us that if d is a positive divisor of n , then there are phi(d) elements of order d in Z[n] . The following procedure lists all of them:

> nordlist:=(d,n)->`if`(type(n/d,integer),map(x->x*n/d mod n,un(d)),[]):

For example, the list of elements of order 20 in Z[100] :

> nordlist(20,100);

[5, 15, 35, 45, 55, 65, 85, 95]

The following procedure counts the number of elements of order d in U ( n ):

> nordU:=proc(d,n) local i, k;
k:=0; for i from 1 to phi(n) do if order(un(n)[i],n)=d then k:=k+1 fi od; k end:

For example, the number of elements of order 2 in U (45):

> nordU(2,45);

3

It immediately implies that U (45) is not a cyclic group, because a cyclic group might have either 0 elements of order 2 if it has an odd order, or 1 element of order 2 if it has an even order.

The following procedure counts the number of elements of order d in an extended group G :

> Nord:=proc(d,g) local i, k;
k:=0; for i from 1 to nops(g[1]) do if Ord(g[1][i],g)=d then k:=k+1 fi od; k end:

For example, the number of elements of order 10 in SL (2, Z[5] ):

> Nord(10,SL2(5));

24

Notice that

> phi(10);

4

and 24 is divisible by phi(10) = 4 , as it is supposed to be according to the Corollary on p. 80 of Dr. Gallian's book.

Another example, the number of elements of order 2 in groups GL (2, Z[n] ) for n from 2 to 6:

> for n from 2 to 6 do Nord(2,GL2(n)) od;

3

13

27

31

55

Try to find this sequence in Neil Sloane's On-Line Encyclopedia of Integer Sequences. Certainly, for every specific group, one can write a program calculating the number of elements of given order faster. For instance, for the elements of order 2 in GL (2, Z[n] ),

> ord2inGL2:=proc(n) local a,b,c,d,N; N:=0;
for a from 0 to n-1 do for b from 0 to n-1 do for c from 0 to n-1 do for d from 0 to n-1 do
if a^2+b*c mod n = 1 and b*(a+d) mod n = 0 and c*(a+d) mod n = 0 and d^2+b*c mod n =1
then N:=N+1 fi od od od od; N-1 end:

The following procedure lists the elements of order d in an extended group G :

> Nordlist:=proc(d,g) local i, v; v:=[];
for i from 1 to nops(g[1]) do if Ord(g[1][i],g)=d then v:=[op(v),g[1][i]] fi od; v end:

For example, here is the list of elements of order 2 in GL (2, Z[5] ):

> map(matrix,Nordlist(2,GL2(5)));

[matrix([[1, 0], [0, 4]]), matrix([[1, 0], [1, 4]])...
[matrix([[1, 0], [0, 4]]), matrix([[1, 0], [1, 4]])...
[matrix([[1, 0], [0, 4]]), matrix([[1, 0], [1, 4]])...

Subgroup Lattice of Z[n]

We have to load two packages for this section:

> with(plottools): with(networks):

Warning, these names have been redefined: dodecahedron, icosahedron, octahedron, tetrahedron

A subgroup lattice of Z[n] can be drawn using the following procedure:

> subZ:=proc(n) local d,i,j,k,x,G,len,L,LL;
new(G); d:=divisors(n);
addvertex(map(x->cat(`<`,x mod n,`>`),d),G); len:=a->add(ifactors(a)[2,i,2],i=1..nops(ifactors(a)[2]));
L:=seq(convert(select(a->evalb(len(a)=i),d),list),i=0..len(n));
for i from 1 to len(n) do for j from 1 to nops(L[i]) do for k from 1 to nops(L[i+1]) do
if L[i+1,k] mod L[i,j] = 0 then addedge(map(x->cat(`<`,x mod n,`>`),[L[i,j],L[i+1,k]]),G) fi od od od;
LL:=seq(map(x->cat(`<`,x mod n,`>`),L[i]),i=1..len(n)+1);
rotate(draw(Linear(LL),G),-Pi/2);
end:

For example, for n = 30:

> subZ(30);

[Maple Plot]

It looks like a cube, doesn't it? Even more after rotating the picture by 90 degrees:

> rotate(%,Pi/2);

[Maple Plot]

Another example, for n = 210 (a 4-dimensional hypercube:-)

> subZ(210);

[Maple Plot]

Don't stop at that, draw a 5-dimensional hypercube!

> subZ(2310);

[Maple Plot]

Number of subgroups of Z[n] equals the number of divisors of n , which can be evaluated using the function tau :

> tau(30);

8

> tau(210);

16

> tau(2310);

32

>

Exercises.