/**************** A. LANGUASCO & A. ZACCAGNINI *********************** ************* COMPUTATION OF THE MERTENS CONSTANTS MOD q; 3 <= q<= 100 ******* ************* WITH A PRECISION OF AT LEAST 100 DECIMAL DIGITS ***************** *******************************************************************************/ /****************************************************************************** ***** The results are collected in a matrix named Msummatrix.gp ************ ***** every row contains q, a, M(q,a), number of correct digits ************ ***** for a fixed q>=3, the starting row for the M(q,a)s is detected ******** ***** with the q-component of the vector position which is precomputed ****** ***** The value corresponding to q=2 is inserted as ************ ***** M(2,1) = gamma + B -1/2; gamma = Euler constant ************ ***** B = Meissel-Mertens constant ************ ***** The results of this control are printed on a file ************ ***** named Msumcheckresults.txt ************ *******************************************************************************/ {checksMsum() = local(Msum, position, div, q2, q1, j, n, ndiv,a, factors,nfactors, l, i0, phiq1,phiq2,digitprecision,flagerror,counter); position=vector(100); position[1]=0; position[2]=1; \\ REMARK: M(2,1) = gamma + B -1/2; gamma=Euler constant position[3]=2; for (q=4,100, position[q]=position[q-1]+eulerphi(q-1)); \\write("~/Msumcheckresults.txt",position); \\ input of the constants Msum=read("~/Msummatrix.gp"); default(realprecision,120); \\ REMARK: in this verification we admit a precision of 100 decimal digits digitprecision=100; print("****** A. LANGUASCO & A. ZACCAGNINI *******"); write("~/Msumcheckresults.txt","****** A. LANGUASCO & A. ZACCAGNINI *******"); print("****** VERIFICATION FOR 4 <= q <= 100 *******"); write("~/Msumcheckresults.txt","****** VERIFICATION FOR 4 <= q <= 100 *******"); print("****** REMARK: M(2,1) = gamma + B -1/2; gamma=Euler constant; B = Meissel-Mertens constant *******"); write("~/Msumcheckresults.txt","****** REMARK: M(2,1) = gamma + B -1/2; gamma=Euler constant; B = Meissel-Mertens constant *******"); print("******************* START CHECK ********************"); write("~/Msumcheckresults.txt","******************* START CHECK ********************"); write("~/Msumcheckresults.txt","**************************"); flagerror=0; counter=0; for (q2=4,100, phiq2=eulerphi(q2); div=divisors(q2); factors=factor(q2); nfactors=length(factors[,1]); ndiv=length(div); \\if (div[2]==2,i0=1,i0=0); i0=0; for (i=2+i0, ndiv-1, q1=div[i]; phiq1=eulerphi(q1); n=q2\q1; for (a = 1, q1, if (gcd(a,q1)==1, counter=counter+1; write("~/Msumcheckresults.txt","The constant M(",q1,",",a,")", " has to be equal to the sum of: "); P=0; for(j=0,n-1, if (gcd(a+j*q1,q2)==1, for (i=1, phiq2, if (Msum[position[q2]+i-1,2]==(a+j*q1)%q2, P=P+Msum[position[q2]+i-1,3]; write("~/Msumcheckresults.txt","M(",q2,",",(a+j*q1)%q2,") = ",Msum[position[q2]+i-1,3]); ); ); ); ); for (l=1, nfactors, p=factors[l,1]; if ((p-a)%q1==0, P=P+1/p; write("~/Msumcheckresults.txt","And of the summand: ",1/p); ) ); write("~/Msumcheckresults.txt","Their sum is = ",P); u=1; for(i=1, phiq1, if (Msum[position[q1]+i-1,2]==a, write("~/Msumcheckresults.txt","The constant M(",q1,",",a,")"," is = ", Msum[position[q1]+i-1,3]); diff = P-Msum[position[q1]+i-1,3]; write("~/Msumcheckresults.txt","The difference (constant-sum) is = ", diff); write("~/Msumcheckresults.txt","**************************"); if (abs(diff)>10^(-digitprecision), flagerror=1; write("~/Msumcheckresults.txt","**************************"); write("~/Msumcheckresults.txt","ERROR: less than ",digitprecision," digits are correct"); write("~/Msumcheckresults.txt","**************************")); ); ); ); ); ); ); write("~/Msumcheckresults.txt","**************************************************"); if (flagerror==0, print("We built and checked n. ", counter, " possible relationships between the given constants"); print("All the results are correct with a precision of at least ",digitprecision," decimal digits"); write("~/Msumcheckresults.txt","We built and checked n. ", counter, " possible relationships between the given constants"); write("~/Msumcheckresults.txt","All the results are correct with a precision of at least ",digitprecision," decimal digits"), print("ERROR: At least one result has not the prescribed precision of more than ",digitprecision," decimal digits"); write("~/Msumcheckresults.txt","ERROR: At least one result has not the prescribed precision of more than ", digitprecision," decimal digits"); ); print("******************* END CHECK ********************"); write("~/Msumcheckresults.txt","******************* END CHECK ********************"); return(); } /****************** ? checksMsum ****** A. LANGUASCO & A. ZACCAGNINI ******* ****** VERIFICATION FOR 4 <= q <= 100 ******* ****** REMARK: M(2,1) = gamma + B -1/2; gamma=Euler constant; B = Meissel-Mertens constant ******* ******************* START CHECK ******************** We built and checked n. 1907 possible relationships between the given constants All the results are correct with a precision of at least 100 decimal digits ******************* END CHECK ******************** ? **********************/