May I make you read this? Is it the right place?
Paul.Zimmermann at inria.fr
Mon May 13 15:22:19 UTC 2019
since your program was not attached, it is difficult to help you.
Most probably the error comes from your side, I would guess in the
integer to/from floating-point numbers, since it seems you are using
Also notice that GMP has some limitations in the size of numbers it can deal
> From: Thomas Brouard <thomasbrouard at laposte.net>
> Date: Mon, 13 May 2019 15:49:04 +0200
> 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.
> gmp-discuss mailing list
> gmp-discuss at gmplib.org
More information about the gmp-discuss