meditationatae

Just another WordPress.com site

Updated source code for superabundant numbers

/*********************************************************************************************************************************

I now use libquadmath , the quad-precision GNU GCC math library.

Version of program:  superabun3042a.c

$ date
Tue Dec 16 03:41:33 EST 2014

*******************************************************************************************************************************/

#include <stdio.h>
#include <quadmath.h>
#include <stdlib.h>
__float128 splogs[250000];
__float128 theta[250000];
__float128 prod100k[250000];
long ptr_exponents[250000];
long pts_primes[250000];
long ptr_isstep[250000];
long sivsmall_primes[150000];

unsigned char sivptr_remains[10000000];

int main(void)
{
long theIndex;
__float128 euler = 0.5772156649015328606065120900824024Q;
long j;
long numprimes;
long num_new_primes;
long file_offset;
long jj;
long kij;
long kijj;
long numBigPrimesUsed;
__float128 sum_log_cofactor;
__float128 sum_theta_Cheb;
// __float128 puiss3sigmalogs[50];
long numsteps;
long expon;
long sigma;
long * ptr_primes;
long list_steps[1000];
long power;
long old_prime;
long powerb;
int nownow;
int go_skip;
int answer;
long k;
long l;
long numloops;
long vintageloops;
long tmp_exponent;
long m;
long p;
long sum;
int not_done;
int junk;
int leave_loop;
long ljunk;
int skip_base_case;
long current_step;
long now_step;
__float128 RecordRobinQuotient;
__float128 RecordQuotient;
__float128 tmp_now_n;
__float128 log2nprime;
__float128 robin_bound;
__float128 base_tmp_now_n;
long RecordStep;
__float128 tmp_now_robin;
__float128 constant;
__float128 prod_sigma_r;
__float128 prod_sigma_rone;
__float128 base_tmp_now_sigma_r;
__float128 prod_sigma_r_cofactor;
__float128 tmp_now_sigma_r;
__float128 tmp_now_quotient;
__float128 delta;
__float128 delta_log;
__float128 delta_estimate;
__float128 variation_delta;
__float128 record_low_variation_delta;
__float128 record_low_log2n;
__float128 tmp_el_now_robin;
__float128 now_n;
long current_step_number;
__float128 sum_logs_primes;
__float128 sum_logs_all;
__float128 ratio;
__float128 now_robin;
__float128 val128a;
FILE *in;
long sivoffset;
long sivj;
long sivp;
long sivblock_size;
unsigned char sivuc1;
unsigned char sivuc0;
long sivindex;
long sivblockprimecount;
long sivrem;
long sivcount;
long sivcount_new_primes;
long sivbarred;
long siv_left_overs;
long siv_keeps;
long sivp_num;
long siv_last_sivj;
long sivoffset_next;
int sivbatchdone;
FILE *out;
ptr_primes = (long *) calloc(80000000, sizeof(long));

sivblock_size = (long) 10000000;
sivuc1 = (unsigned char) 1;
sivuc0 = (unsigned char) 0;

sivcount = 8000000000 ;
sivoffset = 199815106450;

record_low_variation_delta = (__float128) 100;
record_low_log2n = (__float128) 0;
in = fopen(“/home/david2/eratosthenes/primes100meg01a_tmp.txt”, “r”);
for(j=0; j< 250000 ; j++)
{
fscanf(in, “%ld”, &theIndex);
fscanf(in, “%ld”, &pts_primes[j]);
}
fclose(in);

for(sivj=0; sivj< 150000; sivj++)
{
sivsmall_primes[sivj] = pts_primes[sivj] ;
}
constant = ((__float128) 323336)/((__float128) 1000000);

// in = fopen(“/home/david2/eratosthenes/prout250k”, “r”);

// prout250k

val128a = 1.0Q;
for(j=0; j<250000; j++)
{
val128a = val128a*(1.0Q + 1.0Q/((__float128)pts_primes[j]));
prod100k[j] = val128a;

// fscanf(in, “%Lf”, &prod100k[j]);
}

// fclose(in);
in = fopen(“/home/david2/eratosthenes/LargePrimes_to_1e10a.txt”, “r”);
for(j=0; j<79920000 ; j++)
{
fscanf(in, “%ld”, &ljunk);
}
for(j=0; j< 80000000 ; j++)
{
fscanf(in, “%ld”, &ptr_primes[j]);
}

fclose(in);
// in = fopen(“/home/david2/eratosthenes/puiss3sigmalogs”, “r”);

// for(j=0; j< 50 ; j++)
// {
// fscanf(in, “%d”, &junk);
// fscanf(in, “%Lf”, &puiss3sigmalogs[j]);
// }
// fclose(in);
for(j=0; j< 250000 ; j++)
{
ptr_exponents[j] = (long) 0;
}
prod_sigma_r = (__float128) 1;

prod_sigma_rone = (__float128) 1;

for(j=0; j< 250000 ; j++)
{
ptr_isstep[j] = (long) 0;
}
in = fopen(“/home/david2/eratosthenes/exponents_out802a.txt”, “r”);
for(j=0; j< 250000 ; j++)
{
fscanf(in, “%ld”, &theIndex);
fscanf(in, “%ld”, &ptr_exponents[j]);
}
fclose(in);
numprimes = (long) 80000000;

numBigPrimesUsed = (long) 79000000;

leave_loop = 0;
in = fopen(“/home/david2/eratosthenes/primes_out802a.txt”, “r”);

sum_logs_primes = (__float128) 0;
sum_logs_all = (__float128) 0;
for(j=0; j<80000000; j++)
{
fscanf(in, “%ld”, &ljunk);
fscanf(in, “%ld”, &old_prime);
sum_logs_primes = sum_logs_primes + logq((__float128)old_prime);

if(j < 250000)
{
sum_logs_all = sum_logs_all + ((__float128)ptr_exponents[j])*logq((__float128)old_prime);
}
else
{
sum_logs_all = sum_logs_all + logq((__float128)old_prime);
}
}

fclose(in);

for(j=0; j<250000; j++)
{
splogs[j] = logq((__float128) pts_primes[j]);
}

sum_theta_Cheb = (__float128) 0;
for(j=0; j<250000; j++)
{
sum_theta_Cheb = sum_theta_Cheb + logq((__float128) pts_primes[j]) ;
theta[j] = sum_theta_Cheb;
}
skip_base_case = (int) 0;
for(j=0; j< 250000 ; j++)
{

p = pts_primes[j];

expon = ptr_exponents[j];

ratio = (__float128) 1;

for(jj = 0; jj < 1; jj++)
{
ratio = ((__float128)1) + (ratio/((__float128) p) );
}

if(expon == 1)
{
prod_sigma_rone = prod_sigma_rone*ratio;
}
prod_sigma_r = prod_sigma_r*ratio;
}

in = fopen(“/home/david2/eratosthenes/primes_out802a.txt”, “r”);

for(j=0 ; j<numprimes; j++)
{
fscanf(in, “%ld”, &ljunk);
fscanf(in, “%ld”, &old_prime);

if( j > 249999 )
{
prod_sigma_r = prod_sigma_r + (prod_sigma_r/((__float128)old_prime)) ;
prod_sigma_rone = prod_sigma_rone + (prod_sigma_rone/((__float128)old_prime)) ;
}
}

fclose(in);
for(numloops = 0; numloops < 80002284 ; numloops++)
{

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;
if( (2283 ==(numloops%64000)) || (((numloops – 80002283) < 6)&&((80002283-numloops) < 6)) )
{
for(j=0; j< numsteps; j++)
{
printf(“step at %ld\n”, list_steps[j]);
}
printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
printf(“numloops = %ld\n”, numloops);
printf(“\n”);

if(numloops == 80002283)
{
printf(“numloops = %ld\n”, numloops);
printf(“break from current loop, ok?\n”);
printf(“enter 1 for yes, 0 for no:\n”);

if(1 == 1)
{
leave_loop = 1;
}
else
{
leave_loop = 1;
}
}
}

if(leave_loop == 0)
{
if((2283 ==(numloops%64000)) || (((numloops – 80002283) < 6)&&((80002283-numloops) < 6)) )
{
printf(“number of steps: %ld\n”, numsteps);
}
RecordRobinQuotient = (__float128) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (__float128) 0;

base_tmp_now_sigma_r = (__float128) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((__float128)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((__float128)sigma)/((__float128)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];
for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expq(euler);

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if((2283 ==(numloops%64000)) || (((numloops – 80002283) < 6)&&((80002283-numloops) < 6)) )
{

printf(“current step number = %ld “, current_step_number);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep);

}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
// if(list_steps[j] != 1)
// {
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
// else
// {
// tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[1];
// ratio = expq( puiss3sigmalogs[tmp_exponent]-(((__float128)tmp_exponent)*splogs[1]) );

// tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
}

tmp_now_n = tmp_now_n + logq((__float128) ptr_primes[current_step-80000000]);
ratio = ((__float128)1)/( (__float128)ptr_primes[current_step-80000000] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expq(euler);

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if((2283 ==(numloops%64000)) || (((numloops – 80002283) < 6)&&((80002283-numloops) < 6)) )
{
printf(“current step number = %ld “, current_step_number);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep);
}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{
sum_logs_primes = sum_logs_primes + logq( (__float128) ptr_primes[numprimes-80000000]);

ratio = ((__float128)1)/((__float128)ptr_primes[numprimes-80000000]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 2283 ==(numloops%64000) )
{
for(j=0; j< 200 ; j++)
{
printf(“%ld “, ptr_exponents[j]);
}

printf(“\n\n”);
}
}
/*** if leave loop == 0 ****/
if( leave_loop == 1 )
{
break;
}
}

/**************** next 80 million batch … *****************/
/*************************************************************
prime 160,000,000 is:

3340200037

or

3,340,200,037 .

:159920000p
3340200037
3340200037
************************************************************/

in = fopen(“/home/david2/eratosthenes/LargePrimes_to_1e11ofNov22a.txt”, “r”);
for(j=0; j< 159920000 ; j++)
{
fscanf(in, “%ld”, &old_prime);
}
for(j=0; j< 80000000 ; j++)
{
fscanf(in, “%ld”, &ptr_primes[j]);
}
/**************************************

==============================================
next: loops ….

******************************************************/
file_offset = (long) 160000000;
num_new_primes = (long) 0;

numloops = (long) 0;
while( num_new_primes < ((long)80000000) )
{
numloops++;

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;

if( 9999 == (num_new_primes%10000) )
{
for(j=0; j< numsteps; j++)
{
printf(“step at %ld\n”, list_steps[j]);
}
printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
printf(“numloops = %ld\n”, numloops);
printf(“\n”);
}
if( 9999 == (num_new_primes%10000) )
{
printf(“number of steps: %ld\n”, numsteps);
}
RecordRobinQuotient = (__float128) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (__float128) 0;

base_tmp_now_sigma_r = (__float128) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((__float128)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((__float128)sigma)/((__float128)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];

for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expq(euler);

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if( 9999 == (num_new_primes%10000) )
{

printf(“current step number = %ld “, current_step_number);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep);

}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
// if(list_steps[j] != 1)
// {
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
// else
// {
// tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[1];
// ratio = expq( puiss3sigmalogs[tmp_exponent]-(((__float128)tmp_exponent)*splogs[1]) );

// tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
}

tmp_now_n = tmp_now_n + logq((__float128) ptr_primes[current_step- file_offset]);
ratio = ((__float128)1)/( (__float128)ptr_primes[current_step- file_offset] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expq(euler);

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if( 9999 == (num_new_primes%10000) )
{
printf(“current step number = %ld “, current_step_number);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep);
}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{
sum_logs_primes = sum_logs_primes + logq( (__float128) ptr_primes[numprimes- file_offset]);

ratio = ((__float128)1)/((__float128)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 99999 == (num_new_primes%100000) )
{
for(j=0; j< 200 ; j++)
{
printf(“%ld “, ptr_exponents[j]);
}

printf(“\n\n”);
}
}
/********************** Next batch 80 M and loop *******************/

for(kij = 1; kij < 49; kij++)
{

for(j=0; j< 80000000 ; j++)
{
fscanf(in, “%ld”, &ptr_primes[j]);
}

file_offset = file_offset + ((long)80000000) ;

/*** 240 000 000 for kij=1 ***/
num_new_primes = (long) 0;

numloops = (long) 0;

while( num_new_primes < ((long)80000000) )
{
numloops++;

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;

if( 99999 == (numloops%100000) )
{
for(j=0; j< numsteps; j++)
{
printf(“step at %ld\n”, list_steps[j]);
}
printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
printf(“numloops = %ld\n”, numloops);
printf(“\n”);
}
if( 99999 == (numloops%100000) )
{
printf(“number of steps: %ld\n”, numsteps);
}
if( 99999 == (numloops%100000) )
{
for(j=0; j< 200 ; j++)
{
printf(“%ld “, ptr_exponents[j]);
}

printf(“\n”);
}

RecordRobinQuotient = (__float128) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (__float128) 0;

base_tmp_now_sigma_r = (__float128) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((__float128)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((__float128)sigma)/((__float128)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];

for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expq(euler);

log2nprime = logq(tmp_now_n);

robin_bound = expq(euler)*log2nprime;

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if( 99999 == (numloops%100000) )
{

printf(“current step number = %ld “, current_step_number);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep);

printf(“log(log(n’)) = %.30Qf “, log2nprime);

printf(“Robin upper bound = %.30Qf “, robin_bound);

printf(“sigma(n’)/n’ = %.30Qf \n”, tmp_now_quotient);
}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
// if(list_steps[j] != 1)
// {
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
// else
// {
// tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[1];
// ratio = expq( puiss3sigmalogs[tmp_exponent]-(((__float128)tmp_exponent)*splogs[1]) );

// tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
}

tmp_now_n = tmp_now_n + logq((__float128) ptr_primes[current_step- file_offset]);
ratio = ((__float128)1)/( (__float128)ptr_primes[current_step- file_offset] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expq(euler);
log2nprime = logq(tmp_now_n);
robin_bound = expq(euler)*log2nprime;
tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if( 99999 == (numloops%100000) )
{
printf(“current step number = %ld “, current_step_number);

printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep);

printf(“log(log(n’)) = %.30Qf “, log2nprime);

printf(“Robin upper bound = %.30Qf “, robin_bound);

printf(“sigma(n’)/n’ = %.30Qf \n”, tmp_now_quotient);

}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{

if(num_new_primes < 79999500)
{

for(j=0; j< 100 ; j++)
{

sum_logs_primes = sum_logs_primes + logq( (__float128) ptr_primes[numprimes- file_offset]);

ratio = ((__float128)1)/((__float128)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
}
else
{

sum_logs_primes = sum_logs_primes + logq( (__float128) ptr_primes[numprimes- file_offset]);

ratio = ((__float128)1)/((__float128)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 99999 == (numloops%100000) )
{
printf(“=================================\n”);
}
}
}

fclose(in);
/********************** Next batch 80 M and loop *******************/

/*****************************************************************
? primepi(99036319010)

%37 = 4080000000

4,080,000,000 primes included in `n’
in = fopen(“/home/david2/eratosthenes/LargePrimes_to_1e11ofNov22a.txt”, “r”);
**********************************************************************/
in = fopen(“/home/david2/eratosthenes2/LargePrimes_to_2e11ofNov26a.txt”, “r”);
for(kij = 1; kij < 50; kij++)
{

for(j=0; j< 80000000 ; j++)
{
fscanf(in, “%ld”, &ptr_primes[j]);
}

file_offset = file_offset + ((long)80000000) ;
num_new_primes = (long) 0;

numloops = (long) 0;

while( num_new_primes < ((long)80000000) )
{
numloops++;

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;

if( 99999 == (numloops%100000) )
{
for(j=0; j< numsteps; j++)
{
printf(“step at %ld\n”, list_steps[j]+1);
}
printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
printf(“numloops = %ld\n”, numloops);
printf(“\n”);
}
if( 99999 == (numloops%100000) )
{
printf(“number of steps: %ld\n”, numsteps);
}
if( 99999 == (numloops%100000) )
{
for(j=0; j< 200 ; j++)
{
printf(“%ld “, ptr_exponents[j]);
}

printf(“\n”);
}

if( 799999 == (numloops%800000) )
{
printf(“record_low_variation_delta = %.30Qf “, record_low_variation_delta);
printf(“record_low_log2n = %.30Qf\n\n”, record_low_log2n);
fflush(stdout);

record_low_variation_delta = (__float128) 100;
record_low_log2n = (__float128) 0;
}

RecordRobinQuotient = (__float128) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (__float128) 0;

base_tmp_now_sigma_r = (__float128) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((__float128)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((__float128)sigma)/((__float128)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];

for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expq(euler);

log2nprime = logq(tmp_now_n);

robin_bound = expq(euler)*log2nprime;

delta = robin_bound – tmp_now_quotient;

delta_log = logq(delta);

delta_estimate = constant – log2nprime/((__float128) 2);

variation_delta = delta_log – delta_estimate;

if( variation_delta < record_low_variation_delta)
{
record_low_variation_delta = variation_delta;
record_low_log2n = log2nprime;
}

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if( 99999 == (numloops%100000) )
{

printf(“current step number = %ld “, current_step_number+1);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep+1);

printf(“log(log(n’)) = %.30Qf “, log2nprime);

printf(“Robin upper bound = %.30Qf “, robin_bound);

printf(“sigma(n’)/n’ = %.30Qf \n”, tmp_now_quotient);
}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
// if(list_steps[j] != 1)
// {
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
// else
// {
// tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[1];
// ratio = expq( puiss3sigmalogs[tmp_exponent]-(((__float128)tmp_exponent)*splogs[1]) );

// tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
}

tmp_now_n = tmp_now_n + logq((__float128) ptr_primes[current_step- file_offset]);
ratio = ((__float128)1)/( (__float128)ptr_primes[current_step- file_offset] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expq(euler);
log2nprime = logq(tmp_now_n);
robin_bound = expq(euler)*log2nprime;

delta = robin_bound – tmp_now_quotient;

delta_log = logq(delta);

delta_estimate = constant – log2nprime/((__float128) 2);

variation_delta = delta_log – delta_estimate;

if( variation_delta < record_low_variation_delta)
{
record_low_variation_delta = variation_delta;
record_low_log2n = log2nprime;
}

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if( 99999 == (numloops%100000) )
{
printf(“current step number = %ld “, current_step_number+1);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep+1);

printf(“log(log(n’)) = %.30Qf “, log2nprime);

printf(“Robin upper bound = %.30Qf “, robin_bound);

printf(“sigma(n’)/n’ = %.30Qf \n”, tmp_now_quotient);

}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{

if(num_new_primes < 79999500)
{

for(j=0; j< 100 ; j++)
{

sum_logs_primes = sum_logs_primes + logq( (__float128) ptr_primes[numprimes- file_offset]);

ratio = ((__float128)1)/((__float128)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
}
else
{

sum_logs_primes = sum_logs_primes + logq( (__float128) ptr_primes[numprimes- file_offset]);

ratio = ((__float128)1)/((__float128)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 99999 == (numloops%100000) )
{
printf(“=================================\n”);
}
}
}

fclose(in);
/*****************************************************************
? primepi(99036319010)

%37 = 4080000000

4,080,000,000 primes included in `n’
in = fopen(“/home/david2/eratosthenes/LargePrimes_to_1e11ofNov22a.txt”, “r”);
Now, after another 49 batches of 80,000,000

we have done:

3,920,000,000 + 4,080,000,000 =

8,000,000,000 primes included in `n’

37,607,912,018 primes below 10^12 .

370 batches of 80 million

**********************************************************************/
for(kijj = 1; kijj <= 370 ; kijj++)
{

sivcount_new_primes = (long) 0;
sivbatchdone = 0;

while( (sivcount_new_primes < 80000000) && (sivbatchdone == 0) )
{

sivblockprimecount = (long) 0;

for(sivj=0; sivj< sivblock_size; sivj++)
{
sivptr_remains[sivj] = sivuc1;
}

for(sivj=0; sivj< 78498; sivj++)
{
sivp = sivsmall_primes[sivj];
sivrem = sivoffset%sivp;

if(sivrem == 0)
{
sivbarred = sivoffset;
}
else
{
sivbarred = sivoffset + sivp – sivrem;
}

sivindex = sivbarred – sivoffset;

while(sivindex< sivblock_size)
{
sivptr_remains[sivindex] = sivuc0;
sivindex = sivindex+sivp;
}
}

for(sivj=0; sivj< sivblock_size; sivj++)
{
if( sivptr_remains[sivj] == sivuc1 )
{
sivcount++;
sivcount_new_primes++;
sivblockprimecount++;
if(sivcount_new_primes <= 80000000)
{
ptr_primes[sivcount_new_primes – 1] = sivoffset + sivj ;
}
}
}

if(sivcount_new_primes >= 80000000 )
{
sivbatchdone = 1;
siv_left_overs = sivcount_new_primes – 80000000;
siv_keeps = sivblockprimecount – siv_left_overs;
sivp_num = (long) 0;

for(sivj=0; sivj< sivblock_size; sivj++)
{
if(sivptr_remains[sivj] == sivuc1 )
{
sivp_num++;
if(sivp_num == siv_keeps)
{
siv_last_sivj = sivj;
}
}
}
sivoffset_next = sivoffset + siv_last_sivj + ((long) 1);
sivoffset = sivoffset_next;
}
else
{
sivoffset = sivoffset + sivblock_size;
}
}
if( kijj == 1 )
{

out=fopen(“/home/david2/eratosthenes4/batchp001a.txt”, “w”);

for(j=0; j< 80000000 ; j++)
{
fprintf(out, “%ld\n”, ptr_primes[j]);
}

fclose(out);
}
file_offset = file_offset + ((long)80000000) ;
num_new_primes = (long) 0;

numloops = (long) 0;
while( num_new_primes < ((long)80000000) )
{
numloops++;

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;

if( 99999 == (numloops%100000) )
{
for(j=0; j< numsteps; j++)
{
printf(“step at %ld\n”, list_steps[j]+1);
}
printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
printf(“numloops = %ld\n”, numloops);
printf(“\n”);
}
if( 99999 == (numloops%100000) )
{
printf(“number of steps: %ld\n”, numsteps);
}
if( 99999 == (numloops%100000) )
{
for(j=0; j< 200 ; j++)
{
printf(“%ld “, ptr_exponents[j]);
}

printf(“\n”);
}

if( 799999 == (numloops%800000) )
{
printf(“\n\nrecord_low_variation_delta = %.30Qf “, record_low_variation_delta);
printf(“record_low_log2n = %.30Qf\n\n”, record_low_log2n);
fflush(stdout);
record_low_variation_delta = (__float128) 100;
record_low_log2n = (__float128) 0;
}

RecordRobinQuotient = (__float128) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (__float128) 0;

base_tmp_now_sigma_r = (__float128) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((__float128)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((__float128)sigma)/((__float128)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];

for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expq(euler);

log2nprime = logq(tmp_now_n);

robin_bound = expq(euler)*log2nprime;

delta = robin_bound – tmp_now_quotient;

delta_log = logq(delta);

delta_estimate = constant – log2nprime/((__float128) 2);

variation_delta = delta_log – delta_estimate;

if( variation_delta < record_low_variation_delta)
{
record_low_variation_delta = variation_delta;
record_low_log2n = log2nprime;
}

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if( 99999 == (numloops%100000) )
{

printf(“current step number = %ld “, current_step_number+1);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep+1);

printf(“log(log(n’)) = %.30Qf “, log2nprime);

printf(“Robin upper bound = %.30Qf “, robin_bound);

printf(“sigma(n’)/n’ = %.30Qf \n”, tmp_now_quotient);
}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
// if(list_steps[j] != 1)
// {
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
// else
// {
// tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[1];
// ratio = expq( puiss3sigmalogs[tmp_exponent]-(((__float128)tmp_exponent)*splogs[1]) );

// tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
}

tmp_now_n = tmp_now_n + logq((__float128) ptr_primes[current_step- file_offset]);
ratio = ((__float128)1)/( (__float128)ptr_primes[current_step- file_offset] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expq(euler);
log2nprime = logq(tmp_now_n);
robin_bound = expq(euler)*log2nprime;

delta = robin_bound – tmp_now_quotient;

delta_log = logq(delta);

delta_estimate = constant – log2nprime/((__float128) 2);

variation_delta = delta_log – delta_estimate;

if( variation_delta < record_low_variation_delta)
{
record_low_variation_delta = variation_delta;
record_low_log2n = log2nprime;
}

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if( 99999 == (numloops%100000) )
{
printf(“current step number = %ld “, current_step_number+1);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep+1);

printf(“log(log(n’)) = %.30Qf “, log2nprime);

printf(“Robin upper bound = %.30Qf “, robin_bound);

printf(“sigma(n’)/n’ = %.30Qf \n”, tmp_now_quotient);

}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{

if(num_new_primes < 79999500)
{

for(j=0; j< 100 ; j++)
{

sum_logs_primes = sum_logs_primes + logq( (__float128) ptr_primes[numprimes- file_offset]);

ratio = ((__float128)1)/((__float128)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
}
else
{

sum_logs_primes = sum_logs_primes + logq( (__float128) ptr_primes[numprimes- file_offset]);

ratio = ((__float128)1)/((__float128)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 99999 == (numloops%100000) )
{
printf(“=================================\n”);
}
}

}
/*****************************************************************
? primepi(99036319010)

%37 = 4080000000

4,080,000,000 primes included in `n’
in = fopen(“/home/david2/eratosthenes/LargePrimes_to_1e11ofNov22a.txt”, “r”);
Now, after another 49 batches of 80,000,000

we have done:

3,920,000,000 + 4,080,000,000 =

8,000,000,000 primes included in `n’

37,607,912,018 primes below 10^12 .

370 batches of 80 million
above is done already.
Now,
470 batches of 80 million have been completed.
about 37,600,000,000 primes included in `n’ ,

i.e. below just under 10^12.

Next, go to 4*10^12
Nicely:

pi(4e+12) ~= 142,966,208,126

1787 bacthes in all.

470 batches are done.

1317 batches remain to be done.

Use sieving for first 150,000 primes to cover
numbers below 4e+12 for primality testing.

9 December 2014

6:15 pm
**********************************************************************/
for(kijj = 1; kijj <= 1317 ; kijj++)
{

sivcount_new_primes = (long) 0;
sivbatchdone = 0;

while( (sivcount_new_primes < 80000000) && (sivbatchdone == 0) )
{

sivblockprimecount = (long) 0;

for(sivj=0; sivj< sivblock_size; sivj++)
{
sivptr_remains[sivj] = sivuc1;
}

for(sivj=0; sivj< 150000 ; sivj++)
{
sivp = sivsmall_primes[sivj];
sivrem = sivoffset%sivp;

if(sivrem == 0)
{
sivbarred = sivoffset;
}
else
{
sivbarred = sivoffset + sivp – sivrem;
}

sivindex = sivbarred – sivoffset;

while(sivindex< sivblock_size)
{
sivptr_remains[sivindex] = sivuc0;
sivindex = sivindex+sivp;
}
}

for(sivj=0; sivj< sivblock_size; sivj++)
{
if( sivptr_remains[sivj] == sivuc1 )
{
sivcount++;
sivcount_new_primes++;
sivblockprimecount++;
if(sivcount_new_primes <= 80000000)
{
ptr_primes[sivcount_new_primes – 1] = sivoffset + sivj ;
}
}
}

if(sivcount_new_primes >= 80000000 )
{
sivbatchdone = 1;
siv_left_overs = sivcount_new_primes – 80000000;
siv_keeps = sivblockprimecount – siv_left_overs;
sivp_num = (long) 0;

for(sivj=0; sivj< sivblock_size; sivj++)
{
if(sivptr_remains[sivj] == sivuc1 )
{
sivp_num++;
if(sivp_num == siv_keeps)
{
siv_last_sivj = sivj;
}
}
}
sivoffset_next = sivoffset + siv_last_sivj + ((long) 1);
sivoffset = sivoffset_next;
}
else
{
sivoffset = sivoffset + sivblock_size;
}
}
if( kijj == 1 )
{

out=fopen(“/home/david2/eratosthenes4/batchp002a.txt”, “w”);

for(j=0; j< 80000000 ; j++)
{
fprintf(out, “%ld\n”, ptr_primes[j]);
}

fclose(out);
}
file_offset = file_offset + ((long)80000000) ;
num_new_primes = (long) 0;

numloops = (long) 0;
while( num_new_primes < ((long)80000000) )
{
numloops++;

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;

if( 99999 == (numloops%100000) )
{
for(j=0; j< numsteps; j++)
{
printf(“step at %ld\n”, list_steps[j]+1);
}
printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
printf(“numloops = %ld\n”, numloops);
printf(“\n”);
}
if( 99999 == (numloops%100000) )
{
printf(“number of steps: %ld\n”, numsteps);
}
if( 99999 == (numloops%100000) )
{
for(j=0; j< 200 ; j++)
{
printf(“%ld “, ptr_exponents[j]);
}

printf(“\n”);
}

if( 399999 == (numloops%400000) )
{
printf(“\n\nrecord_low_variation_delta = %.30Qf “, record_low_variation_delta);
printf(“record_low_log2n = %.30Qf\n\n”, record_low_log2n);
fflush(stdout);
record_low_variation_delta = (__float128) 100;
record_low_log2n = (__float128) 0;
}

RecordRobinQuotient = (__float128) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (__float128) 0;

base_tmp_now_sigma_r = (__float128) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((__float128)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((__float128)sigma)/((__float128)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];

for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expq(euler);

log2nprime = logq(tmp_now_n);

robin_bound = expq(euler)*log2nprime;

delta = robin_bound – tmp_now_quotient;

delta_log = logq(delta);

delta_estimate = constant – log2nprime/((__float128) 2);

variation_delta = delta_log – delta_estimate;

if( variation_delta < record_low_variation_delta)
{
record_low_variation_delta = variation_delta;
record_low_log2n = log2nprime;
}

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if( 99999 == (numloops%100000) )
{

printf(“current step number = %ld “, current_step_number+1);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep+1);

printf(“log(log(n’)) = %.30Qf “, log2nprime);

printf(“Robin upper bound = %.30Qf “, robin_bound);

printf(“sigma(n’)/n’ = %.30Qf \n”, tmp_now_quotient);
}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
// if(list_steps[j] != 1)
// {
tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((__float128)sigma)/((__float128)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
// else
// {
// tmp_now_n = tmp_now_n + ((__float128)tmp_exponent)*splogs[1];
// ratio = expq( puiss3sigmalogs[tmp_exponent]-(((__float128)tmp_exponent)*splogs[1]) );

// tmp_now_sigma_r = tmp_now_sigma_r*ratio;
// }
}

tmp_now_n = tmp_now_n + logq((__float128) ptr_primes[current_step- file_offset]);
ratio = ((__float128)1)/( (__float128)ptr_primes[current_step- file_offset] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expq(euler);
log2nprime = logq(tmp_now_n);
robin_bound = expq(euler)*log2nprime;

delta = robin_bound – tmp_now_quotient;

delta_log = logq(delta);

delta_estimate = constant – log2nprime/((__float128) 2);

variation_delta = delta_log – delta_estimate;

if( variation_delta < record_low_variation_delta)
{
record_low_variation_delta = variation_delta;
record_low_log2n = log2nprime;
}

tmp_el_now_robin = tmp_now_robin/logq(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if( 99999 == (numloops%100000) )
{
printf(“current step number = %ld “, current_step_number+1);

printf(“quotient de Robin: %.30Qf “, tmp_now_robin);

printf(“record step is at: %ld\n”, RecordStep+1);

printf(“log(log(n’)) = %.30Qf “, log2nprime);

printf(“Robin upper bound = %.30Qf “, robin_bound);

printf(“sigma(n’)/n’ = %.30Qf \n”, tmp_now_quotient);

}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{

if(num_new_primes < 79999500)
{

for(j=0; j< 200 ; j++)
{

sum_logs_primes = sum_logs_primes + logq( (__float128) ptr_primes[numprimes- file_offset]);

ratio = ((__float128)1)/((__float128)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
}
else
{

sum_logs_primes = sum_logs_primes + logq( (__float128) ptr_primes[numprimes- file_offset]);

ratio = ((__float128)1)/((__float128)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 99999 == (numloops%100000) )
{
printf(“=================================\n”);
}
}

}
return 0;
}

Written by meditationatae

December 16, 2014 at 8:42 am

Posted in History

Source code for superabundant numbers computation program in C

/**********************************************************

Source code for:  superabun1848a.c

$ date
Thu Dec 4 13:14:45 EST 2014

********************************************************/

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
long double splogs[100000];
long double theta[100000];
long double prod100k[100000];
long ptr_exponents[100000];
long pts_primes[100000];
long ptr_isstep[100000];
int main(void)
{
long theIndex;
long double euler = 0.57721566490153286060651L;
long j;
long numprimes;
long num_new_primes;
long file_offset;
long jj;
long kij;
long numBigPrimesUsed;
long double sum_log_cofactor;
long double sum_theta_Cheb;
long double puiss3sigmalogs[50];
long numsteps;
long expon;
long sigma;
long * ptr_primes;
long list_steps[1000];
long power;
long old_prime;
long powerb;
int nownow;
int go_skip;
int answer;
long k;
long l;
long numloops;
long vintageloops;
long tmp_exponent;
long m;
long p;
long sum;
int not_done;
int junk;
int leave_loop;
long ljunk;
int skip_base_case;
long current_step;
long now_step;
long double RecordRobinQuotient;
long double RecordQuotient;
long double tmp_now_n;
long double log2nprime;
long double robin_bound;
long double base_tmp_now_n;
long RecordStep;
long double tmp_now_robin;
long double constant;
long double prod_sigma_r;
long double prod_sigma_rone;
long double base_tmp_now_sigma_r;
long double prod_sigma_r_cofactor;
long double tmp_now_sigma_r;
long double tmp_now_quotient;
long double delta;
long double delta_log;
long double delta_estimate;
long double variation_delta;
long double record_low_variation_delta;
long double record_low_log2n;
long double tmp_el_now_robin;
long double now_n;
long current_step_number;
long double sum_logs_primes;
long double sum_logs_all;
long double ratio;
long double now_robin;
FILE *in;
record_low_variation_delta = (long double) 100;
record_low_log2n = (long double) 0;
ptr_primes = (long *) calloc(80000000, sizeof(long));
in = fopen(“/home/david2/eratosthenes/primes100meg01a_tmp.txt”, “r”);
for(j=0; j< 100000 ; j++)
{
fscanf(in, “%ld”, &theIndex);
fscanf(in, “%ld”, &pts_primes[j]);
}
fclose(in);

constant = ((long double) 323336)/((long double) 1000000);

in = fopen(“/home/david2/eratosthenes/prout100k”, “r”);
for(j=0; j<100000; j++)
{
fscanf(in, “%Lf”, &prod100k[j]);
}
fclose(in);
in = fopen(“/home/david2/eratosthenes/LargePrimes_to_1e10a.txt”, “r”);
for(j=0; j<79920000 ; j++)
{
fscanf(in, “%ld”, &ljunk);
}
for(j=0; j< 80000000 ; j++)
{
fscanf(in, “%ld”, &ptr_primes[j]);
}

fclose(in);
in = fopen(“/home/david2/eratosthenes/puiss3sigmalogs”, “r”);

for(j=0; j< 50 ; j++)
{
fscanf(in, “%d”, &junk);
fscanf(in, “%Lf”, &puiss3sigmalogs[j]);
}
fclose(in);
for(j=0; j< 100000 ; j++)
{
ptr_exponents[j] = (long) 0;
}
prod_sigma_r = (long double) 1;

prod_sigma_rone = (long double) 1;

for(j=0; j< 100000 ; j++)
{
ptr_isstep[j] = (long) 0;
}
in = fopen(“/home/david2/eratosthenes/exponents_out802a.txt”, “r”);
for(j=0; j< 100000 ; j++)
{
fscanf(in, “%ld”, &theIndex);
fscanf(in, “%ld”, &ptr_exponents[j]);
}
fclose(in);
numprimes = (long) 80000000;

numBigPrimesUsed = (long) 79000000;

leave_loop = 0;
in = fopen(“/home/david2/eratosthenes/primes_out802a.txt”, “r”);

sum_logs_primes = (long double) 0;
sum_logs_all = (long double) 0;
for(j=0; j<80000000; j++)
{
fscanf(in, “%ld”, &ljunk);
fscanf(in, “%ld”, &old_prime);
sum_logs_primes = sum_logs_primes + logl((long double)old_prime);

if(j < 100000)
{
sum_logs_all = sum_logs_all + ((long double)ptr_exponents[j])*logl((long double)old_prime);
}
else
{
sum_logs_all = sum_logs_all + logl((long double)old_prime);
}
}

fclose(in);

for(j=0; j<100000; j++)
{
splogs[j] = logl((long double) pts_primes[j]);
}

sum_theta_Cheb = (long double) 0;
for(j=0; j<100000; j++)
{
sum_theta_Cheb = sum_theta_Cheb + logl((long double) pts_primes[j]) ;
theta[j] = sum_theta_Cheb;
}
skip_base_case = (int) 0;
for(j=0; j< 100000 ; j++)
{

p = pts_primes[j];

expon = ptr_exponents[j];

ratio = (long double) 1;

for(jj = 0; jj < 1; jj++)
{
ratio = ((long double)1) + (ratio/((long double) p) );
}

if(expon == 1)
{
prod_sigma_rone = prod_sigma_rone*ratio;
}
prod_sigma_r = prod_sigma_r*ratio;
}

in = fopen(“/home/david2/eratosthenes/primes_out802a.txt”, “r”);

for(j=0 ; j<numprimes; j++)
{
fscanf(in, “%ld”, &ljunk);
fscanf(in, “%ld”, &old_prime);

if( j > 99999 )
{
prod_sigma_r = prod_sigma_r + (prod_sigma_r/((long double)old_prime)) ;
prod_sigma_rone = prod_sigma_rone + (prod_sigma_rone/((long double)old_prime)) ;
}
}

fclose(in);

// printf(“sum_logs_all = %.16Lf\n\n”, sum_logs_all);
// printf(“log of sum_logs_all or log log n is: %.16Lf\n\n”, logl(sum_logs_all) );
for(numloops = 0; numloops < 80002284 ; numloops++)
{

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;
if( (2283 ==(numloops%64000)) || (((numloops – 80002283) < 6)&&((80002283-numloops) < 6)) )
{
// for(j=0; j< numsteps; j++)
// {
// printf(“step at %ld\n”, list_steps[j]);
// }
// printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
// printf(“numloops = %ld\n”, numloops);
// printf(“\n”);

if(numloops == 80002283)
{
// printf(“numloops = %ld\n”, numloops);
// printf(“break from current loop, ok?\n”);
// printf(“enter 1 for yes, 0 for no:\n”);

if(1 == 1)
{
leave_loop = 1;
}
else
{
leave_loop = 1;
}
}
}

if(leave_loop == 0)
{
if((2283 ==(numloops%64000)) || (((numloops – 80002283) < 6)&&((80002283-numloops) < 6)) )
{
// printf(“number of steps: %ld\n”, numsteps);
}
RecordRobinQuotient = (long double) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (long double) 0;

base_tmp_now_sigma_r = (long double) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((long double)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((long double)sigma)/((long double)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];
for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((long double)sigma)/((long double)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expl(euler);

tmp_el_now_robin = tmp_now_robin/logl(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if((2283 ==(numloops%64000)) || (((numloops – 80002283) < 6)&&((80002283-numloops) < 6)) )
{

// printf(“current step number = %ld “, current_step_number);

// printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

// printf(“record step is at: %ld\n”, RecordStep);

}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
if(list_steps[j] != 1)
{
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((long double)sigma)/((long double)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}
else
{
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[1];
ratio = expl( puiss3sigmalogs[tmp_exponent]-(((long double)tmp_exponent)*splogs[1]) );

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}
}

tmp_now_n = tmp_now_n + logl((long double) ptr_primes[current_step-80000000]);
ratio = ((long double)1)/( (long double)ptr_primes[current_step-80000000] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expl(euler);

tmp_el_now_robin = tmp_now_robin/logl(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if((2283 ==(numloops%64000)) || (((numloops – 80002283) < 6)&&((80002283-numloops) < 6)) )
{
// printf(“current step number = %ld “, current_step_number);

// printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

// printf(“record step is at: %ld\n”, RecordStep);
}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{
sum_logs_primes = sum_logs_primes + logl( (long double) ptr_primes[numprimes-80000000]);

ratio = ((long double)1)/((long double)ptr_primes[numprimes-80000000]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 2283 ==(numloops%64000) )
{
for(j=0; j< 200 ; j++)
{
// printf(“%ld “, ptr_exponents[j]);
}

// printf(“\n\n”);
}
}
/*** if leave loop == 0 ****/
if( leave_loop == 1 )
{
break;
}
}

/**************** next 80 million batch … *****************/
/*************************************************************
prime 160,000,000 is:

3340200037

or

3,340,200,037 .

:159920000p
3340200037
3340200037
************************************************************/

in = fopen(“/home/david2/eratosthenes/LargePrimes_to_1e11ofNov22a.txt”, “r”);
for(j=0; j< 159920000 ; j++)
{
fscanf(in, “%ld”, &old_prime);
}
for(j=0; j< 80000000 ; j++)
{
fscanf(in, “%ld”, &ptr_primes[j]);
}
/**************************************

==============================================
next: loops ….

******************************************************/
file_offset = (long) 160000000;
num_new_primes = (long) 0;

numloops = (long) 0;
while( num_new_primes < ((long)80000000) )
{
numloops++;

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;

if( 9999 == (num_new_primes%10000) )
{
for(j=0; j< numsteps; j++)
{
// printf(“step at %ld\n”, list_steps[j]);
}
// printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
// printf(“numloops = %ld\n”, numloops);
// printf(“\n”);
}
if( 9999 == (num_new_primes%10000) )
{
// printf(“number of steps: %ld\n”, numsteps);
}
RecordRobinQuotient = (long double) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (long double) 0;

base_tmp_now_sigma_r = (long double) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((long double)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((long double)sigma)/((long double)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];

for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((long double)sigma)/((long double)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expl(euler);

tmp_el_now_robin = tmp_now_robin/logl(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if( 9999 == (num_new_primes%10000) )
{

// printf(“current step number = %ld “, current_step_number);

// printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

// printf(“record step is at: %ld\n”, RecordStep);

}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
if(list_steps[j] != 1)
{
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((long double)sigma)/((long double)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}
else
{
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[1];
ratio = expl( puiss3sigmalogs[tmp_exponent]-(((long double)tmp_exponent)*splogs[1]) );

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}
}

tmp_now_n = tmp_now_n + logl((long double) ptr_primes[current_step- file_offset]);
ratio = ((long double)1)/( (long double)ptr_primes[current_step- file_offset] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expl(euler);

tmp_el_now_robin = tmp_now_robin/logl(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if( 9999 == (num_new_primes%10000) )
{
// printf(“current step number = %ld “, current_step_number);

// printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

// printf(“record step is at: %ld\n”, RecordStep);
}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{
sum_logs_primes = sum_logs_primes + logl( (long double) ptr_primes[numprimes- file_offset]);

ratio = ((long double)1)/((long double)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 9999 == (num_new_primes%10000) )
{
for(j=0; j< 200 ; j++)
{
// printf(“%ld “, ptr_exponents[j]);
}

// printf(“\n\n”);
}
}
/********************** Next batch 80 M and loop *******************/

for(kij = 1; kij < 49; kij++)
{

for(j=0; j< 80000000 ; j++)
{
fscanf(in, “%ld”, &ptr_primes[j]);
}

file_offset = file_offset + ((long)80000000) ;

/*** 240 000 000 for kij=1 ***/
num_new_primes = (long) 0;

numloops = (long) 0;

while( num_new_primes < ((long)80000000) )
{
numloops++;

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;

if( 9999 == (numloops%10000) )
{
for(j=0; j< numsteps; j++)
{
// printf(“step at %ld\n”, list_steps[j]);
}
// printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
// printf(“numloops = %ld\n”, numloops);
// printf(“\n”);
}
if( 9999 == (numloops%10000) )
{
// printf(“number of steps: %ld\n”, numsteps);
}
if( 9999 == (numloops%10000) )
{
for(j=0; j< 200 ; j++)
{
// printf(“%ld “, ptr_exponents[j]);
}

// printf(“\n”);
}

RecordRobinQuotient = (long double) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (long double) 0;

base_tmp_now_sigma_r = (long double) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((long double)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((long double)sigma)/((long double)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];

for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((long double)sigma)/((long double)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expl(euler);

log2nprime = logl(tmp_now_n);

robin_bound = expl(euler)*log2nprime;

tmp_el_now_robin = tmp_now_robin/logl(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if( 9999 == (numloops%10000) )
{

// printf(“current step number = %ld “, current_step_number);

// printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

// printf(“record step is at: %ld\n”, RecordStep);

// printf(“log(log(n’)) = %.16Lf “, log2nprime);

// printf(“Robin upper bound = %.16Lf “, robin_bound);

// printf(“sigma(n’)/n’ = %.16Lf \n”, tmp_now_quotient);
}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
if(list_steps[j] != 1)
{
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((long double)sigma)/((long double)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}
else
{
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[1];
ratio = expl( puiss3sigmalogs[tmp_exponent]-(((long double)tmp_exponent)*splogs[1]) );

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}
}

tmp_now_n = tmp_now_n + logl((long double) ptr_primes[current_step- file_offset]);
ratio = ((long double)1)/( (long double)ptr_primes[current_step- file_offset] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expl(euler);
log2nprime = logl(tmp_now_n);
robin_bound = expl(euler)*log2nprime;
tmp_el_now_robin = tmp_now_robin/logl(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if( 9999 == (numloops%10000) )
{
// printf(“current step number = %ld “, current_step_number);

// printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

// printf(“record step is at: %ld\n”, RecordStep);

// printf(“log(log(n’)) = %.16Lf “, log2nprime);

// printf(“Robin upper bound = %.16Lf “, robin_bound);

// printf(“sigma(n’)/n’ = %.16Lf \n”, tmp_now_quotient);

}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{

if(num_new_primes < 79999500)
{

for(j=0; j< 100 ; j++)
{

sum_logs_primes = sum_logs_primes + logl( (long double) ptr_primes[numprimes- file_offset]);

ratio = ((long double)1)/((long double)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
}
else
{

sum_logs_primes = sum_logs_primes + logl( (long double) ptr_primes[numprimes- file_offset]);

ratio = ((long double)1)/((long double)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 9999 == (numloops%10000) )
{
// printf(“=================================\n”);
}
}
}

fclose(in);
/********************** Next batch 80 M and loop *******************/

/*****************************************************************
? primepi(99036319010)

%37 = 4080000000

4,080,000,000 primes included in `n’
in = fopen(“/home/david2/eratosthenes/LargePrimes_to_1e11ofNov22a.txt”, “r”);
**********************************************************************/
in = fopen(“/home/david2/eratosthenes2/LargePrimes_to_2e11ofNov26a.txt”, “r”);
for(kij = 1; kij < 50; kij++)
{

for(j=0; j< 80000000 ; j++)
{
fscanf(in, “%ld”, &ptr_primes[j]);
}

file_offset = file_offset + ((long)80000000) ;
num_new_primes = (long) 0;

numloops = (long) 0;

while( num_new_primes < ((long)80000000) )
{
numloops++;

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;

if( 9999 == (numloops%10000) )
{
for(j=0; j< numsteps; j++)
{
// printf(“step at %ld\n”, list_steps[j]+1);
}
// printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
// printf(“numloops = %ld\n”, numloops);
// printf(“\n”);
}
if( 9999 == (numloops%10000) )
{
// printf(“number of steps: %ld\n”, numsteps);
}
if( 9999 == (numloops%10000) )
{
for(j=0; j< 200 ; j++)
{
// printf(“%ld “, ptr_exponents[j]);
}

// printf(“\n”);
}

if( 799999 == (numloops%800000) )
{
printf(“record_low_variation_delta = %.16Lf “, record_low_variation_delta);
printf(“record_low_log2n = %.16Lf\n\n”, record_low_log2n);
fflush(stdout);

record_low_variation_delta = (long double) 100;
record_low_log2n = (long double) 0;
}

RecordRobinQuotient = (long double) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (long double) 0;

base_tmp_now_sigma_r = (long double) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((long double)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((long double)sigma)/((long double)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];

for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((long double)sigma)/((long double)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expl(euler);

log2nprime = logl(tmp_now_n);

robin_bound = expl(euler)*log2nprime;

delta = robin_bound – tmp_now_quotient;

delta_log = logl(delta);

delta_estimate = constant – log2nprime/((long double) 2);

variation_delta = delta_log – delta_estimate;

if( variation_delta < record_low_variation_delta)
{
record_low_variation_delta = variation_delta;
record_low_log2n = log2nprime;
}

tmp_el_now_robin = tmp_now_robin/logl(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if( 9999 == (numloops%10000) )
{

// printf(“current step number = %ld “, current_step_number+1);

// printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

// printf(“record step is at: %ld\n”, RecordStep+1);

// printf(“log(log(n’)) = %.16Lf “, log2nprime);

// printf(“Robin upper bound = %.16Lf “, robin_bound);

// printf(“sigma(n’)/n’ = %.16Lf \n”, tmp_now_quotient);
}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
if(list_steps[j] != 1)
{
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((long double)sigma)/((long double)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}
else
{
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[1];
ratio = expl( puiss3sigmalogs[tmp_exponent]-(((long double)tmp_exponent)*splogs[1]) );

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}
}

tmp_now_n = tmp_now_n + logl((long double) ptr_primes[current_step- file_offset]);
ratio = ((long double)1)/( (long double)ptr_primes[current_step- file_offset] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expl(euler);
log2nprime = logl(tmp_now_n);
robin_bound = expl(euler)*log2nprime;

delta = robin_bound – tmp_now_quotient;

delta_log = logl(delta);

delta_estimate = constant – log2nprime/((long double) 2);

variation_delta = delta_log – delta_estimate;

if( variation_delta < record_low_variation_delta)
{
record_low_variation_delta = variation_delta;
record_low_log2n = log2nprime;
}

tmp_el_now_robin = tmp_now_robin/logl(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if( 9999 == (numloops%10000) )
{
// printf(“current step number = %ld “, current_step_number+1);

// printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

// printf(“record step is at: %ld\n”, RecordStep+1);

// printf(“log(log(n’)) = %.16Lf “, log2nprime);

// printf(“Robin upper bound = %.16Lf “, robin_bound);

// printf(“sigma(n’)/n’ = %.16Lf \n”, tmp_now_quotient);

}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{

if(num_new_primes < 79999500)
{

for(j=0; j< 100 ; j++)
{

sum_logs_primes = sum_logs_primes + logl( (long double) ptr_primes[numprimes- file_offset]);

ratio = ((long double)1)/((long double)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
}
else
{

sum_logs_primes = sum_logs_primes + logl( (long double) ptr_primes[numprimes- file_offset]);

ratio = ((long double)1)/((long double)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 9999 == (numloops%10000) )
{
// printf(“=================================\n”);
}
}
}

fclose(in);

in = fopen(“/home/david2/eratosthenes2/LargePrimes_to_5e11ofNov29a.txt”, “r”);
for(kij = 1; kij < 142; kij++)
{

for(j=0; j< 80000000 ; j++)
{
fscanf(in, “%ld”, &ptr_primes[j]);
}

file_offset = file_offset + ((long)80000000) ;
num_new_primes = (long) 0;

numloops = (long) 0;

while( num_new_primes < ((long)80000000) )
{
numloops++;

ptr_isstep[0] = (long) 1;
list_steps[0] = (long) 0;
numsteps = (long) 1;
not_done = (int) 1;
j = (long) 0;

while(not_done == 1)
{
j++;

if(ptr_exponents[j]< ptr_exponents[j-1])
{
ptr_isstep[j] = (long) 1;
list_steps[numsteps] = j;
numsteps++;
}
else
{
ptr_isstep[j] = (long) 0;
}

if(ptr_exponents[j] == ((long) 1))
{
not_done = (int) 0;
}

}

list_steps[numsteps] = numprimes;
numsteps++;

if( 9999 == (numloops%10000) )
{
for(j=0; j< numsteps; j++)
{
// printf(“step at %ld\n”, list_steps[j]+1);
}
// printf(“\nNumber of big primes used in making current n is: %ld\n”, numBigPrimesUsed);
// printf(“numloops = %ld\n”, numloops);
// printf(“\n”);
}
if( 9999 == (numloops%10000) )
{
// printf(“number of steps: %ld\n”, numsteps);
}
if( 9999 == (numloops%10000) )
{
for(j=0; j< 200 ; j++)
{
// printf(“%ld “, ptr_exponents[j]);
}

// printf(“\n”);
}

if( 799999 == (numloops%800000) )
{
printf(“record_low_variation_delta = %.16Lf “, record_low_variation_delta);
printf(“record_low_log2n = %.16Lf\n\n”, record_low_log2n);
fflush(stdout);

record_low_variation_delta = (long double) 100;
record_low_log2n = (long double) 0;
}

RecordRobinQuotient = (long double) 0;
if(skip_base_case == 0)
{

base_tmp_now_n = (long double) 0;

base_tmp_now_sigma_r = (long double) 1;

now_step = (long) 0;

for(j=0; j<= list_steps[numsteps-2]; j++)
{
if(j == list_steps[now_step] )
{
now_step++;
}
else
{
base_tmp_now_n = base_tmp_now_n + ((long double)ptr_exponents[j])*splogs[j];
p = pts_primes[j];
power = (long) 1;
for(l=0; l<ptr_exponents[j]+((long)1); l++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));
ratio = ((long double)sigma)/((long double)powerb);
base_tmp_now_sigma_r = base_tmp_now_sigma_r*ratio;
}
}
}

sum_log_cofactor = sum_logs_primes;

prod_sigma_r_cofactor = prod_sigma_r;
sum_log_cofactor = sum_log_cofactor – theta[list_steps[numsteps-2]];

prod_sigma_r_cofactor = prod_sigma_r_cofactor/prod100k[list_steps[numsteps-2]];

for(m=0; m< numsteps ; m++)
{
current_step_number = m;

current_step = list_steps[m];

tmp_now_n = sum_log_cofactor + base_tmp_now_n;
tmp_now_sigma_r = base_tmp_now_sigma_r*prod_sigma_r_cofactor;
if(m < numsteps-((long)1) )
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
if(j == m)
{
tmp_exponent = ptr_exponents[list_steps[j]] + ((long)1);
}
else
{
tmp_exponent = ptr_exponents[list_steps[j]];
}
p = pts_primes[list_steps[j]];
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+((long)1) ); k++)
{
power = power*p;
}
powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((long double)sigma)/((long double)powerb);
tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}

tmp_now_quotient = tmp_now_sigma_r;

tmp_now_robin = tmp_now_quotient/expl(euler);

log2nprime = logl(tmp_now_n);

robin_bound = expl(euler)*log2nprime;

delta = robin_bound – tmp_now_quotient;

delta_log = logl(delta);

delta_estimate = constant – log2nprime/((long double) 2);

variation_delta = delta_log – delta_estimate;

if( variation_delta < record_low_variation_delta)
{
record_low_variation_delta = variation_delta;
record_low_log2n = log2nprime;
}

tmp_el_now_robin = tmp_now_robin/logl(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;

if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}
if( 9999 == (numloops%10000) )
{

// printf(“current step number = %ld “, current_step_number+1);

// printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

// printf(“record step is at: %ld\n”, RecordStep+1);

// printf(“log(log(n’)) = %.16Lf “, log2nprime);

// printf(“Robin upper bound = %.16Lf “, robin_bound);

// printf(“sigma(n’)/n’ = %.16Lf \n”, tmp_now_quotient);
}
}
else
{
for(j=0; j<= numsteps- ((long)2) ; j++)
{
tmp_exponent = ptr_exponents[list_steps[j]];

p = pts_primes[list_steps[j]];
if(list_steps[j] != 1)
{
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[list_steps[j]];
power = (long) 1;
for(k=0; k<(tmp_exponent+1); k++)
{
power = power*p;
}

powerb = power/p;
sigma = (power – ((long)1) )/(p – ((long)1));

ratio = ((long double)sigma)/((long double)powerb);

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}
else
{
tmp_now_n = tmp_now_n + ((long double)tmp_exponent)*splogs[1];
ratio = expl( puiss3sigmalogs[tmp_exponent]-(((long double)tmp_exponent)*splogs[1]) );

tmp_now_sigma_r = tmp_now_sigma_r*ratio;
}
}

tmp_now_n = tmp_now_n + logl((long double) ptr_primes[current_step- file_offset]);
ratio = ((long double)1)/( (long double)ptr_primes[current_step- file_offset] );

tmp_now_sigma_r = tmp_now_sigma_r + (ratio*tmp_now_sigma_r) ;

tmp_now_quotient = tmp_now_sigma_r;
tmp_now_robin = tmp_now_quotient/expl(euler);
log2nprime = logl(tmp_now_n);
robin_bound = expl(euler)*log2nprime;

delta = robin_bound – tmp_now_quotient;

delta_log = logl(delta);

delta_estimate = constant – log2nprime/((long double) 2);

variation_delta = delta_log – delta_estimate;

if( variation_delta < record_low_variation_delta)
{
record_low_variation_delta = variation_delta;
record_low_log2n = log2nprime;
}

tmp_el_now_robin = tmp_now_robin/logl(tmp_now_n);

tmp_now_robin = tmp_el_now_robin;
if(tmp_now_robin > RecordRobinQuotient)
{
RecordRobinQuotient = tmp_now_robin;
RecordStep = current_step;
}

if( 9999 == (numloops%10000) )
{
// printf(“current step number = %ld “, current_step_number+1);

// printf(“quotient de Robin: %.16Lf “, tmp_now_robin);

// printf(“record step is at: %ld\n”, RecordStep+1);

// printf(“log(log(n’)) = %.16Lf “, log2nprime);

// printf(“Robin upper bound = %.16Lf “, robin_bound);

// printf(“sigma(n’)/n’ = %.16Lf \n”, tmp_now_quotient);

}
}

}

if(RecordStep < numprimes)
{
ptr_exponents[RecordStep]++;
}
if(RecordStep == numprimes)
{

if(num_new_primes < 79999500)
{

for(j=0; j< 100 ; j++)
{

sum_logs_primes = sum_logs_primes + logl( (long double) ptr_primes[numprimes- file_offset]);

ratio = ((long double)1)/((long double)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
}
else
{

sum_logs_primes = sum_logs_primes + logl( (long double) ptr_primes[numprimes- file_offset]);

ratio = ((long double)1)/((long double)ptr_primes[numprimes-file_offset]);

if( RecordStep > 999999 )
{
numBigPrimesUsed++;
}

num_new_primes++;

prod_sigma_r = prod_sigma_r + (prod_sigma_r*ratio) ;

numprimes++;
}
skip_base_case = (int) 1;
}
else
{
skip_base_case = (int) 0;
}

if( 9999 == (numloops%10000) )
{
// printf(“=================================\n”);
}
}
}

fclose(in);
free(ptr_primes);
return 0;

}

Written by meditationatae

December 4, 2014 at 6:26 pm

About security problem

I know older versions of WordPress are vulnerable, as have discovered researchers, maybe in Finland.  I don’t know what version I have.  Therefore, since the method of attack is through comments, each comment must now be individually approved.

That’s until I figure out what version of WordPress is running here.

Written by meditationatae

November 25, 2014 at 3:07 pm

Posted in History

Elliptic curve cryptography-based PGP key, key-block for key number 9428E6EF:

—–BEGIN PGP PUBLIC KEY BLOCK—–
Version: GnuPG v2

mJMEVG4BCxMJKyQDAwIIAQENBAMENh8oNNx85+H241surEdY1yDpw18+lDc7qrZk
cuxZSn8KQn84iAtLDK2fxD9iX7USkQvTy32TLcoQUOhapY5VUR0RpORcTYzKjnT2
vN5bGLTEgXUrnf5cE7fnueX8VpeVjx1IiAhAOJrMSvXWto57XFoFxStMeKpbZd5G
bHXGOT60OERhdmlkIEJlcm5pZXIgKGRvdWJsZWRlY2tlcnBvdDcpIDxkYXZpZDI1
MEB2aWRlb3Ryb24uY2E+iLgEExMKACAFAlRuAQsCGwMFCwkIBwIGFQgJCgsCAxYC
AQIeAQIXgAAKCRDKBRXHlCjm7x+kAf4iEeC8CG9X3gGe0m/bPE7JO06/ppxdeJJH
hJojtILupblVD98WS9rYnvSzEPRrl2rlfknzfBrtT2irx68HEvedAf9hVWQyD4Bn
wdZe8WyFqwl0nrs13YSW06WkL/Lf37omA1kwTmR7D1klX1D9yenpXAAvlQ1G4E59
fcrC3AS4C8DOuJcEVG4BCxIJKyQDAwIIAQENBAMEXWzhWUrrk0iugRpFoM7rczEt
4oHYLxanjjtP6e2oqYihZzLQC3HXRfAZ3JsKF8bIcb7tPet9FHKcElb3fsSA1QqA
xQ7yYJgONEhSDweIXCfgXyR8baP7ZnkiyuorsMjXZ3Ztkq70U/+dXqWVk5bBfzZB
U8OgfCOPls74f1fiw10DAQoJiKEEGBMKAAkFAlRuAQsCGwwACgkQygUVx5Qo5u+A
EQH/e3D0ZfIsebYlQac5CPfzOZ8SjgHTc9rUqX0+hE3C9TBKVSsjP8eFkzGrYZLi
6fXRbx0d7i0upBx6s/ZABhHWtAH/UD+z2LgUi3NvMqlzE4ajhvyqlYCWqrxulveU
PiN+JUnzXdScCrbt7odpNZpYyitXTO7i3SDsWtmID9rfzjTXTw==
=pvTe
—–END PGP PUBLIC KEY BLOCK—–

Written by meditationatae

November 20, 2014 at 3:33 pm

Posted in History

Keeping Web site passwords in text files

On my Linux Box, I use the Firefox browser with a Master Password. Once I enter my Master Password, I can access all the saved passwords and user names for Web sites I visit. The Master Password is a good feature of Firefox. However, if one forgets the Master Password or if Firefox becomes broken, then all is lost.

Last week, on my Linux Box, I was able to run in a non-GUI environment, but I could not start the GUI of the GNOME Desktop. As a result, I couldn’t use Firefox. So I did a small installation of Linux CentOS 6.5 on a spare hard drive, and mounted the “old” hard drive. That way, I could access my Web passwords and usernames which I had saved in files within folders of my home directory.

Now, Firefox runs from the “new” disk, but I used the “old” disk to get the Web site passwords and user names.  Also, I choose my passwords carefully and they are generated with the help of “random” characters and edited in a text editor. Then, they are saved as a text file, typically “pass”.

There is a directory WordPress, one called Twitter, one called Yahoo and so on. Each directory has its file, typically “pass”, with the password for the respective Web site.

I find it convenient to safeguard my web site passwords both in text files, and within the Firefox browser, protected by the Firefox Master Password.

Written by meditationatae

October 20, 2014 at 10:59 am

Posted in History

secret 2

+++++BEGIN PGP MESSAGE+++++
Version: GnuPG v2.0.14 (GNU/Linux)

hQEMAx731Kn0XZs4AQgAuaGMI7VD1US9gxNNdlAqQ/ziST0qNaBwcd9G9NDw4nE/
AKmy7OPHSiLU6okVpW5A4QOibUfYptcI/nRNV7IxAQlgRXsSlIZ12O5r8YGKxSbQ
WXijaWlB1iMjU7VvH4m1rk6nxYfh9NjfAK27g4mw3NOt5DpZrCPR054fHZ2UbD/C
J4Hf8EzuIJYavyz+zcF8lFFv6/j5t3GqnfipSh1kSqJdBpvq4zJTQggPLo6iuAsT
I9QElFzHPf7qSAq+Vb0Pkf2JHBbkCZrClYCc/rTg1i1NqMm7p5P4EBIWFaI2GRYX
91aiB656x4RbBKb4N0dLD8Dr/yC/8GrOGJonB+BoLNLpAf8droRksM7kvWWYIM56
EdvCKayDl3/xyFTNfJ8TtV0FGiziHhzefS1YcbvaEG/2C7+MyJIFua0aA0mPiXeh
u9S3Psyv2FoAojjJpfM2IYd4X00Ml3AFVwqtTETwcI8NU1Zx/H9xEmOK6GZU5uB2
LEkCDA3C3rlaCQsRGcE3PzhkJqRJJDViBCI6kPvk8wQZpqoSHUgs3DC37lBfuFuN
2XUTroZqJJIB7mEjhk5MkUaoOQX88Y9GzjUOhRy7weiaa0lg3qmUn5BkEul9++59
dXy5dyZHkz9Fl17bCZ/mDTn/pVz+bjn52JHQgLdGa+BhNzaYydSig6fwfiE/IpNx
uUyiEOOA+kA6lv2S2prkHpI8IVLXwegGPqVe/s6/NPXMTkfodEwWXc9dsRwHz4HO
j+xaAmr5a97DjI6F8WuAOX9xHrsqBD2Yeb38FdguT4GaH1DcYX8Bk6VQ4PYy4B9a
pWDxn2dEKF8vAEjLhHbv0tktMUxAFWjTJoPVKumr0ypDt/EjsUvf/EMYadMOQeXu
qoQM1upc31FgQK9is01JzVBj6uTN1kzOYRf+BNxVCwwiVoZCW/mONZhHjT1iLc9/
uw0h+wm25rzpXJcqifJXR8SBkFkTnsC986yFgfADGUl3L1CLAAWsl7ZpNIGNryxP
bsS8sdXnOkuerZhLrpoxltXBAMX9ku3IsvQ4aEqqLIbXeiZGo1Us5hrzmZJ3zxX9
/2cjSqHoVe4MDk20qbgowYFKrmM/eae+0IOID0s43p3xqWBWX0mfW5twiViLDn3u
XfgGwVIczA/+wnXddLi592U7NywcMmxCbcnFMTG8/w8p5vwflbC4jQtq85+MbfUG
AiPZF9E0HgafnU04N46F8bqOfLPyBAWTi5VmRv6aeebcnniOIe0PIReI1zWaW/96
cHAiE0bc/6JfKMRio5q67pnuSmhz2ArDfjO+8lFDkXQ6Ae9TmsuMetU9/b+NtnsH
Tpuj4s0AqIFXBRtUzxuMpahyJY7Qz6YA2Bul9BY3cpQi131w9qYrWvgq49fpRedt
y3ZQ6i5y/HNELOTt4I62ylboMv6Mv4vbynvji18fyJEZFHaio0K9UsIqvcPXo0UX
2AMG5K53PN0wzUco+oKHvIe+DvmqCIsyj2ssLsl/3liOZrlV3xLtjJm8Jflb/P+e
x5El1ABT0dYidfULjQTPW6ZgTQwgVD4GnM95YAwVIHD2Z6buJ59HmwELmKnHGO0u
Mosn4pXlU8Y5VCZ2TLe4nIrOCIpICaEKomSO7ZX5ctiY/mg=
=vT0q
+++++END PGP MESSAGE+++++

Written by meditationatae

October 1, 2014 at 5:52 am

Posted in History

secret

—–BEGIN PGP MESSAGE—–
Version: GnuPG v2.0.14 (GNU/Linux)

hQEMAx731Kn0XZs4AQgAuaGMI7VD1US9gxNNdlAqQ/ziST0qNaBwcd9G9NDw4nE/
AKmy7OPHSiLU6okVpW5A4QOibUfYptcI/nRNV7IxAQlgRXsSlIZ12O5r8YGKxSbQ
WXijaWlB1iMjU7VvH4m1rk6nxYfh9NjfAK27g4mw3NOt5DpZrCPR054fHZ2UbD/C
J4Hf8EzuIJYavyz+zcF8lFFv6/j5t3GqnfipSh1kSqJdBpvq4zJTQggPLo6iuAsT
I9QElFzHPf7qSAq+Vb0Pkf2JHBbkCZrClYCc/rTg1i1NqMm7p5P4EBIWFaI2GRYX
91aiB656x4RbBKb4N0dLD8Dr/yC/8GrOGJonB+BoLNLpAf8droRksM7kvWWYIM56
EdvCKayDl3/xyFTNfJ8TtV0FGiziHhzefS1YcbvaEG/2C7+MyJIFua0aA0mPiXeh
u9S3Psyv2FoAojjJpfM2IYd4X00Ml3AFVwqtTETwcI8NU1Zx/H9xEmOK6GZU5uB2
LEkCDA3C3rlaCQsRGcE3PzhkJqRJJDViBCI6kPvk8wQZpqoSHUgs3DC37lBfuFuN
2XUTroZqJJIB7mEjhk5MkUaoOQX88Y9GzjUOhRy7weiaa0lg3qmUn5BkEul9++59
dXy5dyZHkz9Fl17bCZ/mDTn/pVz+bjn52JHQgLdGa+BhNzaYydSig6fwfiE/IpNx
uUyiEOOA+kA6lv2S2prkHpI8IVLXwegGPqVe/s6/NPXMTkfodEwWXc9dsRwHz4HO
j+xaAmr5a97DjI6F8WuAOX9xHrsqBD2Yeb38FdguT4GaH1DcYX8Bk6VQ4PYy4B9a
pWDxn2dEKF8vAEjLhHbv0tktMUxAFWjTJoPVKumr0ypDt/EjsUvf/EMYadMOQeXu
qoQM1upc31FgQK9is01JzVBj6uTN1kzOYRf+BNxVCwwiVoZCW/mONZhHjT1iLc9/
uw0h+wm25rzpXJcqifJXR8SBkFkTnsC986yFgfADGUl3L1CLAAWsl7ZpNIGNryxP
bsS8sdXnOkuerZhLrpoxltXBAMX9ku3IsvQ4aEqqLIbXeiZGo1Us5hrzmZJ3zxX9
/2cjSqHoVe4MDk20qbgowYFKrmM/eae+0IOID0s43p3xqWBWX0mfW5twiViLDn3u
XfgGwVIczA/+wnXddLi592U7NywcMmxCbcnFMTG8/w8p5vwflbC4jQtq85+MbfUG
AiPZF9E0HgafnU04N46F8bqOfLPyBAWTi5VmRv6aeebcnniOIe0PIReI1zWaW/96
cHAiE0bc/6JfKMRio5q67pnuSmhz2ArDfjO+8lFDkXQ6Ae9TmsuMetU9/b+NtnsH
Tpuj4s0AqIFXBRtUzxuMpahyJY7Qz6YA2Bul9BY3cpQi131w9qYrWvgq49fpRedt
y3ZQ6i5y/HNELOTt4I62ylboMv6Mv4vbynvji18fyJEZFHaio0K9UsIqvcPXo0UX
2AMG5K53PN0wzUco+oKHvIe+DvmqCIsyj2ssLsl/3liOZrlV3xLtjJm8Jflb/P+e
x5El1ABT0dYidfULjQTPW6ZgTQwgVD4GnM95YAwVIHD2Z6buJ59HmwELmKnHGO0u
Mosn4pXlU8Y5VCZ2TLe4nIrOCIpICaEKomSO7ZX5ctiY/mg=
=vT0q
—–END PGP MESSAGE—–

Written by meditationatae

October 1, 2014 at 5:26 am

Posted in History

Follow

Get every new post delivered to your Inbox.