Help22:=proc(): print(`BAc(f), Likelyc(q,r), LikelycC(q,r) `):end: read `QC.txt`: #BAc(f): BA(f) done cleverly. The best fraction approximation to the fraction f with denominator<=sqrt(denom(f)) BAc:=proc(f) local L,i: L:=CVG(f): for i from 1 to nops(L) while denom(L[i])^2<=denom(f) do od: L[i-1]: end: #Likelyc(q,r): All the c less than q such that |mods(r*c,q)}<=r/2 Likelyc:=proc(q,r) local L,c: L:=[]: for c from 1 to q-1 do if abs(mods(r*c,q))<=r/2 then if c mod 2=0 then c:=c+1: fi: L:=[op(L),c]: fi: od: L: end: #LikelycC(q,r): All the closest integers to integer multiples of c. LikelycC:=proc(q,r) local i,L,c: L:=[]: for i from 1 to r-1 do c:=round((q/r)*i): if c mod 2=0 then c:=c+1: fi: L:=[op(L),c]: od: L: end: