/**************** A. LANGUASCO & A. ZACCAGNINI *********************** ************* COMPUTATION OF THE MERTENS CONSTANTS M(q,a) MOD q; 3 <= q<= 300 ******* ************* WITH A PRECISION OF AT LEAST 20 DECIMAL DIGITS ***************** *******************************************************************************/ /****************************************************************************** ***** The results are collected in a matrix named Mmatverif.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 Mverif20.txt ************ *******************************************************************************/ {checksM() = local(Msum, position, div, q2, q1, j, n, ndiv,a, factors,nfactors, l, i0, phiq1,phiq2,digitprecision,flagerror,counter); position=vector(300); position[1]=0; position[2]=1; \\ REMARK: M(2,1) = gamma + B -1/2; gamma=Euler constant position[3]=2; for (q=4,300, position[q]=position[q-1]+eulerphi(q-1)); \\write("~/Mverif20.txt",position); \\ input of the constants Msum=read("~/Mmatverif.gp"); default(realprecision,300); \\ REMARK: in this verification we admit a precision of 20 decimal digits digitprecision=20; print("****** A. LANGUASCO & A. ZACCAGNINI *******"); write("~/Mverif20.txt","****** A. LANGUASCO & A. ZACCAGNINI *******"); print("****** VERIFICATION FOR 4 <= q <= 300 *******"); write("~/Mverif20.txt","****** VERIFICATION FOR 4 <= q <= 300 *******"); print("****** REMARK: M(2,1) = gamma + B -1/2; gamma=Euler constant; B = Meissel-Mertens constant *******"); write("~/Mverif20.txt","****** REMARK: M(2,1) = gamma + B -1/2; gamma=Euler constant; B = Meissel-Mertens constant *******"); print("******************* START CHECK ********************"); write("~/Mverif20.txt","******************* START CHECK ********************"); write("~/Mverif20.txt","**************************"); flagerror=0; counter=0; for (q2=4,300, 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("~/Mverif20.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("~/Mverif20.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("~/Mverif20.txt","And of the summand: ",1/p); ) ); write("~/Mverif20.txt","Their sum is = ",P); u=1; for(i=1, phiq1, if (Msum[position[q1]+i-1,2]==a, write("~/Mverif20.txt","The constant M(",q1,",",a,")"," is = ", Msum[position[q1]+i-1,3]); diff = P-Msum[position[q1]+i-1,3]; write("~/Mverif20.txt","The difference (constant-sum) is = ", diff); write("~/Mverif20.txt","**************************"); if (abs(diff)>10^(-digitprecision), flagerror=1; write("~/Mverif20.txt","**************************"); write("~/Mverif20.txt","ERROR: less than ",digitprecision," digits are correct"); write("~/Mverif20.txt","**************************")); ); ); ); ); ); ); write("~/Mverif20.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("~/Mverif20.txt","We built and checked n. ", counter, " possible relationships between the given constants"); write("~/Mverif20.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("~/Mverif20.txt","ERROR: At least one result has not the prescribed precision of more than ", digitprecision," decimal digits"); ); print("******************* END CHECK ********************"); write("~/Mverif20.txt","******************* END CHECK ********************"); return(); } /****************** Macintosh-2:~ languasc$ gp GP/PARI CALCULATOR Version 2.3.4 (released) i386 running darwin (ix86/GMP-4.2.2 kernel) 32-bit version compiled: Dec 8 2008, gcc-4.0.1 (Apple Inc. build 5490) (readline v5.2 enabled, extended help available) Copyright (C) 2000-2006 The PARI Group PARI/GP is free software, covered by the GNU General Public License, and comes WITHOUT ANY WARRANTY WHATSOEVER. Type ? for help, \q to quit. Type ?12 for how to get moral (and possibly technical) support. parisize = 4000000, primelimit = 500000 ? allocatemem *** allocatemem: Warning: doubling stack size; new stack = 8000000 (7.629 Mbytes). ? allocatemem *** allocatemem: Warning: doubling stack size; new stack = 16000000 (15.259 Mbytes). ? \r Msumchecks.gp ? checksM() ****** A. LANGUASCO & A. ZACCAGNINI ******* ****** VERIFICATION FOR 4 <= q <= 300 ******* ****** REMARK: M(2,1) = gamma + B -1/2; gamma=Euler constant; B = Meissel-Mertens constant ******* ******************* START CHECK ******************** We built and checked n. 17453 possible relationships between the given constants All the results are correct with a precision of at least 20 decimal digits ******************* END CHECK ******************** ? ## *** last result computed in 36,830 ms. **********************/