SmallPermGroupIndices := []; for g := 2 to 1000 do if not IsPrimePower(g) then n := NumberOfSmallGroups(g); print g,n; for j := 1 to n do G := SmallGroup(g,j); if Type(G) eq GrpPerm then Append(~SmallPermGroupIndices, [g,j]); end if; end for; end if; end for; FW := Open("smallpermgroups.mgm","w"); fprintf FW, "SmallPermGroupIndices := \n%o;\n", SmallPermGroupIndices; delete(FW);