/**************** A. LANGUASCO & A. ZACCAGNINI *********************** ************* COMPUTATION OF THE MERTENS CONSTANTS B(q,a) MOD q; 3 <= q<= 300 ******* ************* WITH A PRECISION OF AT LEAST 20 DECIMAL DIGITS ***************** *******************************************************************************/ /****************************************************************************** ***** The results are collected in a matrix named Bmatverif.gp ************ ***** every row contains q, a, B(q,a), number of correct digits ************ ***** for a fixed q>=3, the starting row for the B(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 ************ ***** B(2,1) = B - log(1/2) - 1/2; B = Meissel-Mertens constant **** ***** The results of this control are printed on a file ************ ***** named Bverif20.txt ************ *******************************************************************************/ {checksB() = local(MB, 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: B(2,1) = B - log(1/2) - 1/2; B = Meissel-Mertens constant position[3]=2; for (q=4,300, position[q]=position[q-1]+eulerphi(q-1)); \\write("~/Bverif20.txt",position); \\ input of the constants MB=read("~/Bmatverif.gp"); default(realprecision,30); \\ REMARK: in this verification we admit a precision of 20 decimal digits digitprecision=20; print("****** A. LANGUASCO & A. ZACCAGNINI *******"); write("~/Bverif20.txt","****** A. LANGUASCO & A. ZACCAGNINI *******"); print("****** VERIFICATION FOR 4 <= q <= 300 *******"); write("~/Bverif20.txt","****** VERIFICATION FOR 4 <= q <= 300 *******"); print("****** REMARK: B(2,1) = B - log(1/2) - 1/2; B = Meissel-Mertens constant *******"); write("~/Bverif20.txt","****** REMARK: B(2,1) = B - log(1/2) - 1/2; B = Meissel-Mertens constant *******"); print("******************* START CHECK ********************"); write("~/Bverif20.txt","******************* START CHECK ********************"); write("~/Bverif20.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("~/Bverif20.txt","The constant B(",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 (MB[position[q2]+i-1,2]==(a+j*q1)%q2, P=P+MB[position[q2]+i-1,3]; write("~/Bverif20.txt","B(",q2,",",(a+j*q1)%q2,") = ",MB[position[q2]+i-1,3]); ); ); ); ); for (l=1, nfactors, p=factors[l,1]; if ((p-a)%q1==0, P=P+log(1-1/p)+1/p; write("~/Bverif20.txt","And of the summand: log(1-",1/p,")+",1/p); ) ); write("~/Bverif20.txt","Their sum is = ",P); u=1; for(i=1, phiq1, if (MB[position[q1]+i-1,2]==a, write("~/Bverif20.txt","The constant B(",q1,",",a,")"," is = ", MB[position[q1]+i-1,3]); diff = P-MB[position[q1]+i-1,3]; write("~/Bverif20.txt","The difference (constant-sum) is = ", diff); write("~/Bverif20.txt","**************************"); if (abs(diff)>10^(-digitprecision), flagerror=1; write("~/Bverif20.txt","**************************"); write("~/Bverif20.txt","ERROR: less than ",digitprecision," digits are correct"); write("~/Bverif20.txt","**************************")); ); ); ); ); ); ); write("~/Bverif20.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("~/Bverif20.txt","We built and checked n. ", counter, " possible relationships between the given constants"); write("~/Bverif20.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("~/Bverif20.txt","ERROR: At least one result has not the prescribed precision of more than ", digitprecision," decimal digits"); ); print("******************* END CHECK ********************"); write("~/Bverif20.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 Bsumchecks.gp ? ch changevar charpoly checksB chinese ? checksB() ****** A. LANGUASCO & A. ZACCAGNINI ******* ****** VERIFICATION FOR 4 <= q <= 300 ******* ****** REMARK: B(2,1) = B - log(1/2) - 1/2; 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,340 ms. **********************/