// // code for Theorem 2.2 for N=35 // C:=SmallModularCurve(35); //gives a modular curve X_0(35) SimplifiedModel(C); //gives C=X_0(35) in the form y^2=f_35(x) A:={}; S:=[0..4]; for m in S do for n in S do if ((m mod 2) ne 0) or ((n mod 2) ne 0) then //because (m,n)=1 f:=m^8-4*m^7*n-6*m^6*n^2-4*m^5*n^3-9*m^4*n^4 + 4*m^3*n^5-6*m^2*n^6+4*m*n^7+n^8; //this is n^8d=Ds^2 from (2), obtained by putting x=m/n in SimplifiedModel(C) from above and multiplying with the denominator n^8 A:=A join {f mod 4}; //we put the residues modulo 4 in the set A end if; end for; end for; A; //in the end the set A will contain all possible values of Ds^2 modulo 4, for Ds^2 from (2) A:={}; S:=[0..25]; for m in S do for n in S do if ((m mod 5) ne 0) or ((n mod 5) ne 0) then //because (m,n)=1 f:=m^8-4*m^7*n-6*m^6*n^2-4*m^5*n^3-9*m^4*n^4 + 4*m^3*n^5-6*m^2*n^6+4*m*n^7+n^8; //this is n^8d=Ds^2 from (2), obtained by putting x=m/n in SimplifiedModel(C) from above and multiplying with the denominator n^8 A:=A join {f mod 25}; //we put the residues modulo 25 in the set A end if; end for; end for; A; //in the end the set A will contain all possible values of Ds^2 modulo 25, for Ds^2 from (2) A:={}; S:=[0..7]; for m in S do for n in S do if ((m mod 7) ne 0) or ((n mod 7) ne 0) then //because (m,n)=1 f:=m^8-4*m^7*n-6*m^6*n^2-4*m^5*n^3-9*m^4*n^4 + 4*m^3*n^5-6*m^2*n^6+4*m*n^7+n^8; //this is n^8d=Ds^2 from (2), obtained by putting x=m/n in SimplifiedModel(C) from above and multiplying with the denominator n^8 A:=A join {f mod 7}; //we put the residues modulo 7 in the set A end if; end for; end for; A; //in the end the set A will contain all possible values of Ds^2 modulo 7, for Ds^2 from (2)