gpords := [2..1000]; LowGenGroupIndices := []; for g in gpords do n := NumberOfSmallGroups(g); print "Looking at ",n," groups of order ",g,"."; for j := 1 to n do G := SmallGroup(g,j); A := AbelianQuotient(G); ai := AbelianInvariants(A); if #ai le 2 then Append(~LowGenGroupIndices, [g,j]); end if; delete(A); delete(G); end for; end for; FW := Open("lowgengroups2.mgm","w"); fprintf FW, "LowGenGroupIndices := \n%o;\n", LowGenGroupIndices; delete(FW);