1 BINARY BBP-FORMULAE FOR LOGARITHMS AND GENERALIZED GAUSSIAN-MERSENNE PRIMES Marc Chamberland Department of Mathematics and Computer Science Grinnell College Grinnell, IA, 5011 E-mail: chamberl@math.grinnell.edu Abstract. Constants of the form C = k=0 pk) qk)b k where p and q are integer polynomials, deg p < deg q, and pk)/qk) is nonsingular for non-negative k and b, have special properties. The n th digit base b) of C may be calculated in essentially) linear time without computing its preceding digits, and constants of this form are conjectured to be either rational or normal to base b. This paper constructs such formulae for constants of the form log p for many primes p. This holds for all Gaussian-Mersenne primes and for a larger class of generalized Guassian-Mersenne primes. Finally, connections to Aurifeuillian factorizations are made. AMS MOS) subject classification : 11Y05 11A41, 11B99, 11T, 11Y60). Keywords: primes, Gaussian-Mersenne, BBP, Aurifeuillian.
1 Introduction The 1997 paper of Bailey, Borwein and Plouffe[] heralded a new era for the computation of various transcendental constants. alluring π = and more generally k=0 For formulae such as the 1 4 16 k 8k + 1 8k + 4 1 8k + 5 1 ) 8k + 6 C = k=0 pk) qk)b k where p and q are integer polynomials, deg p < deg q, and pk)/qk) is nonsingular for non-negative k and b Z +, they showed that the n th digit base b) may be calculated in essentially) linear time without computing its preceding digits. Moreover, constants of this form are conjectured to be either rational or normal to base b; see Bailey and Crandall[3]. Bailey[1] has recently catalogued a collection of these BBP-formulae. Curiously, these formulae intersect with the search for prime numbers. Recall that the Gaussian-Mersenne primes Sloane A05749) are the primes p such that 1 + i) p 1)1 i) p 1) is prime. Not only will we see that log q has a BBP-formula for every Gaussian-Mersenne prime q, but also for a much broader sequence of generalized Gaussian-Mersenne primes. Section shows how evaluating cyclotomic polynomials at particular complex values yields new BBP-formulae, which in turn is used to motivate the definition of generalized Gaussian-Mersenne primes. In performing such calculations, certain redundancies keep cropping up, shown to be related to Aurifeuillian identities. Section 3 shows how the cyclotomic polynomials can be used to construct such formulae.
3 Cyclotomic Polynomials and Generalized Gaussian- Mersenne Primes Perhaps the simplest BBP-formula for logarithms is the classical log = k=1 1 k k. Bailey et al.[] sought to determine all integers m such that log m has a binary BBP-formula, that is, where b = l. Bailey and Crandall noted that the space of constants which admit a binary BBP-formula is linear; if C 1 has such a formula with base l1 with base lcml1,l). Since and C has a formula with base l, then C 1 + C has a formula log n 1) n log = log 1 1 ) n = k=1 1 k kn, log n 1) has a binary BBP-formula, subsequently yielding formulae for log n + 1) and the natural logarithm of any integer of the form a1 1) a 1) a h 1) b1 1) b 1) bj 1). 1) The paper [] gave a list of some primes which have this form. Bailey [1] extended this list by using the expression )) 1 + i)k Re log 1 ± n suggested by R. Harley and J. Borwein. This expression has a binary BBPformula since, for example, log 1 1 + i ) n = = = ) j 1 + i 1 n j j=1 j=0 k=1 j=0 8 1 + i n 1 8n 4)j k=1 ) 8j+k 1 8j + k 8 ) k 1 + i 1 n 8j + k. )
4 A crucial tool for factoring numbers of the form b n 1 is the classical theory of cyclotomic polynomials: b n 1 = d n Φ d b) 3) where Φ d x), the d th cyclotomic polynomial, is defined as φd) Φ d x) = x ζ j ). j=1 The terms ζ j are the primitive d th roots of unity and φ ) is the Euler totient function. Alternatively, a well-known identity for these polynomials derived using Möbius inversion is Φ d x) = x k d1 d/k ) µk) 4) where µ ) is the Möbius function. In conjunction with expression 1), Bailey et al. state that log Φ m ) admits a binary BBP-formula for all positive integers m. One may easily extend this to log Φ m k ) 5) for all integers k. However, the cyclotomic polynomials may be used to obtain many other values. Using the Möbius formula 4) with x = ±1 + i)/ n yields )) ±1 + i Re log Φ m n = ) )) m/d ±1 + i µd)re log 1 n. 6) d m As in the consideration of the expression ), the right side is a binary BBPformula. Though it is simply a linear combination of expressions of the form ), the advantage here is that implicitly some cancellation may take place. For example, we have Re )) 1 + i log Φ 6 = 1 [log 14449 14 log ], 16
5 hence 14449 joins the list. Similarly, one may use the Möbius formula 4) with x = ±1 + )/ n to obtain Re log Φ m ±1 + )) n = µd)re log 1 d m ±1 + n again producing binary BBP-formulae. An example here is 1 + Re log )) Φ 5 = 1 [log 331 8 log ], 4 ) m/d, so 331 comes onto the list. Again, such results are linear combinations of earlier formulae since, for example, Re log 1 1 + )) x = log1 x 3 ) log1 x). Modest calculations with Maple produced the following augmentation of Bailey s list of primes whose logarithm admits a binary BBP-formula underlined numbers are given by Bailey[1]): 7), 3, 5, 7, 11, 13, 17, 19, 9, 31, 37, 41, 43, 61, 73, 109, 113, 17, 151, 41, 57, 331, 337, 397, 683, 131, 149, 1613, 113, 731, 5419, 8191, 14449, 6317, 38737, 43691, 61681, 65537, 8711, 131071, 174763, 4641, 6657, 68501, 79073, 31709, 5487, 55313, 599479, 79603, 437489, 7416361, 1579031, 18837001, 366891, 947661, 4739381, 10736769, 536903681, 136700741, 47855361, 45684561, 40388473189, 7715867399, 118750098349, 415878438361, 1133836730401, 93031007403, 363010550141, 43639531797, 443676798593, 4981857697937, 108140989558681, 140737471578113, 1041815865690181, 96076791871613611, 1844674406941458431, 5303066370307681801, 0485688359738048676031, 170594105047383399180849, 841593759487609954554456081, 134304196845099657814573351, 19177458387940681163497666111, 30483756195865984807891468769, 1339753983366838695890468400193, 3651445341097878641835395591,
6 1773039943798878976979507730561451, 6113148740478348404438984161303969, 14615030311747785099979369543473154804956801, 86798856474774971631486817898657976489313137639569 Of course, products of two primes, three primes, etc. were found to be on the list. Keeping track of these products of primes helps generate new single primes. For example, since 11 1 = 3 89, the product 3 89 is on the list. In addition, we have 1 + Re log )) Φ 6 1 = 1 [log 7 + log3 89) + log 599479 44 log ], so this is how 599479 was obtained. Products of two primes which are on the list include: 3 89, 47 178481, 53 157, 59 3033169, 67 0857, 71 191, 79 11369, 83 8831418697, 97 673, 101 8101, 137 953, 139 16874996591, 149 184481113, 181 54001, 193 53377, 197 19707683773, 9 457, 3 616318177, 51 4051, 77 3069, 81 86171, 83 16576853751, 313 149, 353 93154417, 571 160465489, 593 31769777, 601 1801, 631 3311, 641 6700417, 1013 1657, 1777 5781083, 311 1841, 3761 7484047069, 5581 384773, 8681 49477, 10169 4349589, 13367 164511353, 3377 11847, 9737 649657, 179951 303431780337, 181549 111549 Note that all the primes up to 101 are on the list, either alone or multiplied by one other prime. Indeed, every odd prime p is on the list, either alone or in some multiple product of primes since p 1 1 is on the list and p p 1 1). Carl Pomerance see []) showed that 3 could not be written in the form 1); however, it is still unknown whether log 3 has a binary BBP-formula. Related questions are extensively dealt with by Borwein, Borwein and Galway[4].
7 An important subclass of binary BBP-formulae concerns the expression )) 1 + i Re log Φ m. 8) Letting m equal a prime p = 4k + 1, we have ) ) ) 1 + i 1 + i 1 + i 1 + i Φ p = 1 + + + + 1+i ) 1+i ) 4k 1 = 1+i 1 ) = 1 + i 1 1 ) ) k, 4 ) 4k+1) which produces )) 1 + i Re log Φ p = 1 log 1 + 1 1 ) ) k 4 = 1 log 4 k 4) k + 1 ) k log = 1 ) ) 1 log + i) 4k+1) 1 1 i) 4k+1) 1 k log = 1 log 1 + i)p 1) 1 i) p 1) k log = 1 1 + i) p log 1) 1 i) p ) 1) 4k. A similar calculation may be done for primes of the form p = 4k 1. We then have that if q is a Gaussian-Mersenne prime, then log q admits a binary BBPformula. This connection implies a larger question: For which positive integers m is the numerator of the rational expression ))) 1 + i exp Re log Φ m prime? Besides the Gaussian-Mersenne primes, many composite m satisfy this condition. These generalized Gaussian-Mersenne primes, checked for all m < 3000, are listed below the regular Gaussian-Mersenne primes are underlined). 9), 3, 4, 5, 7, 9, 10, 11, 1, 14, 15, 18, 19, 1,, 6, 7, 9, 30, 33, 34, 35, 4, 45,
8 47, 49, 51, 54, 55, 58, 63, 65, 66, 69, 70, 73, 79, 85, 86, 87, 105, 106, 110, 111, 113, 114, 16, 19, 138, 147, 151, 157, 163, 167, 178, 186, 189, 17, 31, 39, 41, 4, 83, 319, 33, 350, 353, 363, 367, 375, 379, 385, 391, 457, 46, 5, 543, 566, 60, 61, 633, 651, 679, 741, 779, 819, 871, 885, 997, 106, 1114, 116, 1150, 16, 175, 1317, 139, 1367, 138, 1434, 1477, 1710, 196, 1970, 331, 4, 446, 995. Some of the primes produced by expression 9) have been put on the previous list of primes. When m = 995, this produces a prime with over 700 digits. 3 Aurifeuillian Factorizations Since the cyclotomic polynomials are irreducible in Z[x], it would seem no further factorization of b n 1 in equation 3) is possible. However, by imposing certain restrictions on x, other factorizations exist. An example is Φ 5 x) = x 4 + x 3 + x + x + 1 = x + 3x + 1) 5xx + 1) which, upon letting x = 5 k 1 and factoring the difference of squares, yields Φ 5 5 k 1 ) = [5 4k +3 5 k 1 +1 5 k 5 k 1 +1)][5 4k +3 5 k 1 +1+5 k 5 k 1 +1)]. These special polynomial identities were first noted by A. Aurifeuille and subsequently generalized by E. Lucas. References and other examples of Aurifeuillian identities may be found in Brillhart et al. [6], as well as their use in factoring. Theorems regarding writing Φ n x) as a difference of squares may be found in Schinzel[7], Stevenhagen[8] and Brent[5]. that Earlier we saw that log n ± 1) has a binary BBP-formula. Bailey[1]) notes Re log 1 ± 1 + i )) ) 1 n = n log + 1 log n 1 ± n + 1 ),
9 so the two expressions n 1 ± n + 1 come onto the list. However, multiplying these terms gives the classical Aurifeuillian identity 4n + 1 = n 1 + n + 1 ) n 1 n + 1 ). This demonstrates why some calculations used in the last section to generate the list of primes were redundant. Indeed, in searching for various families of factors, similar identities arise. We now develop other Aurifeuillian identities, interesting for their own sake, and make connections to expressions used in the last section. Let us start with a general theorem regarding cyclotomic polynomials. Theorem 3.1 Let m, n Z + satisfy gcdm, n) = 1 and at least one of m or n is greater than. Then Φ mn x) = φm) j=1 where ζ j are the primitive m th roots of unity. Proof: Φ n xζ j ) 10) Since the degree of Φ n x) is φn), the degree of the left side polynomial of 10) is φmn) = φm)φn), matching the degree of the right. The left polynomial is monic, while the leading coefficient of the right side is φn) φm) φm) φn) ζ j = j=1 = 1 so the right is also monic. It remains to show that the roots of each side are the same. The roots of Φ mn x) are simply e kiπ/mn with gcdk, mn) = 1. j=1 ζ j We will show that each of these φmn) distinct roots is also a root of the right side. To expand the right side, first note that each ζ j has the form e liπ/m for some l satisfying gcdl, m) = 1. This combines to give xζ j = e k+ln)iπ/mn
10 so it is suffices to show that for each k there exists an l such that ) k + ln gcd m, n = 1. Since gcdk, mn) = 1, we have gcdk, n) = 1. This implies that gcdk+ln, n) = 1 and, using the Euclidean algorithm with gcdm, n) = 1, there exists an l such that k + ln is a multiple of m. This completes the proof. With the identities Φ k nx) = Φ n x k 1), n odd and Φ pn x) = Φ n x p ), p prime, p n, we construct several examples. Example 3.1 The case m = 4 was foreshadowed by Schinzel[7, formula 1)]. Letting n be odd in Theorem 3.1 gives Replacing x with ix gives Φ n x ) = Φ 4n x) = Φ n ix)φ n ix). Φ n x ) = Φ n x)φ n x). Example 3. Letting m = 8, n odd, we have Φ 8n x) = [Φ n x 1 + i ) Φ n x 1 i )] [ Φ n x 1 + i ) Φ n x 1 i )]. Replacing x with x yields Φ n 4x 4 ) = Φ 4n x ) 11) = [Φ n x1 + i))φ n x1 i))] [Φ n x 1 + i))φ n x 1 i))]. 1) If x is real, the two right side expressions must be integer polynomials since they are each the product of complex conjugates. Example subcases with x = k are
11 n=1: 4k+ + 1 = k+1 + k+1 + 1) k+1 k+1 + 1) n=15: where 3k+16 + 8k+14 0k+10 16k+8 1k+6 + 4k+ + 1 = L R L, R = 16k+8 ± 15k+8 + 14k+7 ± 13k+7 + 1k+7 ± 11k+7 + 3 10k+5 ± 9k+6 +3 8k+4 ± 7k+5 + 3 6k+3 ± 5k+4 + 4k+3 ± 3k+ + k+1 ± k+1 + 1 Getting back to the redundancies in our earlier calculations, let x = 1/ k in 1) to produce )) 1 Re log Φ 4n k 1 [ )) ))] 1 + i 1 + i = Re log Φ n k + Re log Φ n k. This shows how terms from 5) and 6) appear in some factorizations. Example 3.3 Letting m = 1 and, 3 n, we have ) ) ) ) 3 + i 3 i Φ 1n x) = Φ n x Φ n x Φ n x 3 + i Φ n x 3 i 13) Replacing x with 3x gives Φ 6n 1x ) = [Φ n x3 + ) ) Φ n x3 )] ) [Φ n x 3 + ) ) Φ n x 3 )] ) Again, the two right side expressions must be integer polynomials. Example subcases with x = k 1 are n=1: n=5: 9 4k 3 k + 1 = 3 k 3 k + 1)3 k + 3 k + 1) 16k 3 8 + 14k 3 7 10k 3 5 8k 3 4 6k 3 3 + k 3 + 1 8k 3 4 + 7k 3 4 + 6k+1 3 3 + 5k 3 3 + 4k 3 + 3k 3 + k+1 3 + k 3 + 1) 8k 3 4 7k 3 4 + 6k+1 3 3 5k 3 3 + 4k 3 3k 3 + k+1 3 k 3 + 1)
1 To show how equation 13) produces redundancies, replace x with x 3 + i)/ to obtain Φ 6n 1 + ) x ) 3 + i = Φ 1n x = Φ n 1 + ) x Φ n 1 ) x Φ n x)φ n x). With x = 1/ k 1 this yields the relationship 1 + Re log )) 1 + Φ 6n k 1 = Re log )) 1 + Φ n k + Re log )) Φ n k ) ) 1 1 + log Φ n k 1 + log Φ n k 1. This shows how terms from 5) and 7) appear in some factorizations. Acknowledgement: I would like thank David Bailey, Jonathan Borwein and Samuel Wagstaff for supportive dialgoue. Special thanks go to Arnold Adelberg for helping me obtain Theorem 3.1 in its general form. References [1] Bailey, D.H. A Compendium of BBP-Type Formulas for Mathematical Constants. Preprint, http://crd.lbl.gov/ dhbailey/dhbpapers/index.html, 000). [] Bailey, D.H., Borwein, P.B. and Plouffe, S. On the Rapid Computation of Various Polylogarithmic Constants. Mathematics of Computation, 6618):903 913, 1997). [3] Bailey, D.H., Crandall, R.E. On the random character of fundamental constant expansions. Experimental Mathematics, 10):175 190, 001). [4] Borwein, D., Borwein, J.M., Galway,W.F. Finding and Excluding b-ary Machin-Type BBP Formulae. Canadian Journal of Mathematics, submitted, 003). CECM Preprint 003:195.
13 [5] R. Brent. Computing Aurifeuillian factors. Computational algebra and number theory Sydney, 199), Mathematics and its Applications, 35:01 1, Kluwer, Dordrecht, 1995). [6] J. Brillhart, D.H. Lehmer, J.L. Selfridge, B. Tuckerman, and S.S. Wagstaff,Jr. Factorizations of b n ± 1. American Mathematical Society, Providence, 1983). [7] A. Schinzel. On Primitive Prime Factors of a n b n. Proceedings of the Cambridge Philosophical Society, 584):555 56, 196). [8] P. Stevenhagen. On Aurifeuillian Factorizations. Proceedings of the Koninklijke Akademie van Wetenschappen, 904):451 468, 1987).