# 有限羣子羣和正規子羣個數的計算

GAP命令爲：
gap> G:=SmallGroup(8,3);;S:=AllSubgroups(G);;N:=NormalSubgroups(G);;List(S,IdGroup);for g in S do Print(g in N,",");od;Print("\n");List(N,IdGroup);
[ [ 1, 1 ], [ 2, 1 ], [ 2, 1 ], [ 2, 1 ], [ 2, 1 ], [ 2, 1 ], [ 4, 2 ], [ 4, 2 ], [ 4, 1 ], [ 8, 3 ] ]
true,true,false,false,false,false,true,true,true,true,
[ [ 8, 3 ], [ 4, 2 ], [ 4, 1 ], [ 4, 2 ], [ 2, 1 ], [ 1, 1 ] ]
gap> G:=SmallGroup(8,4);;S:=AllSubgroups(G);;N:=NormalSubgroups(G);;List(S,IdGroup);for g in S do Print(g in N,",");od;Print("\n");List(N,IdGroup);
[ [ 1, 1 ], [ 2, 1 ], [ 4, 1 ], [ 4, 1 ], [ 4, 1 ], [ 8, 4 ] ]
true,true,true,true,true,true,
[ [ 8, 4 ], [ 4, 1 ], [ 4, 1 ], [ 4, 1 ], [ 2, 1 ], [ 1, 1 ] ]
gap> G:=SmallGroup(6,1);;S:=AllSubgroups(G);;N:=NormalSubgroups(G);;List(S,IdGroup);for g in S do Print(g in N,",");od;Print("\n");List(N,IdGroup);
[ [ 1, 1 ], [ 2, 1 ], [ 2, 1 ], [ 2, 1 ], [ 3, 1 ], [ 6, 1 ] ]
true,false,false,false,true,true,
[ [ 6, 1 ], [ 3, 1 ], [ 1, 1 ] ]

S1={(1)}、S2={(1),(12)}、S3={(1),(13)}、S4={(1),(23)}、S5={(1),(123),(132)}、S6=S_3

|S(S_3)|=6,|N(S_3)|=3
|S(D_4)|=10,|N(D_4)|=6
|S(Q_8)|=6,|N(D_6)|=6
|S(Q_12)|=8,|N(Q_12)|=5
|S(A_4)|=10,|N(A_4)|=3
|S(D_6)|=16,|N(D_6)|=7
|S(C_4)|=3,|N(C_4)|=3
|S(S_4)|=30,|N(S_4)|=4
|S(C_6)|=4,|N(C_6)|=4
N(S_4)={{e},K_4,A_4,S_4}
S(C_6)={C_1,C_2,C_3,C_6}
S(S_3)={C_1,C_2,C_2,C_2,C_3,C_6}
A_4={(1), (123), (132), (124), (142), (134), (143), (234), (243), (12)(34), (13)(24), (14)(23)}
K_4={(1),(12)(34),(13)(24),(14)(23)}
C_4的非平凡子羣有C_2。
S_6的50個18階子羣、S_6的12個60階子羣
gap> G:=SmallGroup(4,1);;S:=AllSubgroups(G);;N:=NormalSubgroups(G);;List(S,IdGroup);for g in S do Print(g in N,",");od;Print("\n");List(N,IdGroup);
[ [ 1, 1 ], [ 2, 1 ], [ 4, 1 ] ]
true,true,true,
[ [ 4, 1 ], [ 2, 1 ], [ 1, 1 ] ]
gap> G:=SymmetricGroup(5);;S:=AllSubgroups(G);;N:=NormalSubgroups(G);;S1:=[];;for g in S do if not (IdGroup(g) in S1) then  Add(S1,IdGroup(g));fi;od;List(S1);List(N,IdGroup);Print("|S(G)|=",Size(S),",|N(G)|=",Size(N),"\n");
[ [ 1, 1 ], [ 2, 1 ], [ 3, 1 ], [ 4, 2 ], [ 4, 1 ], [ 5, 1 ], [ 6, 1 ], [ 6, 2 ], [ 8, 3 ], [ 10, 1 ], [ 12, 3 ],
[ 12, 4 ], [ 20, 3 ], [ 24, 12 ], [ 60, 5 ], [ 120, 34 ] ]
[ [ 120, 34 ], [ 60, 5 ], [ 1, 1 ] ]
|S(G)|=156,|N(G)|=3
gap> G:=SymmetricGroup(6);;S:=AllSubgroups(G);;N:=NormalSubgroups(G);;S1:=[];;for g in S do if not (IdGroup(g) in S1) then  Add(S1,IdGroup(g));fi;od;List(S1);List(N,IdGroup);Print("|S(G)|=",Size(S),",|N(G)|=",Size(N),"\n");
[ [ 1, 1 ], [ 2, 1 ], [ 3, 1 ], [ 4, 2 ], [ 4, 1 ], [ 5, 1 ], [ 6, 1 ], [ 6, 2 ], [ 8, 5 ], [ 8, 3 ], [ 8, 2 ],
[ 9, 2 ], [ 10, 1 ], [ 12, 3 ], [ 12, 4 ], [ 16, 11 ], [ 18, 4 ], [ 18, 3 ], [ 20, 3 ], [ 24, 13 ], [ 24, 12 ],
[ 36, 10 ], [ 36, 9 ], [ 48, 48 ], [ 60, 5 ], [ 72, 40 ], [ 120, 34 ], [ 360, 118 ], [ 720, 763 ] ]
[ [ 720, 763 ], [ 360, 118 ], [ 1, 1 ] ]
|S(G)|=1455,|N(G)|=3