CComputer experimentswith Mersenne primes
Marek Wolf
Cardinal Stefan Wyszynski UniversityDepartment of Mathematics and Sciencesul. W´oycickiego 1/3, Auditorium Maximum, (room 113)PL-01-938 Warsaw, Polande-mail: [email protected]
Abstract
We have calculated on the computer the sum B M of reciprocals of all47 known Mersenne primes with the accuracy of over 12000000 decimaldigits. Next we developed B M into the continued fraction and calcu-lated geometrical means of the partial denominators of the continuedfraction expansion of B M . We get values converging to the Khinchin’sconstant. Next we calculated the n -th square roots of the denominatorsof the n -th convergents of these continued fractions obtaining values ap-proaching the Khinchin-L`evy constant. These two results suggests thatthe sum of reciprocals of all Mersenne primes is irrational, supportingthe common believe that there is an infinity of the Mersenne primes. Forcomparison we have done the same procedures with slightly modifiedset of 47 numbers obtaining quite different results. Next we investigatedthe continued fraction whose partial quotients are Mersenne primes andwe argue that it should be transcendental. a r X i v : . [ m a t h . N T ] D ec The Mersenne primes M n are primes of the form 2 p − p must be a prime, see e.g. [18,Sect. 2.VII]. The set of Mersenne primes starts with M = 2 − , M = 2 − , M = 2 − M = 2 − . . . . × . In general the largest known primes arethe Mersenne primes, as the Lucas–Lehmer primality test applicable only to numbers of theform 2 p − p steps, thus the complexity of checking primality of M n is O (log( M n )). Let us remark that algorithm of Agrawal, Kayal and Saxena (AKS) for arbitraryprime p works in about O (log . ( p )) steps and modification by Lenstra and Pomerance hascomplexity O (log ( p )).There is no proof of the infinitude of M n , but a common belief is that as there are pre-sumedly infinitely many even perfect numbers thus there is also an infinity of Mersenne primes.S. S. Wagstaff Jr. in [26] (see also [21, § M n grow doublyexponentially: log log M n ∼ ne − γ , (1)where γ = 0 . . . . is the Euler–Mascheroni constant. In the Fig. 1 we compare theWagstaff conjecture with all 47 presently known Mersenne primes M n . Of these 47 known M n = 2 p − p mod 4 = 1 and 19 with p mod 4 = 3. It is in opposite to theset of all primes where the phenomenon of Chebyshev bias is known: for initial primes thereare more primes p ≡ p ≡ B M = (cid:80) n / M n ; if there is infinity of Mersenne primes then this number B M should beirrational (at least, because it is probably even transcendental, as it is difficult to imagine thepolynomial with some mysterious integer coefficients whose one of roots should be B M ).There exists a method based on the continued fraction expansion which allows to detectwhether a given number r can be irrational or not. Let r = [ a ( r ); a ( r ) , a ( r ) , a ( r ) , . . . ] = a ( r ) + 1 a ( r ) + 1 a ( r ) + 1 a ( r ) + . . . (2)be the continued fraction expansion of the real number r , where a ( r ) is an integer and all a k ( r )with k ≥ a k ( r ) are called partial quotients or the partialdenominators. Khinchin has proved [13], see also [20], thatlim n →∞ (cid:0) a ( r ) . . . a n ( r ) (cid:1) n = ∞ (cid:89) m =1 (cid:26) m ( m + 2) (cid:27) log m ≡ K ≈ . r [8, § a is skipped in (3)). The exceptions are ofthe Lebesgue measure zero and include rational numbers , quadratic irrationals and some irra-tional numbers too, like for example the Euler constant e = lim n →∞ (1 + n ) n = 2 . . . . for which the n -th geometrical mean tends to infinity like √ n , see [10, § K is called the Khinchin constant. If the sequence K ( r ; n ) = (cid:0) a ( r ) a ( r ) . . . a n ( r ) (cid:1) n (4)for a given number r tend to K for n → ∞ we can regard it as an indication that r is irrational —all rational numbers have finite number of partial quotients in the continued fraction expansionand hence starting with some n for all n > n will be a n = 0. It seems to be possible toconstruct a sequence of rational numbers such that the geometrical means of partial quotientsof their continued fraction will tend to the Khinchin constant.The Khinchin—L`evy’s constant arises in the following way: Let the rational P n ( r ) /Q n ( r )be the n -th partial convergent of the continued fraction of r : P n ( r ) Q n ( r ) = [ a ( r ); a ( r ) , a ( r ) , a ( r ) , . . . , a n ( r )] . (5)In 1935 Khinchin [12] has proved that for almost all real numbers r the denominators of thefinite continued fraction approximations fulfill:lim n →∞ (cid:0) Q n ( r ) (cid:1) /n ≡ lim n →∞ ( L ( r ; n ) = L (6)and in 1936 Paul Levy [14] found an explicit expression for this constant L :lim n →∞ n (cid:112) Q n ( r ) = e π /
12 log(2) ≡ L = 3 . . . . (7) L is called the Khinchin—L`evy’s constant [8, § Let us define the sum of reciprocals of all Mersenne primes: B M = ∞ (cid:88) n =1 M n , (8)which can regarded as the analog of the Brun’s constant, i.e. the sum of reciprocals of all twinprimes: B = (cid:18)
13 + 15 (cid:19) + (cid:18)
15 + 17 (cid:19) + (cid:18)
111 + 113 (cid:19) + . . . . (9)In 1919 Brun [5] has shown that this constant B is finite, thus leaving the problem of infinityof twin primes not decided. Today’s best numerical value is B ≈ . B M with accuracy over 12 millions digits: B M = 0 . . . . . (10)This number is not recognized by the Symbolic Inverse Calculator (http://pi.lacim.uqam.ca)maintained by Simone Plouffe. The bar over B M denotes the finite (at present consisting of 47terms) approximation to the full sum defined in (8). It is not known, whether there are Mersenneprime numbers with exponent 20996011 < p < − M — it is not known whether any undiscoveredMersenne primes exist between the 40th M and the 47th Mersenne prime M . We have taken12000035 digits of B M — it means that we assume that there are no unknown Mersenne primeswith p < ContinuedFraction[ · ] implementedin Mathematica c (cid:13) we calculated the continued fraction expansion of B M . The result was builtfrom 11645012 partial denominators a = 1 , a = 1 , a = 14 , . . . , a = 4. The n -thconvergent P n ( r ) /Q n ( r ), see (5), approximate the value of r with accuracy at least 1 /Q k Q k +1 [13, Theorem 9, p.9]: (cid:12)(cid:12)(cid:12)(cid:12) r − P k Q k (cid:12)(cid:12)(cid:12)(cid:12) < Q k Q k +1 < Q k a k +1 < Q k . (11)From this it follows that if r is known with precision of d decimal digits we can continue withcalculation of quotients a n up to such n that the denominator of the n-th convergent Q n < d .We have checked that Q = 4 . × .The largest denominator was a = 716699617. We have checked correctness of thecontinued fraction expansion of B M by calculating backwards from [0; 1 , , , . . . ,
4] the partialconvergent. The Mathematica c (cid:13) has build in the procedure FromContinuedFraction[ · ] , butwe have used our own procedure written in PARI and implementing the recurrence: P n +1 = a n P n + P n − , Q n +1 = a n Q n + Q n − , n ≥ P = a , Q = 1 , P = a a + 1 , Q = a . (13)We have obtained the ratio of two mutually prime 6000018 decimal digits long integers (itmeans denominator was of the order 10 and hence its square was smaller than 10 ,see eq.(11)): 6000018 digits (cid:122) (cid:125)(cid:124) (cid:123) . . . . . . B M . The decimal expansion of B M = P/Q is ofcourse periodic (recurring), see [9, Th. 135], but the length of the period is much larger than1 . × . According to the Theorem 135 from [9] the period r of the decimal expansion of B M is equal to the order of 10 mod Q , i.e. it is the smallest positive r for which10 r ≡
1( mod Q ) . (14)Because Q being the product of all 47 Mersenne primes is of the order 3 . . . . × , weexpect that the value of r is much larger than 10 . Another argument is that we got over 11500 000 partial quotients of the continued fraction of B M — the numbers with periodic decimalexpansions have only finite number of partial quotients different from zero.From the sequence of partial quotients a = 1 , a = 1 , a = 14 , . . . , a = 4 we havecalculated running geometrical means K ( n ) = (cid:32) n (cid:89) k =1 a k (cid:33) /n (15)for n = 11 , . . . , K ( n ) quickly tend to the Khinchine constantthus in Fig. 2 we have plotted the differences | K ( n ) − K | . The power fit to the values for n = 1000 . . . | K ( n ) − K | ∼ n − . and it suggests thatindeed lim n →∞ K ( n ) = K and thus B M is irrational. Indices n for which the geometric means K ( n ) produce progressively better approximations to Khinchin’s constant are:1 , , , , , , , , , , , , , , . . . , , | K ( n ) − K | was 4 . . . . × − . This sequence can be regarded asthe counterpart to the A048613 at OEIS.org.Next we calculated running (i.e. for n = 11 , . . . , P n /Q n andthen the quantities L ( n ) = n √ Q n , which for almost all irrational numbers should tend to theKhinchine–Levy constant. The behaviour of n √ Q n is shown in Fig.3. Again we see that thesequantities tend to the limit L ; the fitting of the power–like dependence for n >
10 gives that | L ( n ) − L | ≈ . n − . . The shape of the plot in this figure is similar to the plot of | K ( n ) − K | in Fig. 2.Both differences K ( n ) − K and L ( n ) − L have a lot sign changes for n < B M is irrational and hencethat there is infinity of Mersenne primes. But we are convinced B M is in fact transcendental .In favor of this claim we recall here the result of A. J. van der Poorten and J. Shallit [25] thatthe following sum 12 + 12 + 12 + 12 + . . . + 12 F n + . . . (17)where F n are Fibonacci numbers, is transcendental. It is well known that the Liouville number12 + 12 + 12 + 12 + · · · + 12 n ! + . . . (18)is transcendental see [9, Theorem 192]. In B M , assuming the Wagstaff conjecture, unfortunatelythe terms decrease slower: n ! > n > e − γ n for n ≥ F n = (cid:22) ϕ n √ + (cid:23) , where ϕ = √ ≈ . . . . .Let ψ n ( m ) denotes the number of partial quotients a k with k = 1 , , . . . , n which are equalto m : ψ n ( m ) = (cid:93) { k : k ≤ n and a k = m } . Then the Gauss–Kuzmin theorem (for excellent exposition see e.g. [10, § n →∞ ψ n ( m ) n = log (cid:16) m ( m +2) (cid:17) log(2) (19)for continued fractions of almost all real numbers. In other words, the probability to find thepartial quotient a k = m is equal to log (1 + 1 /m ( m + 2)). In Fig. 6 we present the plot ofthe ψ ( m )11645013 for the continued fraction of B M and m = 1 , , . . . B M computed with 12000035 digits is normal in thebase 10, see Table I. TABLE I Illustration of the normality of B M : the numbers in second row gives the number of digits0 , , . . . B M and the third row contains the ratio ofnumbers in second row divided by 12000035.0 1 2 3 41200553 1199322 1199420 1200548 11993970.1000458 0.0999432 0.0999514 0.1000454 0.09994955 6 7 8 91198596 1200876 1200056 1201757 11995100.0998827 0.1000727 0.1000044 0.1001461 0.0999589For comparison we have repeated the above procedure for artificial set of 47 numbers ofthe size corresponding to known Mersenne primes. We have simply skipped -1 in the Mersenneprimes and using PARI we have computed with over 120000000 digits the sum: S = 12 + 12 + . . . + 12 + 12 This number S is the ratio of the form A/ , where gcd( A, § S has terminating decimal expansion consisting of 43112609 decimaldigits, thus calculating 12000000 digits of this sum makes sens as it does not contain recurringperiodic patterns of digits. We have developed S into the continued fraction, what resulted in10550114 partial quotients. The calculated quantities for this case we denote with the subscript2: Q ( n ) , K ( n ) , L ( n ) to distinguish them from earlier experiment for B M . We have calculatedthe running geometrical averages of the partial quotients K ( n ) and the results are presented inFigure 7. Next we calculated 10550114 partial convergents P ( n ) /Q ( n ) , n = 1 , , . . . , L ( n ) ≡ ( Q ( n )) /n , which should tend to the Levy constant L .In Figure 8 the differences | L ( n ) − L | are plotted. Obtained plots are completely differentfrom those seen in Figures 2 and 3 and they suggest K ( n ) as well as L ( n ) do not have thelimit. In this artificial case we have encountered the phenomenon of extremely large partialdenominators: there were a n of the order 10 , and 10 . These large partialdenominators are responsible for the smaller number of a k than for B M , see (11). Let us define the supposedly infinite and convergent continued fraction u M by taking a n = M n : u M = [0; 3 , , , , , , , , . . . ] (20)Using all 47 Mersenne primes 3 , , , . . . , − u M with the precision of 10000000 digits; first 50 digits of u M are: u M = 0 . . . . (21)This number is not recognized by the Symbolic Inverse Calculator (http://pi.lacim.uqam.ca).Because 1 /Q ( u M ) ≈ . × − it follows from (11) that theoretically it is possibleto obtain the value of u M from presently known 47 Mersenne primes with over 170,000,000decimal digits of accuracy. Of course u M is the exception to the Khinchin and Levy Theoremsin view of the very fast growth of u M — see the Wagstaff [26] conjecture (1).There is a vast literature concerning the transcendentality of continued fractions. For ex-ample the continued fraction [0; 2 , , , . . . , n ! , . . . ] (22)is transcendental, see [9, Theorem 192], [23, Example 4].The Theorem of H. Davenport and K.F. Roth [7] states, that if the denominators Q n ofconvergents of the continued fraction r = [ a ; a , a , . . . ] fulfilllim sup n (cid:112) log( n ) log(log( Q n ( r ))) n = ∞ (23)then r is transcendental. This theorem requires for the transcendence of r very fast increase ofdenominators of the convergents: at least doubly exponential growth is required for (23). Theset of continued fractions which can satisfy the Theorem of H. Davenport and K.F. Roth is ofmeasure zero, as it follows from the Theorem 31 from the Khinchin’s book [13], which assertsthere exists an absolute constant B such that for almost all real numbers r and sufficientlylarge n the denominators of its continued fractions satisfy: Q n ( r ) < e Bn . (24)The paper of A. Baker [4] from 1962 contains a few theorems on the transcendentality ofMaillet type continued fractions [15], i. e. continued fractions with bounded partial quotientswhich have transcencendental values. Besides Maillet continued fractions there are some spe-cific families of other continued fractions of which it is known that they are transcendental.In the papers [17], [2] it was proved that the Thue–Morse continued fractions with boundedpartial quotients are transcendental. Quite recently there appeared the preprint [6] where thetranscendence of the Rosen continued fractions was established. For more examples see [3].In the paper [1] B. Adamczewski and Y. Bugeaud, among others, have improved (23) to theform: If lim sup n log(log( Q n ( r ))) n / log( n ) / log(log( n )) = ∞ (25)then r is transcendental.Assuming the Wagstaff conjecture M n ∼ ne − γ mentioned in the Introduction we obtainthat for large n Q n > c ( n +1) e − γ , c = 12 e − γ − . . . . (26)and thus the transcendence of u M will follow from the Davenport–Roth Theorem (23): (cid:112) log( n ) log(log( Q n ( r ))) n ∼ (cid:112) log( n ) → ∞ . (27)We illustrate the inequality (26) in Figure 9 — the values of labels on the y –axis give an idea ofthe order of the fast grow of Q n ( u M ): the largest for n = 47 is of the order Q = e . ... × =2 . . . . × , see also Table II. TABLE II A sample of values of inverses of the squares of the n -th convergents of u M giving an idea ofthe speed of convergence of [0; M , M , . . . , M n ] to u M . n /Q n . × − . × − . × − . × − . × − . × − . × − ... ...17 9 . × −
18 1 . × −
19 3 . × −
20 4 . × − ... ...40 4 . × −
41 5 . × −
42 3 . × −
43 3 . × −
44 2 . × −
45 5 . × −
46 1 . × −
47 1 . × − One of the transcendence criterion is the Thue-Siegel-Roth Theorem, which we recall herein the following form:
Thue-Siegel-Roth Theorem : If there exist such (cid:15) > infinitely many fractions A n /B n the inequality (cid:12)(cid:12)(cid:12)(cid:12) r − A n B n (cid:12)(cid:12)(cid:12)(cid:12) < B (cid:15)n , n = 1 , , , ..., (28)holds, then r is transcendental.Let us stress, that (cid:15) here does not depend on n — it has to be the same for all fractions A n /B n . We can test the criterion (28) for u M using as the rational approximations A n /B n theconvergents P n /Q n of the continued fraction (20).In [23] J. Sondow has given the estimation for (cid:15) appearing in r.h.s.of (28); namely he provedthat for irrational numbers with continued fraction expansion [ a ; a , a , . . . ] and convergents P n /Q n : (cid:15) ≤ lim sup n →∞ log a n +1 log Q n . (29)Let us denote δ ≡ (cid:15) . From the Wagstaff conjecture we obtain that the exponent δ of B δ appearing in on the r.h.s. of (28) should be of the order δ ≈ e − γ − . . . . (i . e . (cid:15) ≈ . . . . ) (30)implying transcendence of u M . In Fig.10 we present actual values of δ ( u M ; n ) = − log | u M − P n /Q n | / log( Q n ) for n = 3 , , . . . ,
45 and indeed the values oscillate around 1+2 e − γ = 2 . . . . .First we have calculated u M using all 47 Mersenne primes with accuracy 140000000 digits andfor n = 3 , , . . . ,
45 we have calculated convergents P n /Q n and next the differences | u M − P n /Q n | with accuracy 1 /Q n (see Table II), from which we determined the δ ( u M ; n ). The arithmeticaverage of 43 values δ ( u M ; n ) is 2 . . . . , quite close to the estimated value (30). It tooka few months of CPU time to collect data presented in Fig. 10: It took 12 days of CPUtime on the AMD Opteron 2700 MHz processor to collect data for n ≤
40; the point n = 40needed precision of almost 40,000,000 digits, as | u M − P /Q | = 1 . × − , while1 /Q = 4 . . . . × − . To calculate the difference | u M − P n /Q n | for n = 41 , ,
43 theprecision of 100000000 digits was needed. For n = 44 and n = 45 the difference | u M − P n /Q n | was calculated with the precision 130000000 digits (see Table II for n = 44 and n = 45) and ittook about one month of CPU time for each point. References [1] B. Adamczewski and Y. Bugeaud. On the Maillet-Baker continued fractions.
Journal f¨urdie reine und angewandte Mathematik , 606:105–121, 2007.[2] B. Adamczewski and Y. Bugeaud. A short proof of the transcendence of thue-morsecontinued fractions.
American Mathematical Monthly , 114:536–540, 2007.[3] B. Adamczewski, Y. Bugeaud, and L. Davison. Continued fractions and transcendentalnumbers.
Ann. Inst. Fourier , 56:2093–2113, 2006.[4] A. Baker. Continued fractions of transcendental numbers.
Mathematika , 9:1–8, 1062.[5] V. Brun. La serie 1/5 + 1/7 +... est convergente ou finie.
Bull. Sci.Math. , 43:124–128,1919.[6] Y. Bugeaud, P. Hubert, and T. A. Schmidt. Transcendence with Rosen continued fractions.
ArXiv e-prints, math.NT/1007.2050 , Jul 2010.[7] H. Davenport and K. F. Roth. Rational approximations to algebraic numbers.
Mathe-matika , 2:160–167, 1955.[8] S. Finch.
Mathematical Constants . Cambridge University Press, 2003.0[9] G. H. Hardy and E. M. Wright.
An Introduction to the Theory of Numbers . Oxford SciencePublications, 1980.[10] J. Havil.
Gamma: Exploring Euler’s Constant . Princeton University Press, Princeton, NJ,2003.[11] J. Kaczorowski. The boundary values of generalized Dirichlet series and a problem ofChebyshev.
Asterisque , 209:227–235, 1992.[12] A. Y. Khinchin. Zur metrischen kettenbruchtheorie.
Compositio Mathematica , 3:275–286,1936.[13] A. Y. Khinchin.
Continued Fractions . Dover Publications, New York, 1997.[14] P. L´evy. Sur le dveloppement en fraction continue d’un nombre choisi au hasard.
Compo-sitio Mathematica , 3:286–303, 1936.[15] E. Maillet.
Introduction ´a la th´eorie des nombres transcendants et des propri´et´esarithm´etiques des fonctions . Gauthier-Villars, Paris, 1906.[16] T. Nicely. Enumeration to 1 . × of the twin primes and Brun’s constant. .[17] M. Queff´elec. Transcendance des fractions continues de thue-morse. Journal of NumberTheor , 73:201–211, 1998.[18] P. Ribenboim.
The Little Book of Big Primes . 2ed., Springer, 2004.[19] M. Rubinstein and P. Sarnak. Chebyshevs bias.
Experimental Mathematics , 3:173–197,1994.[20] C. Ryll-Nardzewski. On the ergodic theorems II (Ergodic theory of continued fractions).
Studia Mathematica , 12:74–79, 1951.[21] M. R. Schroeder.
Number Theory In Science And Communication, With Applications InCryptography, Physics, Digital Information, Computing, And Self-Similarity . Springer-Verlag New York, Inc, 2006.[22] P. Sebah. [email protected] mailing list, post dated 22 Aug 2002. see alsohttp://numbers.computation.free.fr/Constants/Primes/twin.pdf.[23] J. Sondow. Irrationality measures, irrationality bases, and a theorem of jarnik. http://arxiv.org/abs/math.NT/0406300 , 2004.[24] The PARI Group, Bordeaux.
PARI/GP, version , 2008. available from http://pari.math.u-bordeaux.fr/ .[25] A. van der Poorten and J. Shallit. A specialised continued fraction.
Canad. J. Math. ,45(5):1067–1079, 1993.1[26] S. S. Wagstaff Jr. Divisors of mersenne numbers.
Mathematics of Computation ,40(161):385–397, 1983.[27] M. Wolf. Remark on the irrationality of the Brun’s constant.
ArXiv: math.NT/1002.4174 ,Feb. 2010.2Figure 1: The plot of log log( M n ) and the Wagstaff conjecture (1). The fit was made to allknown M n and it is 0 . n + 0 . ne − γ log(2) − log log(2) ≈ . n + 0 . M n ) and (1) is seeming, as to get original M n ’s the errorsare amplified to huge values by double exponentiation.3Figure 2: The plot showing the distance to K of the running geometrical averages K ( n ) =( a a · · · a n ) /n for the continued fraction of B M .4Figure 3: The plot showing the distance to L of the ( Q ( n )) /n obtained from the partialconvergents of the continued fraction of B M for n = 11 , . . . , K ( n ) in black approaching the Khinchine constant K = 2 . . . . (inred) with values presented on left y -axis. In green are presented numbers of sign changes of K ( n ) − K up to n — the right y -axis is for this plot.Figure 5: The plot of L ( n ) in black approaching the Khinchine–Levy constant L =3 . . . . (in red) with values presented on left y -axis. In green are presented numbersof sign changes of L ( n ) − L up to n — the right y -axis is for this plot.6Figure 6: The plot of the measured for the continued fraction of B M probability to find thepartial quotient a k = m for the continued fraction of B M .7Figure 7: The plot showing the distance to K of the running geometrical averages K ( n ) forthe continued fraction of S for n = 11 , . . . , L of the ( Q ( n )) /n obtained from the partialconvergents of the continued fraction of S for n = 11 , . . . , ≤ n ≤
47. Although the last points seemto coincide in fact Q = 2 . . . . × , while 2 c e − γ = 1 . . . . × —hundreds thousands orders of difference!Figure 10: The plot of − log | u M − P n /Q n | / log( Q nn