# A GAP code for a class of small groups

I need a GAP code for checking the following question

Let $n$ be a given positive integer. Is it true that every group $G$ of order $n$ is either solvable or satisfies the condition: "For any positive divisor $d$ of $n$ there exists a subgroup of $G$ with order $d$ or $n/d$"?

We know that all $n<240$ satisfy the above property. So, the first interested number is $n=240$. Indeed, we are looking for a natural number $n$ which does not have the above property.

nmax:=240;
for n in [240..nmax] do
if IsPrime(n) then continue; fi;
div:=DivisorsInt(n);
gl:=AllSmallGroups(n);
for g in gl do
if IsSolvableGroup(g) then continue; fi;
ll:=LatticeSubgroups(g);
cc:=ConjugacyClassesSubgroups(ll);
szs:=List(cc,c->Size(Representative(c)));
if not ForAll(div, d->d in szs or n/d in szs) then
Display(IdSmallGroup(g));
fi;
od;
od;


It is possible to add a break statement after the Display if only one example is wanted.

UPDATE:

There seems to be an exception : The group PSL(2,8) is not solvable and lacks subgroups of order $12, 21, 24, 28, 36, 42, 63, 72, 84, 126, 168, 252$. The question that rises now is :"Could one have predicted this result on theoretical grounds?".

• Dear Nimda, many thanks for your answer. Since I'm not familiar to the GAP, would you tell me: 1. Is the second od; necessary at the end 2. what is the break statement after the Display, exactly? 3. Did you run it for n=240 (true or false)? Oct 7, 2014 at 12:40
• Thanks! Please also note that there are several ways to improve this: 1. Call ConjugacyClassesSubgroups(g) without the lattice of subgroups since we're not interested in inclusions. 2. Use SmallGroup(m,n) instead of generating full list of groups of a given order. 3. Don't test groups for which solvability follows from their order, like $p$-groups and groups of odd order. 4. Have a modular code with three layers: test one group; test all groups of a given order; test all groups from a range of orders. It's a common search problem, and it will be easy to plug different functions there. Oct 7, 2014 at 14:03
• ! Interesting ! The first answer is [ 504, 156 ]. 504 is the given number $n$, what is 156? Oct 7, 2014 at 18:09
• Use the GAP command G:=SmallGroup(504,156);StructureDescription(G); and you will get a fair description of the group. Oct 7, 2014 at 19:30
• If you want to see the result for all the groups of order $504$ put an # before the line $\mathtt{if\ IsSolvableGroup(g)}$. Oct 8, 2014 at 17:27