International Mathematical Forum, Vol. 8, 2013, no. 22, 1069 - 1078 HIKARI Ltd, www.m-hikari.com http://dx.doi.org/10.12988/imf.2013.3469
Factorization and Palindromic Continued Fractions Richard A. Mollin Department of Mathematics and Statistics University of Calgary Calgary, Alberta, T2N 1N4, Canada
[email protected] c 2013 Richard A. Mollin. This is an open access article distributed under Copyright the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
Abstract We provide elementary explanations in terms of palindromic continued fraction expansions for the factorization of integers of the form a2 + 1, including Fermat numbers and Cunningham project numbers. This provides a generalization and more complete explanation of the factorization of the sixth Fermat number given by Freeman Dyson at the turn of the century. This explanation may provide a new look at actually finding factorizations in general.
Mathematics Subject Classification: Primary 11R11; Secondary 11R29, 11C08, 11D09, 11Y65
1.
Introduction
In 2000, Freeman Dyson [2] provided an explanation, in terms of palindromes of certain finite continued fraction expansions, for the factorization of the Sixth Fermat number, employing a result of Serret from 1848. Herein we provide a much more complete and general explanation in terms of seminal work done in the nineteenth century, of which Serret is a trivial consequence. We show not only Dyson’s method of verifying a given factor, but also of using infinite simple continued fractions to verify the complete factorizations. We show how infinitely many periodic simple continued fractions underly the factorizations of any integers of the form a2 + 1, including, not only the Fermat numbers where a is a power of 2, but also the famous Cunningham project where a = bm for any natural numbers b, m.
1070
2.
Richard A. Mollin
Preliminaries
It is well-known that if D is not a perfect square then the continued fraction expansion is given by √ D = q0 ; q1 , . . . , q−1 , 2q0 ,
(2.1)
√ where q0 = D and q1 q2 . . . q−1 is a palindrome.1 Some basic facts on continued fractions which we will need are given as follows. This may be found in most introductory number theory texts such as [7]. √ A The jth convergent for D for any non-negative integer j is given by Bjj = q0 ; q1 , q2 , . . . , qj , where Aj = qj Aj−1 + Aj−2 , Bj = qj Bj−1 + Bj−2 , with A−2 = 0, A−1 = 1, B−2 = 1, and B−1 = 0. Also, and for any j ∈ N, Aj Bj−1 − Aj−1 Bj = (−1)j−1 .
(2.2)
A−1 = q0 B−1 + B−2 ,
(2.3)
2 A2−1 − B−1 D = (−1) .
(2.4)
and2
Now we may state the aforementioned result which [9, Satz 17] attributes to Muir in 1874.3 We state it here in a format suitable for our purposes. Theorem 2.1. For a natural number ≥ 2, let q1 , . . . , q−1 be a palindrome. If q0 ∈ N, then the following are equivalent. 1. For non square some D ∈ N, √ 1
D = q0 ; q1 , . . . , q−1 , 2q0 .
(2.5)
Indeed, Lagrange proved in 1770 that if a, b ∈ Zwith 0 < b < a and a/b not a perfect square, then there exists an ∈ N such that a/b = q0 ; q1 , . . . , q−1 , 2q0 —see [7, Exercise 5.16, p. 231]. √ 2 It is a fact that the fundamental unit of Q( D) for a non-square √ positive integer D is √ given by εD = A−1 + B−1 D and N (εD ) = (−1) where = ( D)—see [5, Theorem 2.11.3, p. 51] . √ 3 The case (1 + D)/2 is also covered by Muir, but we will not need it here. We refer the reader to [6] for a complete description and extended illustrations of its modern-day usage.
1071
Factorization and palindromic continued fractions
2. For some x ∈ Z, q0 = (ux − (−1) vw)/2
(2.6)
with u = B−1 , v = B−2 , and w = A−2 − q0 B−2 defined by the matrix equation −1 u v qj 1 = , 1 0 v w
(2.7)
j=1
√ given Aj /Bj being the j th convergent of D, described in the previous section.4 When (2.7) is satisfied, vw 2 ux 2 (−1) 2 2 D = q0 + xv − (−1) w = uvw x + + v− − (−1) w 2 . 2 2 2 (2.8) Proof. See [9] and also [4] for a more accessible and recent interpretation. It is also quite worth observing another matrix sequence of values. We present this here with proof since that proof contains the elements of a generalization of Serret’s result. Theorem 2.2. (Fundamental Unit Theorem for Quadratic Orders) Suppose that (2.7) holds. Then −1 q0 1 DB−1 A−1 qj 1 = , 1 0 1 0 A−1 B−1
(2.9)
j=0
where 2 D = (−1) , A2−1 − B−1
√ √ and εD = A−1 + B−1 D is the fundamental unit of the order Z[ D]. Proof. Using (2.7), we get: 2 −1 q0 1 q0 u + 2q0 v + w q0 u + v qj 1 = , 1 0 1 0 q0 u + v u
(2.10)
j=0
4
Note that by Perron when this occurs then either u is odd or u ≡ vw ≡ 0 (mod 2). It follows that ux − (−1) vw > 0 and this holds for x ≥ vw/u + 1 when is even and x ≥ −vw/u when is odd.
1072
Richard A. Mollin
where u = B−1 , and by (2.3), A−1 = q0 u + v = q0 B−1 + B−2 . We now show that upper left entries in the matrices (2.9)–(2.10) agree. By looking at D as given in (2.8), we see that we must show xvu − (−1) w 2 u = 2q0 v + w. However, from (2.6), we deduce that we only need to verify that v 2 − uw = (−1) .
(2.11)
We have 2 2 − B−1 (A−2 − q0 B−2 ) = B−2 − B−1 A−2 + q0 B−1 B−2 = v 2 − uw = B−2
B−2 A−1 − B−2 (B−2 + q0 B−1 ) = B−2 A−1 − B−2 A−1 = (−1) where the penultimate equality √follows from (2.3) and the last equality follows from (2.2). That A−1 + B−1 D is indeed the fundamental unit is discussed in Footnote 2. Corollary 2.1. Given √
D = q0 ; q1 , . . . , q−1 , 2q0 ,
2 uw = B−1 (A−2 − q0 B−2 ) = B−2 − (−1) = v 2 − (−1) .
Proof. This is (2.11) in the proof above. In [3], Friesen has prove the following which is related to the above. √ Theorem 2.3. Let D ∈ N, q0 = D, and q1 , . . . , q−1 any palindrome. Then the equation √ D = q0 ; q1 , . . . , q−1 , 2q0 , 2 has infinitely many square free integers D as solutions whenever either (B−2 − 5 (−1) )/B−1 or B−2 is even.
5
2 Note that from Theorem 2.1, v = B−2 , w = (B−2 −(−1) )/B−1 , and since v 2 −(−1) = vw from (2.11), then wv odd implies u even, so we have the conditions given in Footnote 4.
Factorization and palindromic continued fractions
3.
1073
Palindromes and Factorization
In [2], Dyson begins with a well-known elementary explanation as to why 641 is a factor of the fifth Fermat number 232 + 1. He then goes on to explain in a similar elementary fashion how 264 + 1 is divisible by 274177 using palindromic continued fractions. We begin here by introducing the use of Perron’s results to explain from the outset what underlies all of the factorizations to be discussed. We are essentially going to explain, via Corollary 2.1, why 641 · 6700417 = 232 + 1, implies that we may take B−2 = 216 = 65536 and B−1 = 6700417, the latter chosen √ over 641 since B−1 > B−2 in the simple continued fraction expansion of D. We have B−1 /B−2 = 102, 4, 6, 6, 4, 102 = q1 , . . . , q−1 with = 7. Thus, by Theorem 2.2, −1 u v 6700417 65536 qj 1 = = , 1 0 v w 65536 641 j=1
so u = B−1 = 6700417, v = B−2 = 65536, and w = A−2 − q0 B−2 = 641. wu = 641 · 6700417 = v 2 + 1 = 232 + 1, and we have a complete explanation of the factorization. An essential point to observe here is that u, v, w do not depend on the choice of q0 of which there are infinitely many. Although A−2 does so depend, this does not change w = A−2 − q0 B−2 by virtue of its definition, namely A−2 and q0 are co-dependent. So if we select x = 0 in Theorem 2.1, for instance, we get q0 = vw/2 = 21004288, A−2 = w + q0 v = 1376537019009, and w = A−2 − q0 B−2 = 1376537019009 − 21004288 · 65536 = 641, and any even choice of x will work. In the case of x = 0, we have d = 441180114797825, and √ D = 21004288; 102, 4, 6, 6, 4, 102, 42008576. Below, we will explain the rather exciting factorization of the ninth Fermat number by the number-field sieve using our palindromic method. First we show what Dyson did with the sixth Fermat number to see the connections that he used with an old result of Serret which we show is a trivial consequence of Muir. The factorization of the sixth Fermat number is given by 264 + 1 = 67280421310721 · 274177.
1074
Richard A. Mollin
Using the above strategy, we let v = B−2 = 232 = 4294967296 and u = B−1 = 67280421310721. Then for = 15, u/v = B−1 /B−2 = 15664, 1, 16, 1, 3, 1, 5, 5, 1, 3, 1, 16, 1, 15664, so −1 u v 67280421310721 4294967296 qj 1 = = , 1 0 v w 4294967296 274177 j=1
and via Corollary 2.1, uw = 67280421310721 · 274177 = 264 + 1 = v 2 + 1.
(3.12)
Again, we can choose any value of even x in Theorem 2.1, so x = 0 works and √ √ D = 346674399096009228584649055745 = 588790624157696; 15664, 1, 16, 1, 3, 1, 5, 5, 1, 3, 1, 16, 1, 15664, 1177581248315392 Now let’s explain what Dyson did and how Serret’s result is a consequence of Perron. He selected the factor Q = 274177 of 264 + 1 and looked at 274177 = x2 + y 2 with 264 + 1 = (x2 + y 2)(z 2 + w 2), and sought a value W so that QW = a2 + 1, and his choice for a = 15409 were based upon a trial and error method of finding certain solutions. In an effort to circumvent this inelegant method he quite correctly cites the much more elegant theorem of Serret as follows. Theorem 3.4. Serret [10] Suppose that a continued fraction Q/a with n partial quotients is given. This is a palindrome if and only if an integer U exists with QW = a2 + (−1)n .
(3.13)
Now getting back to the sixth Fermat number, Dyson notes that using Serret’s theorem we have 274177/15409 = 17, 1, 3, 1, 5, 5, 1, 3, 1, 17 = q1 , . . . , qn with n = 10, and from this we one gets a solution of 154092 + 1 = a2 + 1 = QW = 274177 · 866,
W = s2 + t2 ,
Factorization and palindromic continued fractions
1075
and this leads to a factorization of 264 + 1, since Q = x2 + y 2, xs + yt = a, and ys − xt = 1. What underlies this is Muir as follows. For a = 15409 = B−2 and Q = 274177 = B−1 with = 11 in Theorem 2.1, we get −1 u v 274177 15409 qj 1 = , = 1 0 v w 15409 866 j=1
where w = 866 = W, and Serret’s result is just the special case of Theorem 2.1 and Corollary 2.1, which yields 2 + 1. B−1 w = 274177 · 866 = 154092 + 1 = B−2
Essentially, the less appropriate known factor was chosen. As (3.12) above shows, we get the complete factorization explained via Perron by selecting the other factor. There is more. When looking at Q = x2 + y 2, Dyson does not have access to the full theory that underlies Theorem 2.1, which tells us that 2 2 Q = u = B−1 = B(−1)/2 + B(−3)/2 ,
which takes the guesswork out of a selection as a sum of two squares—see [5, Exercise 2.1.14, p. 59]. For instance, in Dyson’s case with B−1 = 274177 = B10 , we have B−1 = 274177 = B52 + B42 = 5162 + 892 = x2 + y 2, and
W = 866 = 292 + 52 = s2 + t2 ,
which he initially sought by trial and error and solved it more elegantly with Serret, which as we have seen is just a consequence of the above. Formally this is given as: Theorem 3.5. (Serret interpreted via Muir) Suppose that a continued fraction u/v = q1 , . . . , q−1 is given. This is a palindrome if and only if there is and D ∈ N with √ D = q0 ; q1 , . . . , q−1 , 2q0 , u = B−1 , v = B−2 , w = A−2 − q0 B−2 , and uw = v 2 + (−1)−1 .
1076
Richard A. Mollin
Proof. This is a consequence of Corollary 2.1 and Theorem 2.1. Now to fully appreciate the value of the above we apply the above to the factorization of the ninth Fermat number, which as noted above, was achieved by the number field sieve:6 9
22 + 1 = F9 = q7 · q49 · q99 , where qj is a prime with j decimal digits as follows: q7 = 2424833, q49 = 7455602825647884208337395736200454918783366342657, and q99 = 741640062627530801524787141901937474059940781097519 023905821316144415759504705008092818711693940737. 8
Thus, taking B−2 = 22 and B−1 = q99 , and = 115, we get, B−1 /B−2 = 6404928588062156103308, 1, 2, 7, 1, 2, 1, 2, 6, 85, 2, 1, 3, 318, 3, 1, 1, 1, 1, 8, 1, 3, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 7, 1, 1, 43, 4, 2, 2, 1, 1, 2, 2, 15, 1, 1, 2, 5, 1, 1, 1, 9, 12, 5, 55, 3, 1, 1, 3, 55, 5, 12, 9, 1, 1, 1, 5, 2, 1, 1, 15, 2, 2, 1, 1, 2, 2, 4, 43, 1, 1, 7, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 3, 1, 8, 1, 1, 1, 1, 3, 318, 3, 1, 2, 85, 6, 2, 1, 2, 1, 7, 2, 1, 6404928588062156103308 and
−1 u v q99 2256 qj 1 = = , 2256 q49 q7 v w 1 0 j=1
and
uw = F9 = q99 · q49 · q7 = 2512 + 1 = v 2 + 1,
—hard to argue with that power. As a closing feature, we show how a Cunningham factorization works with the above—see [1] for an overview of the project and factorizations. We know that 546 + 1 = 2 · 13 · 5465713352000770660547109750601,
(3.14)
so selecting B−2 = 523 , and B−1 = 5465713352000770660547109750601, then B−1 /B−2 = 458497267503004, 1, 4, 4, 1, 458497267503004 = q1 , . . . , q−1 and
−1 u v B−1 523 qj 1 , = = 523 26 1 0 v w j=1
which yields (3.14). 6
See [8, Appendix, p. 390] for instance.
Factorization and palindromic continued fractions
1077
Remark 3.1. An amazing breakthrough would be, given v 2 +1, find a continued fraction method for factoring, rather than just verification thereof as given above. There exists the well-known continued fraction algorithm for factoring (CFRAC). However, that has been superseded by powerhouses such as the number-field sieve a major result of which we verified above. To use our method would begin with v = B−2 and seek to find B−1 . One could select x = 0 in Theorem 2.1, so that q0 = vw/2, and w = A−2 − q0 v, with D = q02 + w 2 = w 2 ((v/2)2 + 1), so finding w would do the trick.7 Since we are given v we could run through the values of w until we find a D for which (2.7) holds with v on the off-diagonal, which would give the factorization. This however, could prove to be be highly computationally expensive as the size of v increases. Remark 3.1, being said, what we have presented herein is an elegant approach that subsumes Dyson’s work, which inspired this paper, shows that Serret is a consequence of Perron, and as Dyson said at the end of [2], the argument presented “only verifies the factorization after the factors are known.”
References [1] J. Brillhart, D.H. Lehmer, J.L. Selfridge, B. Tuckerman, and S.S. Wagstaff, Jr., Factorizations of bn ± 1,b = 2, 3, 5, 6, 7, 10, 11, 12 up to High Powers, Contemp. Math. 22, American Mathematical Society, Providence, RI (1983). [2] Freeman Dyson, The sixth Fermat number and palindromic continued fractions, L’Ensignement Math. 46 (2000), 385–389. [3] C. Friesen, On continued fractions of a given period, Proceed. Amer. Math. Soc. 103 (1988), 9–14. [4] F. Halter-Koch, Continued fractions of given symmetric period, Fibonacci Quart. 29 (1991), 298–303. [5] R.A. Mollin, Quadratics, CRC Press, Boca Raton, New York, London, Tokyo (1996), ISBN # 0-8493-3983-9. [6] R.A. Mollin and K. Cheng, Matrices and continued fractions, Intern. Math. Journal 3 (2003), 41–58. 7
Indeed, with these choices A−2 = w(1 + v 2 /2), A−1 = q0 u + v = v(1 + uw/2), and = w2 + v 2 D.
A2−2
1078
Richard A. Mollin
[7] R.A. Mollin, Fundamental Number Theory with Applications, Second Edition, Chapman and Hall/CRC, Taylor and Francis Group, Boca Raton, London, New York (2008), ISBN # 1-4200-6659-5. [8] R.A. Mollin, Advanced Number Theory with Applications, Chapman and Hall/CRC, Taylor and Francis Group, Boca Raton, London, New York (2010), ISBN # 978-1-4200-8328-6. [9] O. Perron, Die Lehre von den Kettenbr¨ uchen, Bd. 1 Teubner, Leipzig (1954). [10] J.A. Serret, Sur un th´eore`eme relatif aux entiers, J. de math. pures et app. 13 (1848), 12–14. Received: April 5, 2013