May I make you read this? Is it the right place?

Thomas Brouard thomasbrouard at
Mon May 13 13:49:04 UTC 2019

Hello everyone,

I am wondering why my c++ program using GMP is not functioning well.
I don’t think it is a bug, so I may submit my problem here. Correct me if necessary about that please.

My program aims to calculate a bigger Mills’ constant (1.306…) by adding more and more decimal digits to it. Assuming Riemann hypothesis, the Mills’ constant is supposed to make prime numbers this way: if A is the constant, then for any integer n, the integer part of A^(3^n) is a prime number. I calculate more decimal digits of the Mills’ constant by calculating the 3^nth root of the last calculated prime, thanks to the nth root Newton algorithm. Once there is enough decimal digits in A, we can try to calculate a big prime number. And then add decimal digits to A. It is cyclic.I did this until I got A^(3^19).

And this is where the problem is. I wanted to use A^(3^19) to add more digits to the Mills’ constant but what I get as a result from the 3^nth root algorithm begins like that: 1306... The comma disappears! So, A changes from its first digits ! And is no more a constant !

What happens in the nth root Newton algorithm that breaks the cycle?  I join to this mail the algorithm, and the c++ program to calculate primes. I tried to change the mpf_set_default_prec, but no change to the situation.
Any, even small, answer, is welcome.  


More information about the gmp-discuss mailing list