meditationatae

Just another WordPress.com site

Memo on extending the CA number calculations out to exp(exp(29))

For the record, the source code, compiled code, table of the first 1,000,000 primes and files used to store intermediate results are held in four directories:

[david2@localhost ~]$ pwd
/home/david2

(above is my home directory on my computer, /home/david2/

About below:

Below, the command `ls -l eratosthenes1[5678]’ has the system list all files and directories in

/home/david2/eratosthenes15 , /home/david2/eratosthenes16, /home/david2/eratosthenes17 and /home/david2/eratosthenes18 .
[david2@localhost ~]$ ls -l eratosthenes1[5678]
eratosthenes15:
total 1004
-rwxrwxr-x. 1 david2 david2  69496 Jun  8 01:21 a.out
-rwxrw-r–. 1 david2 david2    721 Jun  8 00:18 Loop6.sh
drwxrwxr-x. 2 david2 david2   4096 Jun  8 00:20 OLD
-rw-rw-r–. 1 david2 david2  19828 Jun  8 00:13 primes-gen-atkin.c
-rw-rw-r–. 1 david2 david2 458565 Jun 12 15:35 scriptLoop5Out.txt
-rw-rw-r–. 1 david2 david2     97 Jun  8 01:24 scriptLoop6Out.txt
-rw-rw-r–. 1 david2 david2 458662 Jun 12 17:28 test_data_4k.txt
-rw-rw-r–. 1 david2 david2   3225 Jun  8 00:12 time-make-primes6Bscript20a.c

[   primes-gen-atkin.c is the Atkins sieve source code of Dan Bernstein.

time-make-primes6Bscript20a.c  drives the prime sieving, by calling primes-gen-atkin.c .

The use of time-make-primes6Bscript20a.c is in adding logs of primes within intervals of length 10^9 [there will be 4000 of these out to 4×10^12 ],

secondly computing Pi_{p in I}  (1 + 1/p),

where I is an interval of 10^9 consecutive integers ending at k*10^9 for k = 1 (respectively, k =2, 3, 4, 5, …. 4000)’

thirdly, for each k with 1<=k<=4000, we keep track of the largest prime not exceeding k*10^9. ]

[ the compiled program in in a.out above, and the script  Loop6.sh is a bash shell script that invokes a.out with the two parameters needed for each of the 4000 intervals of 10^9 numbers, starting at 1-10^9 and ending at 3999*10^9 to 4000*10^9 ]

[ the output is sent to files: scriptLoop6Out.txt and scriptLoop5Out.txt ; only 1 file is needed. An oversight in editing a previous script had me write to 2 files. The entire output is then in the file:

test_data_4k.txt . ]

eratosthenes16:
total 8980
-rw-rw-r–. 1 david2 david2    1861 Jun 12 17:40 newreadtest58e.c
-rwxrwxr-x. 1 david2 david2  106797 Jun 12 17:44 newreadtest58e.out
-rw-rw-r–. 1 david2 david2  361782 Jun 13 10:44 newreadtest58e.txt
drwxrwxr-x. 2 david2 david2    4096 Jun 12 17:41 old
-rw-rw-r–. 1 david2 david2 8245905 Jun 12 17:26 primes1meg02a_tmp.txt
-rw-rw-r–. 1 david2 david2  458662 Jun 12 17:28 test_data_4k.txt

[ In eratosthenes16, we start from the output test_data_4k.txt from the jobs in eratosthenes15. The file primes1meg02a_tmp.txt contains the “small primes”, the first 1 million.

newreadtest58e.c is used to compute the critical epsilons in the Erdos-Alaoglu formulas relating to CA numbers, epsilon depending on the largest prime not exceeding 10^9 (respectively, k*10^9 for k=2, 3, … 4000). From epsilon_p , we compute the exponents (of 2, 3, 5, …) in the desired CA numbers for the first 10^6 primes. For the p and epsilon_p under consideration, the exponents of small primes such as 2, 3, 5 will exceed 1; but pas the million-th prime, all exponents will be 1. In test_data_4k.txt , we have sums of logs of primes within 4000 intervals I of length 10^9 . Thus, we are tweaking the sums of logs of primes to account for exponents above 1 in the “small primes”, meaning the first million primes .

The output in newreadtest58e.txt includes log(n), for 4000 CA numbers n.

cat /home/david2/eratosthenes16/newreadtest58e.c
#include <stdio.h>
#include <quadmath.h>

int smallp[1000000];
int main(void)
{
int j;
long low, high, count, lastprime;
long lstprimes[4000];
__float128 datalog[4000];
char buf1[100];
char buf2[100];
__float128 r;
__float128 epsilon;
__float128 var01;
__float128 var02;
__float128 var03;
__float128 var04;
__float128 var05;
int power2;
long p;
long smallprime;
__float128 fsmallprime;
__float128 deltasumlog;
__float128 sumlog;
int k;
FILE *in;
FILE *in2;

in = fopen(“/home/david2/eratosthenes16/test_data_4k.txt”, “r”);
in2= fopen(“/home/david2/eratosthenes16/primes1meg02a_tmp.txt”, “r”);
for(j=0; j<4000; j++)
{
fscanf(in, “%ld”, &low);
fscanf(in, “%ld”, &high);
fscanf(in, “%ld”, &count);
fscanf(in, “%s”, &buf1);
fscanf(in, “%s”, &buf2);
r = strtoflt128(buf2, NULL);
if(j == 0)
{
datalog[j] = r;
}
else
{
datalog[j] = datalog[j-1] + r;
}

fscanf(in, “%ld”, &lastprime);
lstprimes[j] = lastprime;
}

fclose(in);
for(j=0; j<1000000; j++)
{
fscanf(in2, “%d”, &smallp[j]);
}

fclose(in2);

for(j=0; j<4000; j++)
{
p = lstprimes[j];
epsilon = logq(1.0Q + 1.0Q/((__float128) p))/logq( ((__float128) p) );
printf(“%ld “, p);
printf(“%.30Qe “, epsilon);
deltasumlog = (__float128) 0;

for(k=0; k<1000000;k++)
{
smallprime = smallp[k];

fsmallprime = (__float128) smallprime;

var01 = expq((1.0Q+epsilon)*logq(fsmallprime))-1.0Q;
var02 = expq(epsilon*logq(fsmallprime))-1.0Q;
var03 = logq(var01/var02);
var04 = var03/logq(fsmallprime);
var05 = floorq(var04) – 1.0Q;
deltasumlog = deltasumlog + (var05 – 1.0Q)*logq(fsmallprime);
}

sumlog = datalog[j] + deltasumlog;

printf(“%.25Qf\n”, sumlog);
}

return 0;
}

end section on eratosthenes16  ]]]]

eratosthenes17:
total 8956
-rw-rw-r–. 1 david2 david2    2163 Jun 14 01:55 newreadtest68a.c
-rwxrwxr-x. 1 david2 david2  109929 Jun 14 01:58 newreadtest68a.out
-rw-rw-r–. 1 david2 david2  338889 Jun 14 17:21 newreadtest68a.txt
drwxrwxr-x. 2 david2 david2    4096 Jun 14 01:55 old
-rw-rw-r–. 1 david2 david2 8245905 Jun 14 01:51 primes1meg02a_tmp.txt
-rw-rw-r–. 1 david2 david2  458662 Jun 14 01:52 test_data_4k.txt

In eratosthenes17 , using newreadtest68a.c as source code, we compute sigma(n)/n for 4000 CA numbers n. For this, we use products of values of (1+ 1/p) for primes p in an interval I of 10^9 numbers, from 1-10^9 and ending at 3999*10^9 — 4000*10^9.

Once again, Erdos-Alaoglu formulas for epsilon_p are used to compute the exponents of 2, 3, 5 … p_1000000 and, e.g. sigma(2^44)/(2^44) in case 2 has exponent 44 in the CA number.

The output, sigma(n)/n for 4000 CA numbers, is in the file:

newreadtest68a.txt  ]]]   //end descr. eratosthenes17 dir

eratosthenes18:
total 1272
-rw-rw-r–. 1 david2 david2  91782 Jun 14 21:39 newreadtest28bb.txt
-rw-rw-r–. 1 david2 david2   1307 Jun 14 21:37 newreadtest48a.c
-rw-rw-r–. 1 david2 david2   1337 Jun 15 03:19 newreadtest50ay.c
-rw-rw-r–. 1 david2 david2 361782 Jun 14 21:44 newreadtest58e.txt
-rw-rw-r–. 1 david2 david2   1291 Jun 14 21:54 newreadtest60a.c
-rwxrwxr-x. 1 david2 david2  72431 Jun 14 21:56 newreadtest60a.out
-rw-rw-r–. 1 david2 david2 193598 Jun 14 21:57 newreadtest60a.txt
-rw-rw-r–. 1 david2 david2 338889 Jun 14 20:05 newreadtest68a.txt
-rw-rw-r–. 1 david2 david2    447 Jun 15 03:43 newreadtest80ax.c
-rwxrwxr-x. 1 david2 david2   7723 Jun 15 03:44 newreadtest80ax.out
-rw-rw-r–. 1 david2 david2  96000 Jun 15 03:51 newreadtest80ax.txt
-rw-rw-r–. 1 david2 david2    446 Jun 15 04:06 newreadtest80ay.c
-rwxrwxr-x. 1 david2 david2   7723 Jun 15 04:08 newreadtest80ay.out
-rw-rw-r–. 1 david2 david2  93598 Jun 15 04:11 newreadtest80ay.txt
drwxrwxr-x. 2 david2 david2   4096 Jun 16 11:45 NEXT

[ In eratosthenes18 , we use the data from the files in eratosthenes17 and eratosthenes16 to put together  sigma(n)/n and log(n) for 4000 CA numbers out to exp(exp(29)), and do computations on the gap between  sigma(n)/n and the upper bound exp(gamma)*log(log(n)) , or Robin criterion, accrding to which if n>5040 abd the Riemann Hyposthesis holds, then     sigma(n)/n <  exp(gamma)*log(log(n)) . ]]] end for dir eratosthenes18

Advertisements

Written by meditationatae

June 16, 2015 at 6:27 pm

Posted in History

%d bloggers like this: