/* Copyright (C) 2021 Alessandro Languasco */ /**************** A. LANGUASCO ***************************/ \\ Global variables: global(tab); \\global variable used to initialise sumnum global(defaultprecision); /************* COMPUTATION OF gamma2 *********/ {gamma2(Pbound,defaultprecision)=local(minutes, millisec, seconds, elaptimefinalcomp, s1, S, errs1, Pbound1 ); \\ minutes,millisec,seconds: used just to compute the elapsed computation time; local variables \\ defaultprecision: used to fix the precision used in the computations; global variable print("************ A. LANGUASCO *************"); print("********* COMPUTATION of gamma for q=2 **********"); \\ precision setting default(realprecision,defaultprecision); default(format,f); default(primelimit, Pbound); Pbound1=Pbound+1; tab = sumnuminit(); \\ needed for the sumnum functions in the errors gettime(); gettime(); print("Starting computation of gamma(1,2)"); print("internal sums over primes p up to ", Pbound); print("---------"); errs1=0; s1=0; S=0; forprime(p=3, Pbound, s1 += log(p)/(p^2-1); ); S = 2*s1; \\ error computation errs1 = sumnum(n=Pbound1, log(n)/(n^2-1), tab); errS = 2*abs(errs1) ; print("sum over primes = ", s1 ); print("gamma(1,2) = ", -log(2) - S ); print("gammaprime(1,2) = ", - S ); print("errS",r,"(",q,") = ", errS); if (abs(S) < 10*errS, print("********* recompute !!!")); elaptimefinalcomp=gettime(); seconds=floor(elaptimefinalcomp/1000)%60; minutes=floor(elaptimefinalcomp/60000); millisec=elaptimefinalcomp- minutes*60000 - seconds*1000; print("gammas(2) computation time (output time included): ", minutes, " min, ", seconds, " sec, ", millisec, " millisec"); print("****** END PROGRAM ********"); } /**** RESULTS **** gp2.13.1 and gp2c0.0.12 compiled by myself, see below languasc@languasc-macmini$ gp2c-run -pmy_ -g -W gamma(q=2).gp GP/PARI CALCULATOR Version 2.13.1 (released) i386 running darwin (x86-64/GMP-6.2.1 kernel) 64-bit version compiled: Jan 25 2021, Apple clang version 12.0.0 (clang-1200.0.32.28) threading engine: single (readline v8.0 enabled, extended help enabled) Copyright (C) 2000-2020 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 ?17 for how to get moral (and possibly technical) support. parisize = 8000000, primelimit = 500000 ------- ? gamma2(10^7,19) ************ A. LANGUASCO ************* ********* COMPUTATION of gamma for q=2 ********** Starting computation of gamma(1,2) internal sums over primes p up to 10000000 --------- sum over primes = 0.3389118329051014684 gamma(1,2) = -1.370970846370148246 gammaprime(1,2) = -0.6778236658102029368 errgammas(2) = 0.000003423618969010723622 gammas(2) computation time (output time included): 0 min, 1 sec, 560 millisec ****** END PROGRAM ******** ? gamma2(10^8,19) ************ A. LANGUASCO ************* ********* COMPUTATION of gamma for q=2 ********** Starting computation of gamma(1,2) internal sums over primes p up to 100000000 --------- sum over primes = 0.3389119229079501492 gamma(1,2) = -1.370971026375845608 gammaprime(1,2) = -0.6778238458159002983 errgammas(2) = 0.0000003884136130369792535 gammas(2) computation time (output time included): 0 min, 13 sec, 828 millisec ****** END PROGRAM ******** ? gamma2(10^9,19) ************ A. LANGUASCO ************* ********* COMPUTATION of gamma for q=2 ********** Starting computation of gamma(1,2) internal sums over primes p up to 1000000000 --------- sum over primes = 0.3389119319072067970 gamma(1,2) = -1.370971044374358903 gammaprime(1,2) = -0.6778238638144135939 errgammas(2) = 0.00000004344653165316955650 gammas(2) computation time (output time included): 2 min, 1 sec, 888 millisec ****** END PROGRAM ******** ? gamma2(10^10,19) ************ A. LANGUASCO ************* ********* COMPUTATION of gamma for q=2 ********** Starting computation of gamma(1,2) internal sums over primes p up to 10000000000 --------- sum over primes = 0.3389119328016886185 gamma(1,2) = -1.370971046163322547 gammaprime(1,2) = -0.6778238656033772371 errSr(q) = 0.000000004805170185757832859 Sr(q) computation time (output time included): 18 min, 8 sec, 490 millisec ****** END PROGRAM ******** --------- *******/