Question: How to get a group that meeting the criteria?

I'm a newbie to maple, I want to get a group that meeting the criteria with this code:

with(GroupTheory);
G := SymmetricGroup(6);

do

H := Subgroup({RandomElement(G),RandomElement(G)}, G);

C := Core(H, G);

until is(GroupOrder(C) <> 1) and is(GroupOrder(C) <> GroupOrder(H));
H;
C;

But it's seem I cannot construct subgroup. so I adjust it into:

with(GroupTheory);
G := SymmetricGroup(6);

do

H := Subgroup({[[rand(1 .. 6)]], [[rand(1 .. 6), rand(1 .. 6)], [rand(1 .. 6), rand(1 .. 6)]]}, G);

C := Core(H, G);

until is(GroupOrder(C) <> 1) and is(GroupOrder(C) <> GroupOrder(H));
H;
C;

However, it is clear that random numbers do not always satisfy the rules of permutation. So how can I use the loop to generate a random subgroup that satisfies the condition?

Please Wait...