"Source: Text/Group/GrpAb.text";
"Line: 425";
"Date: Thu Sep 25 14:47:45 2025";
"Main: Fri Sep 26 14:29:19 2025";
// original file: Text/Group/GrpAb.text, line: 425
// Example: H77E5 ()
print "Example: H77E5";
ei := GetEchoInput();
SetEchoInput(true);
m :=  34384;
Zm := Integers(m);
U := {@ x : x in Zm | GCD(x, m) eq 1 @};
G := GenericAbelianGroup(U :
       IdIntrinsic := "Id",
       AddIntrinsic := "*",
       InverseIntrinsic := "/");
G;
n := 6;
Dk := -4*(10^n + 1);
Q := QuadraticForms(Dk);   

p := 2;
S := { };
while #S lt 10 do 
   if KroneckerSymbol(Dk,p) eq 1 then
      I := Reduction(PrimeForm(Q,p));
      Include(~S, I);
   end if; 
   p := NextPrime(p);
end while;

QF := GenericAbelianGroup(Q : UserGenerators := S,
                              ComputeStructure := true,
                              UseUserGenerators := true);  
QF;
SetEchoInput(ei);
