/* Generates arguments for the L3check program. Call L3args with the desired value of q, then use the returned string as the argument list to L3check. e.g., for q = 7: $ magma -b L3.m > L3args(7); 7 1 4 1 3 4 6 3 0 3 2 3 19 > quit; $ L3check 7 1 4 1 3 4 6 3 0 3 2 3 19 q = 7: FAIL for beta = w^57, gamma = w^2 + w */ L3args := function(q) F := GF(q); p := Characteristic(F); n := Degree(F); a := PrimitiveElement(F); pol1 := MinimalPolynomial(a); C1 := ChangeUniverse(Eltseq(pol1), Integers()); K := ext; w := PrimitiveElement(K); pol2 := MinimalPolynomial(w, F); C2 := [ IsZero(c) select q-1 else Log(a, c) : c in Eltseq(pol2) ]; primes := [ t[1] : t in Factorisation(q^3 - 1) ]; args := [p,n] cat C1 cat [3] cat C2 cat [#primes] cat primes; return Prune(&cat [ IntegerToString(x) cat " " : x in args ]); end function;