> < ^ From:

< ^ Subject:

Dear GAP-Forum,

Pat Callahan asked:

Is there a simple way to create a list of how many elements of each order

there are for a given group? Thanks,

If the group is finite, of fair size, if you know a set of generators and if

the group is given in a representation in which computations are feasible

(for example for finitely presented groups, the coset enumeration might not

succeed in the memory available; if your group is a permutation group or an

AgGroup there is no such problem), the following commands compute a list

containing orders and numbers:

# orders occuring

ord:=Set(List(ConjugacyClasses(G),i->Order(G,i.representative)));

# numbers

cnt:=List(ord,i->0);

for i in ConjugacyClasses(G) do

o:=Order(G,i.representative);

p:=Position(ord,o);

cnt[p]:=cnt[p]+Size(i);

od;

result:=List([1..Length(ord)],i->[ord[i],cnt[i]]);

Best regards,

Alexander Hulpke

> < [top]