Overflow using signed 64-bit long integers with superabun3642a.c . Using the PARI-gp calculator, one finds: ? p = prime(155632) 2097479 ? sigma(p^2) 4399420252921 Correct ? p^2+p+1 4399420252921 Correct, equal to sigma(p*p) ? (p^3-1)/(p-1) 4399420252921 Correct, equal to sigma(p*p) ? p^3-1 9227687193256233238 Correct value of p^3 -1 ? 2^63 9223372036854775808 Is less than p^3 -1 And… Continue reading Overflow problem with C abundant numbers program, using 64-bit integers
Month: December 2014
updated C program for highly abundant numbers
/************************************************************** version superabun3642a.c an incorrect “%.30Lf” printf format string was replaced by: “%.30Qf”, needed for floating point __float128 types $ date Tue Dec 23 05:47:05 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… Continue reading updated C program for highly abundant numbers
testing Erdos-Alaoglu formula, 1944
p = 1919563670117 ? epsilon=log(1+1/p)/log(p) %3412 = 1.841917512375253387582800136632078607012932929350472081631215817120\ 0850387536075366360000346413577752892872978581781089040610273407756640119093\ 566970912124987390341597763792633875533561968232945742411 E-14 ? (p^(1+epsilon) -1)/(p^epsilon-1)-p^2 %3413 = -2.0632267959132986417 E-188 so, (p^(1+epsilon) -1)/(p^epsilon-1) is very nearly p^2 . In: On highly composite and similar numbers from: http://www.renyi.hu/~p_erdos/1944-03.pdf Theorem 10, page 455, with q=1919563670117 , epsilon as above, (q^(1+epsilon) -1)/(q^epsilon-1) is very nearly q^2, from which log{ (q^(1+epsilon)… Continue reading testing Erdos-Alaoglu formula, 1944
memo on program output, december 23, 4:31 am
the program /home/david2/eratosthenes4/superabun3642a.out is working fine. compilation command with gcc (GCC) 4.9.2 : $ /usr/local/bin/gcc -lquadmath -O2 -o superabun3642a.out superabun3642a.c GCC’s libquadmath 128-bit floats math library is used. Command line for execution: $ ./superabun3642a.out > output3642 & Many of most numbers produced are colossally abundant numbers, as verified by exponent calculations using the Erdos-Alaoglu critical… Continue reading memo on program output, december 23, 4:31 am
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… Continue reading Updated source code for superabundant numbers
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;… Continue reading Source code for superabundant numbers computation program in C