The GAP package FORMAT allows computing things like Carter subgroups.
To compute all solvable but not nilpotent groups of order up to 100, you can use this:
gap> grps := AllSmallGroups([1..100], IsNilpotentGroup, false, IsSolvableGroup, true);;
gap> Length(grps);
463
So let's look at some examples
gap> LoadPackage("format");
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Loading FORMAT 1.3 (Formations of Finite Soluble Groups)
by Bettina Eick (http://www.icm.tu-bs.de/~beick) and
Charles R.B. Wright (http://www.uoregon.edu/~wright).
Homepage: http://www.uoregon.edu/~wright/RESEARCH/format/
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
true
gap> grps := AllSmallGroups([1..100], IsNilpotentGroup, false, IsSolvableGroup, true);;
gap> G := grps[100]; # some arbitrary group
<pc group of size 50 with 3 generators>
gap> N := NormalSubgroups(G)[3]; # some normal subgroup
Group([ f3 ])
gap> N := Group(G.1*G.3);; # some nilpotent subgroup
gap> IsNilpotentGroup(N);
true
Since all Carter subgroups of a finite solvable group are conjugate, we can count how many of them contain $N$ quite easily:
gap> count := function(G, N) return Number(ConjugacyClassSubgroups(G, CarterSubgroup(G)), x -> IsSubgroup(x, N)); end;;
gap> count(G,N);
1
Finally, you can compute the value mod $m(G)$ as follows:
gap> m := G -> Gcd(List(Set(Factors(Size(G))), p -> p-1));;
gap> count(G,N) mod m(G);
0
UPDATE: Your comments indicate that what you really want to do is to test a conjecture which states that a certain number is always 0 or 1. The code you wrote based on my post does that; I edited it slightly to make it a bit faster.
UPDATE 2: Per your request, I changed the code to skip the case where the Carter subgroup is a Hall subgroup.
LoadPackage("format");;
count := function(G, N)
return Number(ConjugacyClassSubgroups(G, CarterSubgroup(G)),
x -> IsSubgroup(x, N));
end;;
m := G -> Gcd(List(Set(Factors(Size(G))), p -> p-1));;
grps := AllSmallGroups([1..100], IsNilpotentGroup, false, IsSolvableGroup, true);;
for i in [1..Length(grps)] do
if i mod 50 = 0 then Print(i, " of ", Length(grps), "\n"); fi;
G := grps[i];;
# skip if Carter subgroup is a Hall subgroup
H := CarterSubgroup(G);
if Gcd(Size(H), Index(G, H)) = 1 then continue; fi;
nilsubs := Filtered(List(ConjugacyClassesSubgroups(G),Representative),IsNilpotentGroup);;
mG := m(G);
for N in nilsubs do
if count(G,N) mod mG > 1 then
Print("Group ", IdGroup(G), " provides an example\n");
fi;
od;
od;
Representative
, notElements
), as the count will be the same for conjugate subgroups. – Max Horn Aug 06 '16 at 13:13