load PitounVarescon.sage table1 = [ [5 , 7,[2,3,11,47,97,4691,-178290313]],\ [7 , 7,[2,5,11,17,41,619,-816371]],\ [11 ,8,[2,3,5,7,37,101,5501,-1193167]],\ [13 ,8,[3,5,7,11,19,73,1097,-85279]],\ [17 ,8,[2,3,5,11,13,37,277,-203]],\ [19 ,9,[2,3,5,7,29,31,59,12461, -7663849]],\ [23 ,9,[2,3,5,11,13,19,59,2803,-194377]],\ [29 ,9,[2,3,5,7,13,17,59,293,-11]],\ [31 ,9,[3,5,7,11,13,17,53,326,-8137]],\ [37 ,9,[2,3,5,19,23,31,43,569,-523]],\ [41 ,9,[2,3,5,11,13,17,19,241,-1]],\ [43,10,[2,3,5,13,17,29,31,127,511,-2465249]],\ [47,10,[2,3,5,7,11,13,17,113,349,-1777]],\ [53,10,[2,3,5,7,11,13,17,73,181,-1213]],\ [59,10,[2,3,5,11,13,17,31,257,1392,-185401]],\ [61,10,[2,3,5,7,13,17,29,83,137, -24383]],\ [67,11,[2,3,5,7,11,13,17,31,47,5011,-2131]],\ [71,10,[2,3,5,11,13,17,19,59, 79,-943]],\ [73,10,[2,3,5,7,13,17,23,37,61,-1]],\ [79,10,[2,3,5,7,11,23,29,103,107,-1]],\ [83,10,[2,3,5,7,11,13,17,43,97,-1]],\ [89,11,[2,3,5,7,11,23,31,41,97,401,-425791]],\ [97,11,[2,3,5,7,11,13,19,23,43,73,-1]] ] from itertools import product Qx.=QQ[] for line in table1: p,t,ds = line print "-------------------------------------------" print "Check for p=",p," t=",t," ds=",ds for sbset in product([0,1],repeat=len(ds)): # enumerate characteristic functions of the subsets of the list ds D=prod([ds[i]^sbset[i] for i in range(len(ds))]) # product of the subset sbset D=D.squarefree_part() # replace D by its squarefree part classOK=True if D==1: continue # if D == 1 then the corresponding field are the rationals (skip) print "D=",D if (not is_p_rational(x^2-D,p)): # and (QuadraticField(D).class_number(proof=false) % p == 0 ): if QuadraticField(D).class_number() % p != 0: continue print "Failure for line\n"+str(line)+"\n"+"Q(sqrt("+str(D)+\ ")) is not "+str(p)+"-rational." print break # If one cyclic subfield is not p-rational we don't test the others # because we cannot apply Proposition 2.9 # When we reach this point all cyclic subfields have been tested # and we can apply Proposition 2.9 to conclude that # the compositum number field is p-rational. print "The compositum is p-rational"