GAP:OrderStatistics

From Groupprops
Jump to: navigation, search

Definition

The definition takes one argument, which is a group, and returns a list.

Method

Code

OrderStatistics := function(G)
        local L,D;
        L := List(Set(G),Order);
        D := DivisorsInt(Order(G));
        return(List(D,x->Length(Filtered(L,y->x=y))));
end;;

Here is a slight variant, the paired version, that pairs each divisor with the number of elements of that order:

OrderStatisticsPaired := function(G)
        local L,D;
        L := List(Set(G),Order);
        D := DivisorsInt(Order(G));
        return(List(D,x->[x,Length(Filtered(L,y->x=y))]));
end;;