Computing the length of a finite group Can someone suggest a GAP or MAGMA command (or code) to obtain the length $l(G)$ of a finite group $G$, i.e. the maximum length of a strictly descending chain of subgroups in $G$?
Thanks in advance.

Just to get you started, here is a very short recursive Magma function to compute
this. You could do something similar in GAP. Of course, it will only work in reasonable time for small groups. On my computer it took about 10 seconds to do $A_8$. To do better you would need to do something more complicated like working up through the subgroup lattice. It is not an easy function to compute exactly.
 Len := function(G)

 if #G eq 1 then return 0; end if;
 return 1 + Max([$$(m`subgroup) : m in MaximalSubgroups(G)]);
 end function;

