Elementary Number Theory in Nine Chapters Elementary Number Theory in Nine Chapters Second Edition JA M E S J. TAT T E R S A L L    Cambridge, New York, Melbourne, Madrid, Cape Town, Singapore, São Paulo Cambridge University Press The Edinburgh Building, Cambridge  , UK Published in the United States of America by Cambridge University Press, New York www.cambridge.org Information on this title: www.cambridge.org/9780521850148 © Cambridge University Press 2005 This publication is in copyright. Subject to statutory exception and to the provision of relevant collective licensing agreements, no reproduction of any part may take place without the written permission of Cambridge University Press. First published in print format 2005 - ---- eBook (NetLibrary) - --- eBook (NetLibrary) - ---- hardback - --- hardback - ---- paperback - --- paperback Cambridge University Press has no responsibility for the persistence or accuracy of s for external or third-party internet websites referred to in this publication, and does not guarantee that any content on such websites is, or will remain, accurate or appropriate. To Terry Contents Preface 1 The intriguing natural numbers 1.1 Polygonal numbers 1.2 Sequences of natural numbers 1.3 The principle of mathematical induction 1.4 Miscellaneous exercises 1.5 Supplementary exercises 2 Divisibility 2.1 The division algorithm 2.2 The greatest common divisor 2.3 The Euclidean algorithm 2.4 Pythagorean triples 2.5 Miscellaneous exercises 2.6 Supplementary exercises 3 Prime numbers 3.1 Euclid on primes 3.2 Number theoretic functions 3.3 Multiplicative functions 3.4 Factoring 3.5 The greatest integer function 3.6 Primes revisited 3.7 Miscellaneous exercises 3.8 Supplementary exercises page ix 1 23 40 43 50 55 64 70 76 81 84 87 94 103 108 112 115 129 133 vi Contents 4 Perfect and amicable numbers 4.1 Perfect numbers 4.2 Fermat numbers 4.3 Amicable numbers 4.4 Perfect-type numbers 4.5 Supplementary exercises 5 Modular arithmetic 5.1 Congruence 5.2 Divisibility criteria 5.3 Euler’s phi-function 5.4 Conditional linear congruences 5.5 Miscellaneous exercises 5.6 Supplementary exercises 6 Congruences of higher degree 6.1 Polynomial congruences 6.2 Quadratic congruences 6.3 Primitive roots 6.4 Miscellaneous exercises 6.5 Supplementary exercises 7 Cryptology 7.1 Monoalphabetic ciphers 7.2 Polyalphabetic ciphers 7.3 Knapsack and block ciphers 7.4 Exponential ciphers 7.5 Supplementary exercises 8 Representations 8.1 Sums of squares 8.2 Pell’s equation 8.3 Binary quadratic forms 8.4 Finite continued fractions 8.5 Infinite continued fractions 8.6 p-Adic analysis 8.7 Supplementary exercises vii 136 145 147 150 159 161 169 173 181 190 193 196 200 212 222 223 226 235 245 250 255 258 274 280 283 291 298 302 viii Contents 9 Partitions 9.1 Generating functions 304 9.2 Partitions 306 9.3 Pentagonal Number Theorem 311 9.4 Supplementary exercises 324 Tables T.1 List of symbols used 326 T.2 Primes less than 10 000 329 T.3 The values of ô(n), ó(n), ö(n), ì(n), ø(n), and Ù(n) for natural numbers less than or equal to 100 333 Answers to selected exercises 336 Bibliography Mathematics (general) 411 History (general) 412 Chapter references 413 Index 421 Preface Elementary Number Theory in Nine Chapters is primarily intended for a one-semester course for upper-level students of mathematics, in particular, for prospective secondary school teachers. The basic concepts illustrated in the text can be readily grasped if the reader has a good background in high school mathematics and an inquiring mind. Earlier versions of the text have been used in undergraduate classes at Providence College and at the United States Military Academy at West Point. The exercises contain a number of elementary as well as challenging problems. It is intended that the book should be read with pencil in hand and an honest attempt made to solve the exercises. The exercises are not just there to assure readers that they have mastered the material, but to make them think and grow in mathematical maturity. While this is not intended to be a history of number theory text, a genuine attempt is made to give the reader some insight into the origin and evolution of many of the results mentioned in the text. A number of historical vignettes are included to humanize the mathematics involved. An algorithm devised by Nicholas Saunderson the blind Cambridge mathematician is highlighted. The exercises are intended to complement the historical component of the course. Using the integers as the primary universe of discourse, the goals of the text are to introduce the student to: the basics of pattern recognition, the rigor of proving theorems, the applications of number theory, the basic results of elementary number theory. Students are encouraged to use the material, in particular the exercises, to generate conjectures, research the literature, and derive results either ix x Preface individually or in small groups. In many instances, knowledge of a programming language can be an effective tool enabling readers to see patterns and generate conjectures. The basic concepts of elementary number theory are included in the first six chapters: finite differences, mathematical induction, the Euclidean Algorithm, factoring, and congruence. It is in these chapters that the number theory rendered by the masters such as Euclid, Fermat, Euler, Lagrange, Legendre, and Gauss is presented. In the last three chapters we discuss various applications of number theory. Some of the results in Chapter 7 and Chapter 8 rely on mathematical machinery developed in the first six chapters. Chapter 7 contains an overview of cryptography from the Greeks to exponential ciphers. Chapter 8 deals with the problem of representing positive integers as sums of powers, as continued fractions, and p-adically. Chapter 9 discusses the theory of partitions, that is, various ways to represent a positive integer as a sum of positive integers. A note of acknowledgment is in order to my students for their persistence, inquisitiveness, enthusiasm, and for their genuine interest in the subject. The idea for this book originated when they suggested that I organize my class notes into a more structured form. To the many excellent teachers I was fortunate to have had in and out of the classroom, in particular, Mary Emma Stine, Irby Cauthen, Esayas Kundert, and David C. Kay, I owe a special debt of gratitude. I am indebted to Bela Bollobas, Jim McGovern, Mark Rerick, Carol Hartley, Chris Arney and Shawnee McMurran for their encouragement and advice. I wish to thank Barbara Meyer, Liam Donohoe, Gary Krahn, Jeff Hoag, Mike Jones, and Peter Jackson who read and made valuable suggestions to earlier versions of the text. Thanks to Richard Connelly, Frank Ford, Mary Russell, Richard Lavoie, and Dick Jardine for their help solving numerous computer software and hardware problems that I encountered. Thanks to Mike Spiegler, Matthew Carreiro, and Lynn Briganti at Providence College for their assistance. Thanks to Roger Astley and the staff at Cambridge University Press for their first class support. I owe an enormous debt of gratitude to my wife, Terry, and daughters Virginia and Alexandra, for their infinite patience, support, and understanding without which this project would never have been completed. Preface to the Second Edition The organization and content of this edition is basically the same as the previous edition. Information on several conjectures and open questions noted in the earlier edition have been updated. To meet the demand for more problems, over 375 supplementary exercises have been added to the text. The author is indebted to his students at Providence College and colleagues at other schools who have used the text. They have pointed out small errors and helped clarify parts that were obscure or diffuse. The advice of the following colleages was particularly useful: Joe Albree, Auburn University at Montgomery; Ed Burger, Williams College; Underwood Dudley, DePauw University; Stan Izen, the Latin School of Chicago; John Jaroma, Austin College; Shawnee McMurran, California State University at San Bernardino; Keith Matthews, University of Queensland; Thomas Moore, Bridgewater State College; Victor Pambuccian, Arizona State University; Tim Priden, Boulder, Colarado; Aldo Scimone, Italy; Jeff Stopple, University of California at Santa Barbara; Robert Vidal, Narbonne, France; and Thomas Weisbach, San Jose, California. I am also particularly indebted to the helpful suggestions from Mary Buckwalter, Portsmouth, Rhode Island, John Butler of North Kingston, Rhode Island, and Lynne DeMasi of Providence College. The text reads much better as a result of their help. I remain solely responsible for any errors or shortcomings that remain. xi 1 The intriguing natural numbers ‘The time has come,’ the Walrus said, ‘To talk of many things.’ Lewis Carroll 1.1 Polygonal numbers We begin the study of elementary number theory by considering a few basic properties of the set of natural or counting numbers, f1, 2, 3, . . .g. The natural numbers are closed under the binary operations of addition and multiplication. That is, the sum and product of two natural numbers are also natural numbers. In addition, the natural numbers are commutative, associative, and distributive under addition and multiplication. That is, for any natural numbers, a, b, c: a þ (b þ c) ¼ (a þ b) þ c, a þ b ¼ b þ a, a(b þ c) ¼ ab þ ac, a(bc) ¼ (ab)c ab ¼ ba (a þ b)c ¼ ac þ bc (associativity); (commutativity); (distributivity): We use juxtaposition, xy, a convention introduced by the English mathematician Thomas Harriot in the early seventeenth century, to denote the product of the two numbers x and y. Harriot was also the first to employ the symbols ‘.’ and ‘,’ to represent, respectively, ‘is greater than’ and ‘is less than’. He is one of the more interesting characters in the history of mathematics. Harriot traveled with Sir Walter Raleigh to North Carolina in 1585 and was imprisoned in 1605 with Raleigh in the Tower of London after the Gunpowder Plot. In 1609, he made telescopic observations and drawings of the Moon a month before Galileo sketched the lunar image in its various phases. One of the earliest subsets of natural numbers recognized by ancient mathematicians was the set of polygonal numbers. Such numbers represent an ancient link between geometry and number theory. Their origin can be traced back to the Greeks, where properties of oblong, triangular, and square numbers were investigated and discussed by the sixth century BC, pre-Socratic philosopher Pythagoras of Samos and his followers. The 1 2 The intriguing natural numbers Greeks established the deductive method of reasoning whereby conclusions are derived using previously established results. At age 18, Pythagoras won a prize for wrestling at the Olympic games. He studied with Thales, father of Greek mathematics, traveled extensively in Egypt and was well acquainted with Babylonian mathematics. At age 40, after teaching in Elis and Sparta, he migrated to Magna Graecia, where the Pythagorean School flourished at Croton in what is now Southern Italy. The Pythagoreans are best known for their theory of the transmigration of souls and their belief that numbers constitute the nature of all things. The Pythagoreans occupied much of their time with mysticism and numerology and were among the first to depict polygonal numbers as arrangements of points in regular geometric patterns. In practice, they probably used pebbles to illustrate the patterns and in doing so derived several fundamental properties of polygonal numbers. Unfortunately, it was their obsession with the deification of numbers and collusion with astrologers that later prompted Saint Augustine to equate mathematicans with those full of empty prophecies who would willfully sell their souls to the Devil to gain the advantage. The most elementary class of polygonal numbers described by the early Pythagoreans was that of the oblong numbers. The nth oblong number, denoted by on, is given by n(n þ 1) and represents the number of points in a rectangular array having n columns and n þ 1 rows. Diagrams for the first four oblong numbers, 2, 6, 12, and 20, are illustrated in Figure 1.1. The triangular numbers, 1, 3, 6, 10, 15, . . . , tn, . . . , where tn denotes the nth triangular number, represent the numbers of points used to portray equilateral triangular patterns as shown in Figure 1.2. In general, from the sequence of dots in the rows of the triangles in Figure 1.2, it follows that tn, for n > 1, represents successive partial sums of the first n natural numbers. For example, t4 ¼ 1 þ 2 þ 3 þ 4 ¼ 10. Since the natural numbers are commutative and associative, tn ¼ 1 þ 2 þ Á Á Á þ (n À 1) þ n and … Figure 1.1 1.1 Polygonal numbers 3 … Figure 1.2 tn ¼ n þ (n À 1) þ Á Á Á þ 2 þ 1; adding columnwise, it follows that 2tn ¼ (n þ 1) þ (n þ 1) þ Á Á Á þ (n þ 1) ¼ n(n þ 1). Hence, tn ¼ n(n þ 1)=2. Multiplying both sides of the latter equation by 2, we find that twice a triangular number is an oblong number. That is, 2tn ¼ on, for any positive integer n. This result is illustrated in Figure 1.3 for the case when n ¼ 6. Since 2 þ 4 þ Á Á Á þ 2n ¼ 2(1 þ 2 þ Á Á Á þn) ¼ 2 . n(n þ 1)=2 ¼ n(n þ 1) ¼ on, the sum of the first n even numbers equals the nth oblong number. The square numbers, 1, 4, 9, 16, . . . , were represented geometrically by the Pythagoreans as square arrays of points, as shown in Figure 1.4. In 1225, Leonardo of Pisa, more commonly known as Fibonacci, remarked, in Liber quadratorum (The Book of Squares) that the nth square number, denoted That is by sn ¼sn,senxÀc1eþedpedffisffiffiniffitþs ppreffisffidffinffieffiÀfficffi1ffiffiesosro,r,esqnuÀiv1,albeynttlhye, sum of the n2 ¼ (n À two roots. 1)2 þ n þ (n À 1). Fibonacci, later associated with the court of Frederick II, Emperor of the Holy Roman Empire, learned to calculate with Hindu–Arabic Figure 1.3 … Figure 1.4 4 The intriguing natural numbers numerals while in Bougie, Algeria, where his father was a customs officer. He was a direct successor to the Arabic mathematical school and his work helped popularize the Hindu–Arabic numeral system in Europe. The origin of Leonardo of Pisa’s sobriquet is a mystery, but according to some sources, Leonardo was figlio de (son of) Bonacci and thus known to us patronymically as Fibonacci. The Pythagoreans realized that the nth square number is the sum of the first n odd numbers. That is, n2 ¼ 1 þ 3 þ 5 þ Á Á Á þ (2n À 1), for any positive integer n. This property of the natural numbers first appears in Europe in Fibonacci’s Liber quadratorum and is illustrated in Figure 1.5, for the case when n ¼ 6. Another interesting property, known to the early Pythagoreans, appears in Plutarch’s Platonic Questions. Plutarch, a second century Greek biographer of noble Greeks and Romans, states that eight times a triangular number plus one is square. Using modern notation, we have 8tn þ 1 ¼ 8[n(n þ 1)=2] þ 1 ¼ (2n þ 1)2 ¼ s2nþ1. In Figure 1.6, the result is illustrated for the case n ¼ 3. It is in Plutarch’s biography of Marcellus that we find one of the few accounts of the death of Archimedes during the siege of Syracuse, in 212 BC. Around the second century BC, Hypsicles [HIP sih cleez], author of Figure 1.5 Figure 1.6 1.1 Polygonal numbers 5 Book XIV, a supplement to Book XIII of Euclid’s Elements on regular polyhedra, introduced the term polygonal number to denote those natural numbers that were oblong, triangular, square, and so forth. Earlier, the fourth century BC philosopher Plato, continuing the Pythagorean tradition, founded a school of philosophy near Athens in an area that had been dedicated to the mythical hero Academus. Plato’s Academy was not primarily a place for instruction or research, but a center for inquiry, dialogue, and the pursuit of intellectual pleasure. Plato’s writings contain numerous mathematical references and classification schemes for numbers. He firmly believed that a country’s leaders should be well-grounded in Greek arithmetic, that is, in the abstract properties of numbers rather than in numerical calculations. Prominently displayed at the Academy was a maxim to the effect that none should enter (and presumably leave) the school ignorant of mathematics. The epigram appears on the logo of the American Mathematical Society. Plato’s Academy lasted for nine centuries until, along with other pagan schools, it was closed by the Byzantine Emperor Justinian in 529. Two significant number theoretic works survive from the early second century, On Mathematical Matters Useful for Reading Plato by Theon of Smyrna and Introduction to Arithmetic by Nicomachus [nih COM uh kus] of Gerasa. Smyrna in Asia Minor, now Izmir in Turkey, is located about 75 kilometers northeast of Samos. Gerasa, now Jerash in Jordan, is situated about 25 kilometers north of Amman. Both works are philosophical in nature and were written chiefly to clarify the mathematical principles found in Plato’s works. In the process, both authors attempt to summarize the accumulated knowledge of Greek arithmetic and, as a consequence, neither work is very original. Both treatises contain numerous observations concerning polygonal numbers; however, each is devoid of any form of rigorous proofs as found in Euclid. Theon’s goal was to describe the beauty of the interrelationships between mathematics, music, and astronomy. Theon’s work contains more topics and was a far superior work mathematically than the Introduction, but it was not as popular. Both authors note that any square number is the sum of two consecutive triangular numbers, that is, in modern notation, sn ¼ tn þ tnÀ1, for any natural number n . 1. Theon demonstrates the result geometrically by drawing a line just above and parallel to the main diagonal of a square array. For example, the case where n ¼ 5 is illustrated in Figure 1.7. Nicomachus notes that if the square and oblong numbers are written alternately, as shown in Figure 1.8, and combined in pairs, the triangular numbers are produced. That is, using modern notation, t2n ¼ sn þ on and t2nþ1 ¼ snþ1 þ on, for any natural 6 The intriguing natural numbers Table 1.1. 1 2 3 4 5 6 7 8 9 10 1 1 2 3 4 5 6 7 8 9 10 2 2 4 6 8 10 12 14 16 18 20 3 3 6 9 12 15 18 21 24 27 30 4 4 8 12 16 20 24 28 32 36 40 5 5 10 15 20 25 30 35 40 45 50 6 6 12 18 24 30 36 42 48 54 60 7 7 14 21 28 35 42 49 56 63 70 8 8 16 24 32 40 48 56 64 72 80 9 9 18 27 36 45 54 63 72 81 90 10 10 20 30 40 50 60 70 80 90 100 Figure 1.7 s1 o1 s2 o2 s3 o3 s4 o4 s5 o5 1 2 4 6 9 12 16 20 25 30 3 6 10 15 21 28 36 45 55 t2 t3 t4 t5 t6 t7 t8 t9 t10 Figure 1.8 number n. From a standard multiplication table of the first ten natural numbers, shown in Table 1.1, Nicomachus notices that the major diagonal is composed of the square numbers and the successive squares sn and snþ1 are flanked by the oblong numbers on. From this, he deduces two properties that we express in modern notation as sn þ snþ1 þ 2on ¼ s2nþ1 and onÀ1 þ on þ 2sn ¼ s2n. Nicomachus extends his discussion of square numbers to the higher dimensional cubic numbers, 1, 8, 27, 64, . . . , and notes, but does not establish, a remarkable property of the odd natural numbers and the cubic numbers illustrated in the triangular array shown in Figure 1.9, namely, that the sum of the nth row of the array is n3. It may well have been Nicomachus’s only original contribution to mathematics. 1.1 Polygonal numbers 7 1 1 35 8 7 9 11 27 13 15 17 19 64 21 23 25 27 29 125 ............................................. Figure 1.9 In the Introduction, Nicomachus discusses properties of arithmetic, geometric, and harmonic progressions. With respect to the arithmetic progression of three natural numbers, he observes that the product of the extremes differs from the square of the mean by the square of the common difference. According to this property, known as the Regula Nicomachi, if the three terms in the progression are given by a À k, a, a þ k, then (a À k)(a þ k) þ k2 ¼ a2. In the Middle Ages, rules for multiplying two numbers were rather complex. The Rule of Nicomachus was useful in squaring numbers. For example, applying the rule for the case when a ¼ 98, we obtain 982 ¼ (98 À 2)(98 þ 2) þ 22 ¼ 96 . 100 þ 4 ¼ 9604. After listing several properties of oblong, triangular, and square numbers, Nicomachus and Theon discuss properties of pentagonal and hexagonal numbers. Pentagonal numbers, 1, 5, 12, 22, . . . , p5 n, . . . , where p5 n denotes the nth pentagonal number, represent the number of points used to construct the regular geometric patterns shown in Figure 1.10. Nicomachus generalizes to heptagonal and octagonal numbers, and remarks on the patterns that arise from taking differences of successive triangular, square, pentagonal, heptagonal, and octagonal numbers. From this knowledge, a general formula for polygonal numbers can be derived. A practical technique for accomplishing this involving successive differences appeared in a late thirteenth century Chinese text Works and Days Calendar by Wang Xun (SHUN) and Guo Shoujing (GOW SHOE GIN). The method was mentioned in greater detail in 1302 in Precious Mirror of the Four … Figure 1.10 8 The intriguing natural numbers Elements by Zhu Shijie (ZOO SHE GEE), a wandering scholar who earned his living teaching mathematics. The method of finite differences was rediscovered independently in the seventeenth century by the British mathematicians Thomas Harriot, James Gregory, and Isaac Newton. Given a sequence, ak, akþ1, akþ2, . . . , of natural numbers whose rth differences are constant, the method yields a polynomial of degree r À 1 representing the general term of the given sequence. Consider the binomial coefficients ( nk ) ¼ n! k!(n À k)! , for 0 < k < n, (0n) ¼ 1, and otherwise (nk) ¼ 0, where for any natural number n, n factorial, written n!, represents the product n(n À 1)(n À 2) Á Á Á 3 . 2 . 1 and, for consistency, 0! ¼ 1. The ex- clamation point used to represent factorials was introduced by Christian Kramp in 1802. The numbers, ( n k ), are called the binomial coefficients bPecnka¼u0s(enk )aonÀf k the role they bk. For example, play in the expansion of (a þ b)n ¼ (a þ b)3 ¼ (30)a3b0 þ (31)a2b1 þ (32)a1b2 þ (33)a0b3 ¼ a3 þ 3a2b þ 3ab2 þ b3: Denote the ith differences, ˜i, of the sequence ak, akþ1, akþ2, . . . by di1, di2, di3, . . . , and generate the following finite difference array: n k kþ1 kþ2 kþ3 kþ4 kþ5 kþ6 an ak a k þ1 a kþ2 a kþ3 a kþ4 a kþ5 a k þ6 ˜1 d11 d12 d13 d14 d15 d16 ˜2 d21 d22 d23 d24 d25 ............................................................. ˜r d r1 d r2 d r3 d r4 If the rth differences d r1, d r2, d r3, . . . are equal, then working backwards and using terms in the leading diagonal each term of the sequence ak, akþ1, akþ2, . . . can be determined. More precisely, the finite difference array for the sequence bn ¼ ( nÀ k m ), for m ¼ 0, 1, 2, 3, . . . , r, n ¼ k, k þ 1, k þ 2, . . . , and a fixed value of k, has the property that the mth differences, ˜m, consist of all ones and, except for d m1 ¼ 1 for 1 < m < r, the leading diagonal is all zeros. For example, if m ¼ 0, the finite difference array for an ¼ ( nÀ 0 k ) is given by n k kþ1 kþ2 kþ3 kþ4 kþ5 kþ6 bn 1 1 1 1 1 1 1 ˜1 0 0 0 0 0 0 1.1 Polygonal numbers 9 If m ¼ 1, the finite difference array for an ¼ ( nÀ 1 k ) is given by n k kþ1 kþ2 kþ3 kþ4 kþ5 bn 0 1 2 3 4 5 ˜1 1 1 1 1 1 1 ˜2 0 0 0 0 0 If m ¼ 2, the finite difference array for an ¼ ( nÀ 2 k ) is given by n k kþ1 kþ2 kþ3 kþ4 kþ5 bn 0 0 1 3 6 10 ˜1 0 1 2 3 4 5 ˜2 1 1 1 1 1 ˜3 0 0 0 0 0 kþ6 6 0 kþ6 15 1 The leading diagonals of the finite difference array for the sequence ak, akþ1, akþ2, . . . , and the array defined by ak ( nÀ 0 k ) þ d11 ( nÀ 1 k ) þ d 21( nÀ 2 k ) þ Á ÁÁ þ d r1 ( nÀ r k ) are identical. Therefore, an ¼ ak ( nÀ 0 k ) þ d11( nÀ 1 k ) þ d21 ( nÀ 2 k ) þ ÁÁÁ þ d r1( nÀ r k ), for n ¼ k, k þ 1, k þ 2, . . . : Example 1.1 The finite difference array for the pentagonal numbers, 1, 5, 12, 22, 35, . . . , p5 n, . . . is given by n1 2 3 4 5 6 ... p5 n 1 5 12 22 35 51 ... ˜1 4 7 10 13 16 ... ˜2 3 3 3 3 ... Our indexing begins with k ¼ 1. Therefore p5 n ¼ 1 . (nÀ0 1) þ 4 . (nÀ1 1) þ 3 . (nÀ2 1) ¼ 1 þ 4( n À 1) þ 3 (n À 1)( n 2 À 2) ¼ 3n2 À n : 2 A more convenient way to determine the general term of sequences with finite differences is the following. Since the second differences of the pentagonal numbers sequence is constant, consider the sequence whose general term is f (n) ¼ an2 þ bn þ c, whose first few terms are given by f (1) ¼ a þ b þ c, f (2) ¼ 4a þ 2b þ c, f (3) ¼ 9a þ 3b þ c, f (4) ¼ 16a þ 4b þ c, and whose finite differences are given by 10 The intriguing natural numbers aþbþc 4a þ 2b þ c 3a þ b 2a 9a þ 3b þ c 5a þ b 2a 16a þ 4b þ c . . . 7a þ b . . . ... Matching terms on the first diagonal of the pentagonal differences with those of f (n) yields 2a ¼ 3 3a þ b ¼ 4 a þ b þ c ¼ 1: Hence, a ¼ 32, b ¼ À12, c ¼ 0, and f (n) ¼ 3 2 n2 À 1 2 n. From Table 1.2, Nicomachus infers that the sum of the nth square and the (n À 1)st triangular number equals the nth pentagonal number, that is, for any positive integer n, p5 n ¼ sn þ tnÀ1. For example, if n ¼ 6, s6 þ t5 ¼ 36 þ 15 ¼ 51 ¼ p56. He also deduces from Table 1.2 that three times the (n À 1)st triangular number plus n equals the nth pentagonal number. For example, for n ¼ 9, 3 . t8 þ 9 ¼ 3 . 36 þ 9 ¼ 117 ¼ p59. In general, the m-gonal numbers, for m ¼ 3, 4, 5, . . . , where m refers to the number of sides or angles of the polygon in question, are given by the sequence of numbers whose first two terms are 1 and m and whose second common differences equal m À 2. Using the finite difference method outlined previously we find that pm n ¼ (m À 2)n2=2 À (m À 4)n=2, where pmn denotes the nth m-gonal number. Triangular numbers correspond to 3-gonal numbers, squares to 4-gonal numbers, and so forth. Using Table 1.2, Nicomachus generalizes one of his previous observations and claims that pmn þ p3 nÀ1 ¼ pmþ1 n, where p3 n represents the nth triangular number. The first translation of the Introduction into Latin was done by Apuleius of Madaura shortly after Nicomachus’s death, but it did not survive. However, there were a number of commentaries written on the Introduc- tion. The most influential, On Nicomachus’s Introduction to Arithmetic, was written by the fourth century mystic philosopher Iamblichus of Chalcis in Syria. The Islamic world learned of Nicomachus through Thabit ibn Qurra’s Extracts from the Two Books of Nicomachus. Thabit, a ninth century mathematician, physician, and philosopher, worked at the House of Wisdom in Baghdad and devised an ingenious method to find amicable numbers that we discuss in Chapter 4. A version of the Introduction was written by Boethius [beau EE thee us], a Roman philosopher and statesman who was imprisoned by Theodoric King of the Ostrogoths on a charge of conspiracy and put to death in 524. It would be hard to overestimate the influence of Boethius on the cultured and scientific medieval mind. His De 1.1 Polygonal numbers 11 Table 1.2. n 1 23 4 5 6 7 8 9 10 Triangular 1 3 6 10 15 21 28 36 45 55 Square 1 4 9 16 25 36 49 64 81 100 Pentagonal 1 5 12 22 35 51 70 92 117 145 Hexagonal 1 6 15 28 45 66 91 120 153 190 Heptagonal 1 7 18 34 55 81 112 148 189 235 Octagonal 1 8 21 40 65 96 133 176 225 280 Enneagonal 1 9 24 46 75 111 154 204 261 325 Decagonal 1 10 27 52 85 126 175 232 297 370 institutione arithmetica libri duo was the chief source of elementary mathematics taught in schools and universities for over a thousand years. He coined the term quadrivium referring to the disciplines of arithmetic, geometry, music, and astronomy. These subjects together with the trivium of rhetoric, grammar, and logic formed the seven liberal arts popularized in the fifth century in Martianus Capella’s book The Marriage of Mercury and Philology. Boethius’s edition of Nicomachus’s Introduction was the main medium through which the Romans and people of the Middle Ages learned of formal Greek arithmetic, as opposed to the computational arithmetic popularized in the thirteenth and fourteenth centuries with the introduction of Hindu–Arabic numerals. Boethius wrote The Consolation of Philosophy while in prison where he reflected on the past and on his outlook on life in general. The Consolation was translated from Latin into Anglo-Saxon by Alfred the Great and into English by Chaucer and Elizabeth I. In the fourth century BC Philip of Opus and Speusippus wrote treatises on polygonal numbers that did not survive. They were, however, among the first to extend polygonal numbers to pyramidal numbers. Speusippus [spew SIP us], a nephew of Plato, succeeded his uncle as head of the Academy. Philip, a mathematician–astronomer, investigated the connection between the rainbow and refraction. His native home Opus, the modern town of Atalandi, on the Euboean Gulf, was a capital of one of the regions of Locris in Ancient Greece. Each class of pyramidal number is formed from successive partial sums of a specific type of polygonal number. For example, the nth tetrahedral number, P3 n, can be obtained from successive partial sums of triangular numbers, that is, P3 n ¼ p31 þ p32 þ Á Á Á þ p3 n. For example, P34 ¼ 1 þ 3 þ 6 þ 10 ¼ 20. Accordingly, the first four tetrahedral numbers are 1, 4, 12 The intriguing natural numbers 10, and 20. An Egyptian papyrus written about 300 BC gives 12(n2 þ n) as the sum of the first n natural numbers and 13(n þ 2)12(n2 þ n) as the sum of the first n triangular numbers. That is, tn ¼ p3 n ¼ n(n þ 1)=2 and P3 n ¼ n(n þ 1)(n þ 2)=6. The formula for P3 n was derived by the sixth century Indian mathematician–astronomer Aryabhata who calculated one of the earliest tables of trigonometric sines using 3.146 as an estimate for ð. Example 1.2 Each triangle on the left hand side of the equality in Figure 1.11 gives a different representation of the first four triangular numbers, 1, 3 (1 þ 2), 6 (1 þ 2 þ 3), and 10 (1 þ 2 þ 3 þ 4). Hence, 3 . (1 þ 3 þ 6 þ 10) ¼ 1 . 6 þ 2 . 6 þ 3 . 6 þ 4 . 6 ¼ (1 þ 2 þ 3 þ 4) . 6 ¼ t4(4 þ 2). In general, 3(t1 þ t2 þ t3 þ Á Á Á þ tn) ¼ tn(n þ 2) ¼ n(n þ 1)(n þ 2)=2. Therefore, P3 n ¼ n(n þ 1)(n þ 2)=6. In Figure 1.11, the sum of the numbers in the third triangle is the fourth tetrahedral number. That is, 1 . 4 þ 2 . 3 þ 3 . 2 þ 4 . 1 ¼ 20. Thus, in general, 1 . n þ 2 . (n À 1) þ Á Á Á þ (n À 1) . 2 þ n . 1 ¼ P3 n. Hence, we can generate the tetrahedral numbers by summing the terms in the SW–NE diagonals of a standard multiplication table as shown in Table 1.3. For example, P36 ¼ 6 þ 10 þ 12 þ 12 þ 10 þ 6 ¼ 56. Pyramidal numbers with a square base are generated by successive 1 1 4 6 12 21 33 66 123 ϩ 321 ϩ 222 ϭ 666 1234 4321 1111 6666 Figure 1.11 Table 1.3. P31 P32 P33 P34 P35 P36 P37 P38 P39 1 4 10 20 35 56 84 120 165 12 3 4 5 6 7 8 9 2 4 6 8 10 12 14 16 3 6 9 12 15 18 21 4 8 12 16 20 24 5 10 15 20 25 6 12 18 24 7 14 21 8 16 9 1.1 Polygonal numbers 13 Table 1.4. n 12 34 5 6 7 8 9 10 f 0n 1 1 11 1 1 1 1 1 1 f 1n 1 2 34 5 6 7 8 9 10 f 2n 1 3 6 10 15 21 28 36 45 55 f 3n 1 4 10 20 35 56 84 120 165 220 f 4n 1 5 15 35 70 126 210 330 495 715 f 5n 1 6 21 56 126 252 462 792 1287 2002 f 6n 1 7 28 84 210 462 924 1716 3003 5005 partial sums of square numbers. Hence, the nth pyramidal number, denoted by P4 n, is given by 12 þ 22 þ 32 þ Á Á Á þ n2 ¼ n(n þ 1)(2n þ 1)=6. For example, P44 ¼ 1 þ 4 þ 9 þ 16 ¼ 30. The total number of cannonballs in a natural stacking with a square base is a pyramidal number. Slicing a pyramid through a vertex and the diagonal of the opposite base results in two tetrahedrons. Hence, it should be no surprise to find that the sum of two consecutive tetrahedral numbers is a pyramidal number, that is, P4 n ¼ P3 nÀ1 þ P3 n. In the tenth century, Gerbert of Aurillac in Auvergne included a number of identities concerning polygonal and pyramidal numbers in his corre- spondence with his pupil Adalbold, Bishop of Utrecht. Much of Gerbert’s Geometry was gleaned from the work of Boethius. One of the more difficult problems in the book asks the reader to find the legs of a right triangle given the length of its hypotenuse and its area. Gerbert was one of the first to teach the use of Hindu–Arabic numerals. He was elected Pope Sylvester II in 999, but his reign was short. Triangular and tetrahedral numbers form a subclass of the figurate numbers. In the 1544 edition of Arithmetica Integra, Michael Stifel defined the nth mth-order figurate number, denoted by f mn, as follows: f m n ¼ f m nÀ1 þ f mÀ1 n, f m 1 ¼ f 0 n ¼ f 0 1 ¼ 1, for n ¼ 2, 3, . . . , and m ¼ 1, 2, 3, . . . : An array of figurate numbers is illustrated in Table 1.4, where the n th triangular number corresponds to f 2 n and the n th tetrahe- dral number to f 3 n. In 1656, John Wallis, the English mathematician who served as a cryptanalyst for several Kings and Queens of England, and introduced the symbol 1 to represent infinity, showed that, for positive integers n and r, f r nþ1 ¼ f 0 n þ f 1n þ f 2n þ ÁÁÁ þ f rn. Stifel was the first to realize a connection existed between figurate numbers and binomial coefficients, namely that f m n ¼ ( nþ mÀ1 m ). In particu- lar, f 2 n ¼ tn ¼ ( nþ1 2 ) and f 3 n ¼ P3 n ¼ (nþ3 2). Stifel earned a Master’s 14 The intriguing natural numbers degree at Wittenberg University. He was an avid follower of Martin Luther, an ardent biblical scholar, and a millenarian. Stifel must have thought he was standing in the foothills of immortality when, through his reading, he inferred that the world was going to end at 8 o’clock on the morning of October 18, 1533. He led a band of followers to the top of a nearby hill to witness the event, a nonoccurrence that did little to enhance his credibility. Nicomachus’s Introduction to Arithmetic was one of the most significant ancient works on number theory. However, besides Books VII–IX of Euclid’s Elements, whose contents we will discuss in the next chapter, the most influential number theoretic work of ancient times was the Arithmetica of Diophantus, one of the oldest algebra treatises in existence. Diophantus, a mathematician who made good use of Babylonian and Greek sources, discussed properties of polygonal numbers and included a rule to determine the nth m-gonal number which he attributed to Hypsicles. Unfortunately, a complete copy of the Arithmetica was lost when the Library of Alexandria was vandalized in 391 by Christians acting under the aegis of Theophilus, Bishop of Alexandria, and a decree by Emperor Theodosius concerning pagan monuments. Portions of the treatise were rediscovered in the fifteenth century. As a consequence, the Arithmetica was one of the last Greek mathematical works to be translated into Latin. There were a number of women who were Pythagoreans, but Hypatia, the daughter of the mathematician Theon of Alexandria, was the only notable female scholar in the ancient scientific world. She was one of the last representatives of the Neo-platonic School at Alexandria, where she taught science, art, philosophy, and mathematics in the early fifth century. She wrote a commentary, now lost, on the first six books of the Arithmetica and may very well have been responsible for editing the version of Ptolemy’s Almagest that has survived. Some knowledge of her can be gleaned from the correspondence between her and her student Synesius, Bishop of Cyrene. As a result of her friendship with Alexandria’s pagan Prefect, Orestes, she incurred the wrath of Cyril, Theophilus’s nephew who succeeded him in 412 as Bishop of Alexandria. In 415, Hypatia was murdered by a mob of Cyril’s followers. During the millennium following her death no woman distinguished herself in science or mathematics. In the introduction to the Arithmetica, Diophantus refers to his work as consisting of thirteen books, where a book consisted of a single scroll representing material covered in approximately twenty to fifty pages of ordinary type. The first six books of the Arithmetica survived in Greek and four books, which may have a Hypatian rather than a Diophantine origin, survived in Arabic. In addition, a fragment on polygonal numbers by 1.1 Polygonal numbers 15 Diophantus survives in Greek. The Arithmetica was not a textbook, but an innovative handbook involving computations necessary to solve practical problems. The Arithmetica was the first book to introduce consistent algebraic notation and systematically use algebraic procedures to solve equations. Diophantus employed symbols for squares and cubes but limited himself to expressing each unknown quantity in terms of a single variable. Diophantus is one the most intriguing and least known characters in the history of mathematics. Much of the Arithmetica consists of cleverly constructed positive rational solutions to more than 185 problems in indeterminate analysis. Negative solutions were not acceptable in Diophantus’s time or for the next 1500 years. By a rational solution, we mean a number of the form p=q, where p and q are integers and q 6¼ 0. In one example, Diophantus constructed three rational numbers with the property that the product of any two of the numbers added to their sum or added to the remaining number is square. That is, in modern notation, he determined numbers x, y, z such that xy þ x þ y, xz þ x þ z, yz þ y þ z, xy þ z, xz þ y, and yz þ x are all square. In another problem, Diophantus found right triangles with sides of rational length such that the length of the hypotenuse minus the length of either side is a cube. In the eleventh century, in Baghdad, the Islamic mathematician al-Karaji and his followers expanded on the methods of Diophantus and in doing so undertook a systematic study of the algebra of exponents. Problems similar to those found in the Arithmetica first appear in Europe in 1202 in Fibonacci’s Liber abaci (Book of Calculations). The book introduced Hindu–Arabic numerals to European readers. It was revised by the author in 1228 and first printed in 1857. However, the first reference to Diophantus’s works in Europe is found in a work by Johannes Mu¨ller who, in his day, was called Joannes de Regio monte (John of Ko¨nigsberg). However, Mu¨ller is perhaps best known today by his Latinized name Regiomontanus, which was popularized long after his death. Regiomontanus, the first publisher of mathematical and astronomical literature, studied under the astronomer Georges Peurbach at the University of Vienna. He wrote a book on triangles and finished Peurbach’s translation of Ptolemy’s Almagest. Both Christopher Columbus and Amerigo Vespucci used his Ephemerides on their voyages. Columbus, facing starvation in Jamaica, used a total eclipse of the Moon on February 29, 1504, predicted in the Ephemerides, to encourage the natives to supply him and his men with food. A similar idea, albeit using a total solar eclipse, was incorporated by Samuel Clemens (Mark Twain) in A Connecticut Yankee in King Arthur’s 16 The intriguing natural numbers Court. Regiomontanus built a mechanical fly and a ‘flying’ eagle, regarded as the marvel of the age, which could flap its wings and saluted when Emperor Maximilian I visited Nuremberg. Domenico Novarra, Copernicus’s teacher at Bologna, regarded himself as a pupil of Regiomontanus who, for a short period, lectured at Padua. Regiomontanus wrote to the Italian mathematician Giovanni Bianchini in February 1464 that while in Venice he had discovered Greek manuscripts containing the first six books of Arithmetica. In 1471, Regiomontanus was summoned to Rome by Pope Sixtus IV to reform the ecclesiastical calendar. However, in 1476, before he could complete his mission, he died either a victim of the plague or poisoned for his harsh criticism of a mediocre translation of the Almagest. In 1572, an Italian engineer and architect, Rafael Bombelli, published Algebra, a book containing the first description and use of complex numbers. The book included 271 problems in indeterminate analysis, 147 of which were borrowed from the first four books of Diophantus’s Arithmetica. Gottfried Leibniz used Bombelli’s text as a guide in his study of cubic equations. In 1573, based on manuscripts found in the Vatican Library, Wilhelm Holtzman, who wrote under the name Xylander, published the first complete Latin translation of the first six books of the Arithmetica. The Dutch mathematician, Simon Stevin, who introduced a decimal notation to European readers, published a French translation of the first four books of the Arithmetica, based on Xylander’s work. In 1593, Franc¸ois Vie`te [VYET], a lawyer and cryptanalyst at the Court of Henry IV, published Introduction to the Analytic Art, one of the first texts to champion the use of Latin letters to represent numbers to solve problems algebraically. In an effort to show the power of algebra, Vie`te included algebraic solutions to a number of interesting problems that were mentioned but not solved by Diophantus in the Arithmetica. A first-rate translation, Diophanti Alexandrini arithmeticorum libri sex, by Claude-Gaspard Bachet de Me´ziriac, appeared in 1621. Bachet, a French mathematician, theologian, and mythologist of independent means, included a detailed commentary with his work. Among the number theoretic results Bachet established were (a) pm nþr ¼ pmn þ pmr þ nr(m À 2), (b) pm n ¼ p3 n þ (m À 3) p3 nÀ1, and (c) 13 þ 23 þ 33 þ Á Á Á þ n3 ¼ ( p3 n)2, where pmn denotes the nth m-gonal number. The third result is usually 1.1 Polygonal numbers 17 expressed as 13 þ 23 þ 33 þ Á Á Á þ n3 ¼ (1 þ 2 þ 3 þ Á Á Á þ n)2 and referred to as Lagrange’s identity. In the fourth book of the Arithmetica Diophantus found three rational numbers, 18513, 648010, and 881, which if multiplied in turn by their sum yield a triangular number, a square number, and a cube, respectively. Bachet extended the problem to one of finding five numbers which if multiplied in turn by their sum yield a triangular number, a square, a cube, a pentagonal number, and a fourth power, respectively. Bachet was an early contributor to the field of recreational mathematics. His Proble`mes plaisants et de´lectables qui se font par les nombres, first published in 1612, is replete with intriguing problems including a precursor to the cannibals and missionaries problem, the Christians and Turks problem, and a discussion on how to create magic squares. At age 40, Bachet married, retired to his country estate, sired seven children, and gave up his mathematical activity forever. Except for recurring bouts with gout and rheumatism, he lived happily ever after. The rediscovery of Diophantus’s work, in particular through Bachet’s edition which relied heavily on Bombelli’s and Xylander’s work, greatly aided the renaissance of mathematics in Western Europe. One of the greatest contributors to that renaissance was Pierre de Fermat [fair MAH], a lawyer by profession who served as a royal councillor at the Chamber of Petitions at the Parlement of Toulouse. Fermat was an outstanding amateur mathematician. He had a first-class mathematical mind and, before Newton was born, discovered a method for finding maxima and minima and general power rules for integration and differentiation of polynomial functions of one variable. He rarely, however, published any of his results. In 1636, he wrote, in a burst of enthusiasm, that he had just discovered the very beautiful theorem that every positive integer is the sum of at most three triangular numbers, every positive integer is the sum of at most four squares, every positive integer is the sum of at most five pentagonal numbers, and so on ad infinitum, but added, however, that he could not give the proof, since it depended on ‘numerous and abstruse mysteries of numbers’. Fermat planned to devote an entire book to these mysteries and to ‘effect in this part of arithmetic astonishing advances over the previously known limits’. Unfortunately, he never published such a book. In 1798, in The´orie des nombres, the Italian mathematician and astronomer, Joseph-Louis Lagrange, used an identity discovered by the Swiss mathematician Leonhard Euler [OILER] to prove Fermat’s claim for the case of square numbers. Karl Friedrich Gauss proved the result for triangular numbers when he was nineteen and wrote in his mathematical 18 The intriguing natural numbers diary for 10 July 1796: ‘åırçkÆ! num ¼ m þ m þ m:’ Two years later, Gauss’s result was proved independently by the French mathematician, Adrien Marie Legendre. In the introduction to Disquisitiones arithmeticae (Arithmetical Investigations) Gauss explains his indebtedness to Diophantus’s Arithmetica. In Chapters 5, 6, and 8, we discuss the contents of Gauss’s Disquisitiones. In 1808, Legendre included a number of quite remarkable number theoretic results in his The´orie des nombres; in particular, the property that every odd number not of the form 8k þ 7, where k is a positive integer, can be expressed as the sum of three or fewer square numbers. In 1815, Augustin-Louis Cauchy proved that every positive integer is the sum of m m-gonal numbers of which all but four are equal to 0 or 1. Cauchy’s Cours d’analyse, published in 1821, advocated a rigorous approach to mathematical analysis, in particular to the calculus. Unfortunately, Cauchy was very careless with his correspondence. Evariste Galois and Niels Henrik Abel sent brilliant manuscripts to Cauchy for his examination and evaluation, but they were lost. One of the first results Fermat established was that nine times any triangular number plus one always yielded another triangular number. Fermat later showed that no triangular number greater than 1 could be a cube or a fourth power. Fermat, always the avid number theorist, once challenged Lord Brouncker, first President of the Royal Society, and John Wallis, the best mathematician in England at the time, to prove there is no triangular number other than unity that is a cube or a fourth power. Neither was able to answer his query. Fermat often used the margins of texts to record his latest discoveries. In 1670, Fermat’s son, Cle´ment-Samuel, published a reprint of Bachet’s Diophantus together with his father’s marginal notes and an essay by the Jesuit, Jacques de Billy, on Fermat’s methods for solving certain types of Diophantine-type equations. His most famous marginal note, the statement of his ‘last’ theorem, appears in his copy of Bachet’s edition of the Arithmetica. Fermat wrote to the effect that it was impossible to separate a cube into two cubes, or a biquadratic into two biquadratics, or generally any power except a square into two powers with the same exponent. Fermat added that he had discovered a truly marvelous proof of this result; however, the margin was not large enough to contain it. Fermat’s Last Theorem was ‘last’ in the sense that it was the last major conjecture by Fermat that remained unproven. Fermat’s Last Theorem has proven to be a veritable fountainhead of mathematical research and until recently its proof eluded the greatest mathematicians. In ‘The Devil and Simon Flagg’ 1.1 Polygonal numbers 19 Arthur Porges relates a delightful tale in which the Devil attempts to prove Fermat’s Last Theorem. The Swiss mathematician, Leonhard Euler, perused a copy of Bachet’s Diophantus with Fermat’s notes and was intrigued by Fermat’s emphasis on integer, rather than rational, solutions. At the University of Basel, Euler was a student of Johann Bernoulli. Bernoulli won the mathematical prize offered by the Paris Academy twice. His son Daniel Bernoulli won it ten times. Euler, who won the prize twelve times, began a lifelong study of number theory at age 18. Euler’s papers are remarkably readable. He has a good historical sense and often informs the reader of things that have impressed him and of ideas that led him to his discoveries. Even though over half of Euler’s 866 publications were written when he was blind, he laid the foundation of the theory of numbers as a valid branch of mathematics. His works were still appearing in the Memoirs of the St Petersburg Academy fifty years after his death. It is estimated that he was responsible for one-third of all the mathematical work published in Europe from 1726 to 1800. He had a phenomenal memory and knew Vergil’s Aeneid by heart. At age 70, given any page number from the edition he owned as a youth, he could recall the top and bottom lines. In addition, he kept a table of the first six powers of the first hundred positive integers in his head. Before proceeding further, it is important in what follows for the reader to be able to distinguish between a conjecture and an open question. By a conjecture we mean a statement which is thought to be true by many, but has not been proven yet. By an open question we mean a statement for which the evidence is not very convincing one way or the other. For example, it was conjectured for many years that Fermat’s Last Theorem was true. It is an open question, however, whether 4! þ 1 ¼ 52, 5! þ 1 ¼ 112, and 7! þ 1 ¼ 712 are the only solutions to the equation n! þ 1 ¼ m2. Exercises 1.1 1. An even number can be expressed as 2n and an odd number as 2n þ 1, where n is a natural number. Two natural numbers are said to be of the same parity if they are either both even or both odd, otherwise they are said to be of opposite parity. Given any two natural numbers of the same parity, show that their sum and difference are even. Given two numbers of opposite parity, show that their sum and difference are odd. 20 The intriguing natural numbers 2. Nicomachus generalized oblong numbers to rectangular numbers, which are numbers of the form n(n þ k), denoted by rn,k, where k > 1 and n . 1. Determine the first ten rectangular numbers that are not oblong. 3. Prove algebraically that the sum of two consecutive triangular numbers is always a square number. 4. Show that 9tn þ 1 [Fermat], 25tn þ 3 [Euler], and 49tn þ 6 [Euler] are triangular. 5. Show that the difference between the squares of any two consecutive triangular numbers is always a cube. 6. In 1991, S.P. Mohanty showed that there are exactly six triangular numbers that are the product of three consecutive integers. For example, t20 ¼ 210 ¼ 5 . 6 . 7. Show that t608 is the product of three consecutive positive integers. 7. Show that the product of any four consecutive natural numbers plus one is square. That is, show that for any natural number n, n(n þ 1)(n þ 2)(n þ 3) þ 1 ¼ k2, for some natural number k. 8. The nth star number, denoted by Ãn, represents the sum of the nth square number and four times the (n À 1)st triangular number, where Ã1 ¼ 1. One geometric interpretation of star numbers is as points arranged in a square with equilateral triangles on each side. For example Ã2 is illustrated in Figure 1.12. Derive a general formula for the nth star number. 9. Show that Gauss’s discovery that every number is the sum of three or fewer triangular numbers implies that every number of the form 8k þ 3 can be expressed as the sum of three odd squares. 10. Verify Nicomachus’s claim that the sum of the odd numbers on any row in Figure 1.9 is a cube. 11. For any natural number n prove that (a) s2nþ1 ¼ sn þ snþ1 þ 2on. [Nicomachus] (b) s2n ¼ onÀ1 þ on þ 2sn. [Nicomachus] Figure 1.12 1.1 Polygonal numbers 21 12. Show that sn þ tnÀ1 ¼ p5 n, for any natural number n. [Nicomachus] 13. Prove that p5 n ¼ 3tnÀ1 þ n, for any natural number n. [Nicomachus] 14. Show that every pentagonal number is one-third of a triangular num- ber. 15. Find a positive integer n . 1 such that 12 þ 22 þ 32 þ Á Á Á þ n2 is a square number. [Ladies’ Diary, 1792] This problem was posed by Edouard Lucas in 1875 in Annales de Mathe´matique Nouvelles. In 1918, G. N. Watson proved that the problem has a unique solution. 16. Prove the square of an odd multiple of 3 is the difference of two triangular numbers, in particular show that for any natural number n, [3(2n þ 1)]2 ¼ t9nþ4 À t3nþ1. 17. Show that there are an infinite number of triangular numbers that are the sum of two triangular numbers by establishing the identity t[ n( nþ3)þ1]=2 ¼ t nþ1 þ t n( nþ3)=2. 18. Prove that t2mnþm ¼ 4m2 tn þ tm þ mn, for any positive integers m and n. 19. Paul Haggard and Bonnie Sadler define the nth m-triangular number, T mn, by T m n ¼ n(n þ 1) Á Á Á (n þ m þ 1)=(m þ 2). When m ¼ 0, we obtain the triangular numbers. Generate the first ten T 1 n numbers. 20. Derive a formula for the nth hexagonal number. The first four hexago- nal numbers 1, 6, 15, 28 are illustrated geometrically in Figure 1.13. 21. Show that 40 755 is triangular, pentagonal, and hexagonal. [Ladies’ Diary, 1828] 22. Use the method of finite differences to derive a formula for the nth m- gonal number pmn. [Diophantus] 23. Prove that for any natural numbers m and n, pmþ1 n ¼ pmn þ p3 nÀ1. [Nicomachus] 24. Prove that pm nþr ¼ pmn þ pmr þ nr(m À 2), where n, m, and r, are natural numbers and m . 2. [Bachet] Figure 1.13 22 The intriguing natural numbers 25. Prove that pmn ¼ p3 n þ (m À 3) p3 nÀ1. [Bachet] 26. In 1897, G. Wertheim devised a method to determine in how many ways a number r appears as a polygonal number. He used the fact that pmn ¼ 1 2 n(2 þ (m À 2)( n À 1)), let 2r ¼ n(2 þ (m À 2)(n À 1)) ¼ n . s, and concentrated on such factorizations of 2r where 2 , n , s and n À 1 divides s À 2. For example, 72 ¼ 3 . 24 ¼ 6 . 12 ¼ 8 . 9 ¼ n . s. Hence, 36 ¼ p133 ¼ p46 ¼ p38. Using Wertheim’s method deter- mine how many ways 120 appears as a polygonal number. 27. In the 1803 edition of Recreations in Mathematics and Natural Philo- sophy, a revision of a text first published by Ozanam in 1692 and revised by Jean Etienne Montucla in 1778, it is stated that a number n is m-gonal if 8n(m À 2) þ (m À 4)2 is a square number. Use Ozanam’s rule to show that 225 is octagonal. 28. Derive Ozanam’s rule. 29. Use the method of finite differences to show that the nth tetrahedral number, P3 n, is given by n(n þ 1)(n þ 2)=6. [Aryabhata] 30. There are only five numbers less than 109 which are both triangular and tetrahedral, namely, 1, 10, 120, 1540, and 7140. Show that 1540 and 7140 are both triangular and tetrahedral. 31. Show that P4 n ¼ P3 nÀ1 þ P3 n, for any natural number n. 32. Show that P5 n ¼ 1 3 n(2 n2 þ 1), for any natural number n. 33. Show Pmn ¼ n þ 6 1 (2 pmn þ n), for any natural numbers m and n, where m > 3. The relation between pyramidal and polygonal numbers appears in a fifth century Roman codex. 34. The nth octahedral number, denoted by On, is defined as the sum of the nth and (n À 1)st pyramidal numbers. Determine the first 10 octahedral numbers. 35. Use the binomial representation of figurate numbers to show that f 2 n represents the nth triangular number and f 3 n represents the nth tetrahedral number. 36. Justify the formula, f 3 nÀ1 þ f 3 n ¼ n(n þ 1)(2n þ 1)=6, found in an ancient Hindu manuscript. 37. In the fall of 1636, Fermat wrote to Marin Mersenne and Gilles Persone de Roberval that he had discovered that n . f r nþ1 ¼ (n þ r) . f rþ1 n, where n and r are natural numbers. Justify Fermat’s formula. 1.2 Sequences of natural numbers 23 38. Show that a general solution to Problem 17 in Book III of Diophanus’s Arithmetica, find x, y, z such that xy þ x þ y, yz þ y þ z, zx þ z þ x, xy þ z, xz þ y, and yz þ x are square, is given by x ¼ n2, y ¼ (n þ 1)2, and z ¼ 4(n2 þ n þ 1). 39. Use algebra to solve Gerbert’s problem: given the area and length of the hypotenuse of a right triangle, find the lengths of the sides of the triangle. 40. The nth central trinomial coefficient, denoted by an, is defined as the coefficient of xn in (1 þ x þ x2)n. Determine an for 0 < n < 10. 1.2 Sequences of natural numbers A sequence is a finite or infinite ordered linear array of numbers. For example, 2, 4, 6, 8, . . . represents the infinite sequence of even positive integers. Analytically, an infinite sequence can be thought of as the range of a function whose domain is the set of natural numbers. For example, polygonal, oblong, pyramidal, and figurate numbers are examples of infinite sequences of natural numbers. In this section, we investigate a number of patterns that arise from imposing various conditions on the terms of a sequence. The construction of some sequences can seem to be almost diabolical. For example, each successive term in the sequence 1, 5, 9, 31, 53, 75, 97, . . . is obtained by adding 4 to the previous term and reversing the digits. Properties of look and say sequences were developed by John H. Conway at Cambridge University. For example, each successive term in the look and say sequence 1, 11, 21, 1 211, 111 221, 312 211, . . . is generated from the previous term as follows: the first term is 1, the second term indicates that the first term consists of one one, the third term indicates that the second term consists of two ones, the fourth term indicates that the third term consists of one two and one one, the fifth term indicates that the fourth term consists of one one, one two, and two ones, and so forth. A look and say sequence will never contain a digit greater than 3 unless that digit appears in the first or second term. In 1615, Galileo remarked that 1 3 ¼ 1 5 þ þ 3 7 ¼ 1þ3þ5 7 þ 9 þ 11 ¼ Á Á Á : Hence, we call a sequence a1, a2, a3, . . . a Galileo sequence with ratio k, for k a positive integer, if it has the property that S2n=Sn ¼ k þ 1 or, equivalently, S2n À Sn ¼ kSn, where Sn denotes the nth partial sum, a1 þ a2 þ a3 þ Á Á Á þ an. Thus, the increasing sequence of odd positive Table 1.5. n an an þ 4 (an þ 4)=10 1 2 0 3 4 7 0.4 0.7 3 4 6 12 10 16 1.0 1.6 5 6 7 8 9 10 ... 24 48 96 192 384 768 ... 28 52 100 196 388 772 ... 2.8 5.2 10.0 19.6 38.8 77.2 ... Actual distance (AU) 0.387 0.723 Mercury Venus 1 Earth 1.52 Mars 5.2 Jupiter 9.59 Saturn 19.2 30.1 Uranus Neptune 39.5 Pluto 1.2 Sequences of natural numbers 25 natural numbers is a Galileo sequence with ratio 3. If a1, a2, a3, . . . is a Galileo sequence with ratio k, then, for r a positive integer, ra1, ra2, ra3, . . . is also a Galileo sequence with ratio k. A strictly increasing Galileo sequence a1, a2, a3, . . . , with ratio k > 3, can be generated by the recursive formulas !! a2nÀ1 ¼ (k þ 1)an À 1 2 and !! a2n ¼ (k þ 1)an 2 þ 1, for n > 2, where a1 ¼ 1, a2 ¼ k, for k > 2, and ½½xŠŠ denotes the greatest integer not greater than x. For example, when k ¼ 3, the formula generates the sequence of odd natural numbers. For k ¼ 4, the Galileo sequence generated is 1, 4, 9, 11, 22, 23, 27, 28, 54, 56, . . . : One of the most intriguing sequences historically is generated by Bode’s law. The relation was discovered in 1766 by Johann Daniel Titius, a mathematician at Wittenberg University, and was popularized by Johann Bode [BO duh], director of the Berlin Observatory. According to Bode’s law, the distances from the Sun to the planets in the solar system in astronomical units, where one astronomical unit equals the Earth–Sun distance or approximately 93 million miles, can be obtained by taking the sequence which begins with 0, then 3, then each succeeding term is twice the previous term. Then 4 is added to each term and the result is divided by 10, as shown in Table 1.5. Initially, Bode’s law is a fairly accurate predictor of the distances to the planets from the Sun in astronomical units. The penultimate row in Table 1.5 gives the actual average distance from the planets to the Sun in astronomical units. Bode became an astronomical evangelist for the law and formed a group called the celestial police to search for a missing planet 2.8 AU from the Sun. On January 1, 1801, the first day of the nineteenth century, Father Giuseppe Piazzi at the Palermo Observatory found what he thought was a new star in the constellation Taurus and informed Bode of his discovery. Bode asked the 23-year-old Gauss to calculate the object’s orbit. It took Gauss two months to devise a technique, the method of least squares, that would take an observer a few hours to calculate the orbit of a body in 3-space. The previous method, due to Euler, took numerous observations and several weeks of calculation. Using Gauss’s method the object was rediscovered December 7, 1801 and named Ceres, after the Roman goddess of vegetation and protector of Sicily. Three 26 The intriguing natural numbers years later another minor planet was discovered. A few years later another sun object was discovered, then another. Today the orbits of about 80 000 minor planets are known. Almost all minor planets ply orbits between those of Mars and Jupiter, called the asteroid belt. Their average distance from the Sun is amazingly close to 2.8 AU. Superincreasing sequences of positive integers have the property that each term is greater than the sum of all the preceding terms. For example, 2, 4, 8, 16, 32, . . . , 2n, . . . is an infinite superincreasing sequence and 3, 9, 14, 30, 58, 120, 250, 701 is a finite superincreasing sequence with eight terms. We will use superincreasing sequences in Chapter 7 to create knapsack ciphers. Consider the sequence of positive integers where each succeeding term is the sum of the decimal digits of the previous term. More formally, if Sr(n) denotes the sum of the rth powers of the decimal digits of the positive integer n the general term to the sequences will be ak ¼ S k r ( n) ¼ S r(S kÀ1 r ( n)) where r ¼ 2. In particular, since 12 þ 22 ¼ 5, 52 ¼ 25, 22 þ 52 ¼ 29, and 22 þ 92 ¼ 85, the sequence generated by 12 is given by 12, 5, 25, 26, 85, 89, 145, 42, 20, 4, 16, 37, 58, 89, 145, . . . Numbers whose sequences eventually reach the cycle 4, 16, 37, 58, 89, 145, 42, 20 of period 8 as 12 does are called sad numbers. A positive integer n is called happy if S2m(n) ¼ 1, for some positive integer m. The height of a happy number is the number of iterations necessary to reach unity. For example, 31 is a happy number of height two and 7 is a happy number of height five. For any positive integer 10n is happy and 2(10)n is sad, hence there are an infinite numbers of both happy and sad numbers. About 1/7 of all positive integers are happy. In 2002, E. El-Sedy and S. Siksek showed the existence of sequences of consecutive happy integers of arbitrary length. In 1945, Arthur Porges of the Western Military Academy in Alton, Illinois proved that every positive integer is either happy or sad. A natural generalization of happy and sad numbers is to sequences formed where each succeeding term is the sum of the rth powers of the digits of the previous term. That is, when the general term of the sequence is ak ¼ S k r ( n) with r . 2 a positive integer. For example when r ¼ 3, eight distinct cycles arise. In particular, 33 þ 73 þ 13 ¼ 371. Hence, 371 self- replicates. In 1965, Y. Matsuoka proved that if n is a multiple of 3 then there exists a positive integer m such that S3m(n) ¼ 153, another selfreplecate. A positive integer n is called a cubic happy number is S3m(n) ¼ 1, for some positive integer m. Sidney sequences, a1, a2, . . . , an, named for their 15-year-old disco- verer Sidney Larison of Ceres, California, are defined as follows: given any 1.2 Sequences of natural numbers 27 m-digit natural number a1a2 Á Á Á am, let the first m terms of the Sidney sequence be a1, a2, . . . , am; then, for k . m, ak is defined to be the units digit of akÀm þ Á Á Á þ akÀ2 þ akÀ1, the sum of the previous m terms of the sequence. A Sidney sequence terminates when the last m terms of the sequence match the first m terms of the sequence. For example, with m ¼ 2 the Sidney sequence for 76 is given by 7, 6, 3, 9, 2, 1, 3, 4, 7, 1, 8, 9, 7, 6. For the case when m ¼ 2, Larison showed there are six different repeating patterns generated by Sidney sequences. One of the cycles has period 60, a property noted by Lagrange in 1744 when he discovered that the units digits of the Fibonacci numbers form a sequence with period 60. When m ¼ 3, there are 20 patterns, and 11 exist if m ¼ 4. Similar results occur if we are given an m-digit natural number and proceed to construct a product instead of a sum. Undoubtedly, the most famous sequence of natural numbers is the Fibonacci sequence, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, . . . , un . . . , where u1 ¼ 1, u2 ¼ 1, and unþ1 ¼ un þ unÀ1. The sequence first appeared in Europe in 1202 in Liber abaci by Leonardo of Pisa, more commonly known as Fibonacci. Albert Girand, a mathematician from the Netherlands and a disciple of Vie`te, first defined the sequence recursively in 1634 in a posthumous publication. Fibonacci numbers were used prior to the eighth century to describe meters in Sanskrit poetry. Fibonacci first mentions the sequence in connection with the number of pairs of rabbits produced in n months, beginning with a single pair, assuming that each pair, from the second month on, begets a new pair, and no rabbits die. The number of pairs of rabbits after n months is the sum of the number of pairs which existed in the previous month and the number of pairs which existed two months earlier, because the latter pairs are now mature and each of them now produces another pair. In Figure 1.14, An represents the nth pair of rabbits in their first month and Bn the nth pair of rabbits in succeeding months. The sequence never gained much notoriety until the late nineteenth century when Edouard Lucas popularized the sequence in The´orie des nombres and attached the name Fibonacci to it. Lucas was a French artillery officer during the Franco-Prussian War and later taught at the Lyce´e Saint-Louis and at the Lyce´e Charlemagne in Paris. In Mathematical Recreations, he introduced the Tower of Hanoi puzzle where, according to Lucas, three monks of Benares in northeastern India (not Vietnam) maintained a device consisting of three pegs onto which 64 different sized disks were placed. Initially, all the disks were on one peg and formed a pyramid. The monks’ task was to move the pyramid from one peg to another peg. 28 The intriguing natural numbers A1 1 B1 1 A2 B1 2 B2 A3 B1 3 A4 B2 B3 A5 B1 5 B4 A6 B2 A7 B3 B5 A8 Figure 1.14 B1 8 The rules were simple. Only one disk could be moved at a time from one peg to another peg, and no larger disk could be placed on a smaller disk. According to legend, when the monks finished their task the world would end. Lucas explained how it would take at least 264 À 1 moves to complete the task. At the rate of one move a second, the monks would take almost 6 3 109 centuries to complete their task. Unfortunately, Lucas died of erysipelas after a freak accident in a restaurant where a waiter dropped a tray of dishes and a shard gashed his cheek. Lucas numbers, denoted by vn, are defined recursively as follows: vnþ1 ¼ vn þ vnÀ1, v1 ¼ 1, and v2 ¼ 3. Lucas originally defined vn to be u2n=un. He derived many relationships between Fibonacci and Lucas numbers. For example, unÀ1 þ unþ1 ¼ vn, un þ vn ¼ 2unþ1, and vnÀ1 þ vnÀ1 ¼ 5un. The sequence of Lucas numbers is an example of a Fibonaccitype sequence, that is, a sequence a1, a2, . . . , with a1 ¼ a, a2 ¼ b, and anþ2 ¼ anþ1 þ an, for n > 2. Fibonacci numbers seem to be ubiquitous in nature. There are abundant references to Fibonacci numbers in phyllotaxis, the botanical study of the arrangement or distribution of leaves, branches, and seeds. The numbers of petals on many flowers are Fibonacci numbers. For example, lilies have 3, buttercups 5, delphiniums 8, marigolds 13, asters 21, daisies 21 and 34. In addition, poison ivy is trifoliate and Virginia creeper is quinquefoliate. The fraction 10000=9899 has an interesting connection with Fibonacci numbers for its decimal representation equals 1:010 203 050 813 213 455 . . . : There are only four positive integers which are both Fibonacci numbers and triangular numbers, namely, 1, 3, 21, and 55. There are only 1.2 Sequences of natural numbers 29 three number which are Lucas and triangular numbers, namely, 1, 3, and 5778. In 1963, J. H. E. Cohn showed that except for unity, the only square Fibonacci number is 144. Geometrically, we say that a point C divides a line segment AB, whose length we denote by jABj, in the golden ratio when jABj=jACj ¼ jACj=jCBj, as shown in Figure 1.15. Algebraically, let jACj ¼ a and jABj ¼ b; then b=a ¼ a=(b À a), hence, b2 À ab ¼ a2. Dividing both sides of the equation by ap2 ffiffiand setting x ¼ b=a, we obtain x2 ¼ x þp1ffiffi, whose roots are ô ¼ (1 þ 5)=2, the golden ratio, and ó ¼ (1 À 5)=2, its reciprocal. It is thought by many who search for human perfection that the height of a human body of divine proportion divided by the height of its navel is the golden ratio. One of the most remarkable connections between the Fibonacci sequence and the golden ratio, first discovered by Johannes Kepler the quintessential number cruncher, is that as n approaches infinity the limit of the sequence of ratios of consecutive Fibonacci numbers, unþ1=un, approaches ô, the golden ratio. Using only Euclidean tools, a compass and a straightedge, a line segment AB may be divided in the golden ratio. We construct DB perpendicular to AB, where jDBj ¼ 12jABj, as shown in Figure 1.16. Using a compass, mark off E on AD such that jDEj ¼ jDBj and C on AB so that jACj ¼ jAEj. From the construction, it follows that jABj=jACj ¼ pô. ffiffi Golden right triangles have their sides in the proportion 1: ô: ô. In 1992, Duane DeTemple showed that there is a golden right triangle a A C B b Figure 1.15 D E A C B Figure 1.16 30 The intriguing natural numbers associated with the isosceles triangle of smallest perimeter circumscribing a given semicircle. Rectangles whose sides are of length a and b, with b=a ¼ ô, are called golden rectangles. In the late nineteenth century, a series of psychological experiments performed by Gustav Fechner and Wilhelm Wundt indicated that golden rectangles were the quadrilaterals which were, aesthetically, most pleasing to the eye. Such rectangles can be found in 3 3 5 file cards, 5 3 8 photographs, and in Greek architecture, in particular, in the design of the Parthenon. A golden rectangle can be constructed from a square. In particular, given a square ABCD, let E be the midpoint of side DC, as shown in Figure 1.17. Use a compass to mark off F on DC extended such that jEFj ¼ jEBj. Mark off G on AB such that jAGj ¼ jDFj, and join GF, CF, and BG. From the construction, it follows that jAGj=jADj ¼ ô. Hence, the quadrilateral AGFD is a golden rectangle. In 1718, Abraham de Moivre, a French mathematician who migrated to England when Louis XIV revoked the Edict pofffiffi Nantes in 1685, cplaffiiffimed that un ¼ (ôn À ó n)=(ô À ó ), where ô ¼ (1 þ 5)=2 and ó ¼ (1 À 5)=2. The first proof was given in 1728 by Johann Bernoulli’s nephew Nicolas. Independently, the formula was established by Jacques-Philippe-Marie Binet in 1843 and by Gabriel Lame´ a year later. It is better known today as Binet’s or Lame´’s formula. pffiffi Since ô þ ó ¼ 1, ô À ó ¼ 5, multiplying both sides of the identity ô2 ¼ ô þ 1 by ôn, where n is any positive integer, we obtain ônþ2 ¼ ônþ1 þ ôn. Similarly, ó nþ2 ¼ ó nþ1 þ ó n. Thus, ônþ2 À ó nþ2 ¼ (ônþ1 þ ôn) À (ó nþ1 þ ó n) ¼ (ônþ1 À ó nþ1) þ (ôn À ó n). Dividing both sides by ô À ó and letting an ¼ (ôn À ó n)=(ô À ó ), we find that a nþ2 ¼ ô nþ2 ô À À ó ó nþ2 ¼ ô nþ1 ô À À ó ó nþ1 þ ôn ô À À ó ó n ¼ a nþ1 þ an, with a1 ¼ a2 ¼ 1. Hence, A B G D E C F Figure 1.17 1.2 Sequences of natural numbers 31 an ¼ ôn ô À À ó ó n ¼ un, the nth term in the Fibonacci sequence. Another intriguing array of natural numbers appears in Blaise Pascal’s Treatise on the Arithmetic Triangle. The tract, written in 1653, was published posthumously in 1665. Pascal was a geometer and one of the founders of probability theory. He has been credited with the invention of the syringe, the hydraulic press, the wheelbarrow, and a calculating machine. Pascal left mathematics to become a religious fanatic, but returned when a severe toothache convinced him that God wanted him to resume the study of mathematics. Pascal exhibited the triangular pattern of natural numbers, known as Pascal’s triangle, in order to solve a problem posed by a noted gamester, Chevalier de Me´re´. The problem was how to divide the stakes of a dice game if the players were interrupted in the midst of their game. For further details, see [Katz]. Each row of the triangle begins and ends with the number 1, and every other term is the sum of the two terms immediately above it, as shown in Figure 1.18. Pascal remarked that the nth row of the triangle yields the binomial coefficients found in the expansion of (x þ y)n. The triangular array, however, did not originate with Pascal. It was known in India around 200 BC and appears in several medieval Islamic mathematical texts. The frontispiece of Zhu Shijie’s Precious Mirror of the Four Elements contains a diagram of the triangle (Figure 1.19). In 1261, the triangular array appeared in Yang Hui’s (CHANG WAY) A Detailed Analysis of the Mathematical Methods in the ‘Nine Chapters’. Yang Hui noted that his source for the diagram was The Key to Mathematics by Jia Xian (GEE AH SHE ANN), an eleventh century work which has been lost. Yang Hui’s method of extracting square roots uses the formula (a þ b)2 ¼ a2 þ (2a þ b)b, with a as an initial value. Cubic roots were extracted using the formula (a þ b)3 ¼ a3 þ (3a2 þ 3ab þ b2)b. Higher 1 11 121 1331 14641 1 5 10 10 5 1 1 6 15 20 15 6 1 ................................ Figure 1.18 32 The intriguing natural numbers Figure 1.19 roots can be extracted by generalizing the formula using higher-order binomial coefficients. Prior to the introduction of the hand calculator such methods were sometimes taught in schools. Similar arrangements of numbers can be found in the works of Persian mathematicians Al-Karaji and Omar Khayyam. Pascal’s triangle first appeared in Europe in 1225 in 1.2 Sequences of natural numbers 33 Jordanus de Nemore’s On Arithmetic and was conspicuously displayed on the title page of the 1527 edition of Peter Apian’s Arithmetic. In 1524 Apian published a popular but very laborious method to calculate longitude using the Moon. In the eighteenth century, John Harrison constructed a reliable chronometer that enabled navigators to determine their longitude more accurately and with fewer calculations. In 1544, the triangle used as a tool in root extraction played a prominent role in Stifel’s Complete Arithmetic. In 1556, the array appeared in Niccolo´ of Brescia’s General Treatise. Niccolo´ was commonly known as Tartaglia, the stammerer, owing to an injury received as a boy. In Italy, the triangular array is known as Tartaglia’s triangle. The figurate-binomial relationship first observed by Stifel was rediscovered in 1631 by Henry Briggs, inventor of common logarithms, and William Oughtred [AWE tread], inventor of the slide rule. Oughtred worked at mathematics at a country vicarage in Albury, Surrey, where he served as rector and gave mathematical instruction to any who came to him provided they could write clearly. Oughtred believed that mathematics improved reasoning power and was a pathway to the understanding of God. Oughtred complained that many a good notion was lost and many a problem went unsolved because his wife took away his candles right after dinner. He was ecstatic when one of his pupils, perhaps John Wallis, brought him a box of candles. Pascal’s name was first attached to the array in 1708 by Pierre Re´mond de Montmort. Pascal’s original arrangement, shown in Table 1.6, is Table 1.6. f m n n m 0 1 2 3 4 5 6 7 8 9 10 0 1 11 1 1 1 1 11 1 1 1 1 23 4 5 6 7 8 9 10 . . . 2 1 3 6 10 15 21 28 36 45 . . . 3 1 4 10 20 35 56 84 120 . . . 4 1 5 15 35 70 126 210 . . . 5 1 6 21 56 126 252 . . . 6 1 7 28 84 210 . . . 7 1 8 36 120 . . . 8 1 9 45 . . . 10 1 ... 34 The intriguing natural numbers fundamentally a table of figurate numbers. Even though the array did not originate with Pascal, the conclusions that he drew from it with respect to solving problems in probability went far beyond any of his predecessors. In the seventeenth century, Rene´ Franc¸ois de Sluse remarked that the sums of the slant ENE–WSW diagonals of Pascal’s triangle in Figure 1.20 yield the Fibonacci numbers, a result rediscovered by Edouard Lucas in 1896. In this text, you will encounter a number of mechanical computational procedures or algorithms. An algorithm is a specific set of rules used to obtain a given result from a specific input. The word is a Latin corruption of al-Khwarizmi, a ninth century mathematician–astronomer, member of the House of Wisdom in Baghdad, and author of a very influential work, al-Kitab al-muhtasar fi hisab al-jabar wa-l-muqabala (The Condensed Book on Comparing and Restoring), the text from which our word ‘algebra’ derives. One must wonder if students would be even more reticent about high school mathematics if they were required to take two years of ‘muqabala’. In many cases, as we shall see, algorithms can generate very interesting sequences of natural numbers. For example, the Collatz algo- rithm, named for Lothar O. Collatz of the University of Hamburg who devised it in the 1930s, a nþ1 is ¼ as ( follows: an 2 given any positive integer if an is even, and a1, let 3an þ 1 if an is odd: Collatz conjectured that for any natural number the sequence generated eventually reached unity. John Selfridge, of Northern Illinois University, has shown this to be the case for all natural numbers less than 7 3 1011. The conjecture is one of the more well-known unsolved problems in number theory, as is the question of whether there is an upper limit to the number of iterations in the Collatz algorithm necessary to reach unity. Any 1 1 2 1 3 5 11 8 121 13 1331 14641 1 5 10 10 5 1 1 6 15 20 15 6 1 ................................ Figure 1.20 1.2 Sequences of natural numbers 35 slight adjustment of the algorithm may change the outcome. For example, if 3an þ 1 is replaced by 3an À 1, when an is odd, three distinct cycles are generated. An interesting procedure, albeit not as intriguing as the Collatz algorithm, is the Kaprekar algorithm devised in 1949 by the Indian mathematician D.R. Kaprekar (kuh PREE kur). Kaprekar’s sort–reverse–subtract routine goes as follows: given a four-digit natural number larger than 1000 for which not all digits are equal, arrange the digits in descending order, subtract the result from its reverse (the number with the digits in ascending order). Successive applications of this algorithm result in the four-digit Kaprekar constant, the self-replicating number 6174. For example, for 1979, we have 9971 À1799 8172 8721 À1278 7443 7443 À3447 3996 9963 À3699 6264 6642 À2466 4176 7641 À1467 6174 Given any m-digit number n, with not all digits the same and m . 2, let Mn and mn denote the largest and smallest positive integers obtainable from permuting the digits of n and let K(n) ¼ Mn À mn. The m-digit Kaprekar constant, denoted by km, is the integer such that successive iterations of K on any m-digit positive integer generate km and K(km) ¼ km. For four-digit numbers the Kaprekar constant is 6174. The digital root of a positive integer n, denoted by r(n), is the single digit obtained by adding the digits of a number. If the sum obtained has more than one digit, then the process is repeated until a single digit is obtained. For example, since 7 þ 4 þ 3 þ 2 þ 8 ¼ 24 and 2 þ 4 ¼ 6, the digital root of 74 328 is 6, that is, r(74 328) ¼ 6. For natural numbers m and n, r(r(n)) ¼ r(n), r(n þ 9) ¼ r(n), and the pairs r(mn) and r(m)r(n), and r(n Æ m) and r(n) Æ r(m), have the same remainder when divided by 9. For any positive integer k we may construct the auxiliary sequence a1, a2, . . . , an, . . . , where a1 ¼ k and anþ1 ¼ an þ r(an). From this sequence, the digital root sequence r(a1), r(a2), . . . can be generated. For example, the auxiliary sequence for 12 is given by 12, 15, 21, 24, 30, 33, 39. Hence, the digital root sequence for 12 is given by 3, 6, 3, 6, 3, 6, 3, . . . : In 1979, V. Sasi Kumar showed that there are only three basic digital root sequences. We end this section with two sequences generated by the digits of a number, one constructed additively, the other multiplicatively. The digital sum sequence is defined as follows: let a1 be any natural number. For k > 2, define ak ¼ akÀ1 þ sd(akÀ1), where sd(n) denotes the sum of the digits of n. In 1906, A. Ge´radin showed that the 19th term of the digital 36 The intriguing natural numbers sum sequence whose 1st term is 220 and the 10th term of the digital sum sequence whose 1st term is 284 both equal 418. In 1973, Neil Sloane of AT&T Bell Labs, author of A Handbook of Integer Sequences, devised a sequence of natural numbers by defining each successive term in the sequence as the product of the digits of the preceding term. Sloane defined the persistence of a natural number as the number of steps required to obtain a single digit number. For example, the persistence of 74 is 3 since its persistence sequence is 74, 28, 16, 6. The smallest number with persistence 2 is 25. The smallest number with persistence 1 is 10. Sloane showed that no number less than 1050 has a persistence greater than 11. He conjectured that there is a natural number N such that every natural number has persistence less than N. Sloane’s online encyclopedia of integer sequences contains an interactive database of information on known sequences. Currently, the website averages 30,000 hits a day and adds approximately 40 new sequences a day to the database. Given any two positive integers m and n, S. Ulam defined the sequence of u(m, n)-numbers, a1, a2, a3, . . . , such that a1 ¼ m, a2 ¼ n and for k . 2, ak is the least integer greater than akÀ1 uniquely expressible as ai þ aj for 1 < i , j < k À 1, that is, as the sum of two distinct previous terms of the sequence. For example, if m ¼ 1 and n ¼ 2, then the first u(1, 2)-numbers are 1, 2, 3, 4, 6, 8, 11, 13, 16, 18, 26, 28, 36, 38, 47, 48, 53, 57, 62, 69, 72, 77, 82, 87, 97, 99, and so forth. Note that 3 ¼ 1 þ 2, 4 ¼ 1 þ 3, however, 5 ¼ 2 þ 3 ¼ 4 þ 1. Thus, 5 does not have a unique representation as a sum of previous terms and, hence, does not belong in the sequence. There are a number of open questions concerning u(1, 2)numbers. For example, are there infinitely many numbers which are not the sum of u(1, 2)-numbers? Are there infinitely many pairs of consecutive u(1, 2)-numbers. Are there arbitrarily large gaps in the sequence of u(1, 2)-numbers? Ulam worked as a mathematician on the Manhattan Project in Los Alamos which led to the development of the first atomic bomb. Similarly, given any two positive integers m and n, we define the sequence of v(m, n)-numbers b1, b2, b3, . . . , such that b1 ¼ m, b2 ¼ n, and for k . 2, bk is the least integer greater than bkÀ1 that is not of the form bi þ bj, for 1 < i , j < k À 1. That is, each succeeding term in the sequence is the next positive integer that cannot be written as a sum of two previous terms of the sequence. For example, the first ten v(2, 5)-numbers are 2, 5, 6, 9, 10, 13, 17, 20, 21, 24. These concepts can be generalised. For example, the sequence of 1.2 Sequences of natural numbers 37 u(a1, a2, a3, . . . , an)-numbers, a1, a2, a3, . . . , has the property that for k . n ak is the least integer greater than akÀ1 uniquely expressible as ai þ aj, for 1 < i , j < k À 1. The sequence of v(b1, b2, b3, . . . , bn)numbers, b1, b2, b3, . . . , has the property that for k . n, bk is the least integer greater than bkÀ1 that can not be represented as bi þ bj, for 1 < i , j < k. Exercises 1.2 1. Determine the next three terms in the look and say sequence 1, 11, 21, 1 211, 111 221, 312 211, . . . : 2. Explain why a look and say sequence cannot contain a digit greater than 3 unless that digit appears in the first or second term. 3. Generate the first ten terms of a Galileo sequence with ratio 5 and first term 1. 4. Which of the following are superincreasing sequences? (a) 2, 3, 6, 12, 25, 50, 99, 199, 397, (b) 3, 5, 9, 18, 35, 72, 190, 1009, (c) 4, 7, 12, 24, 48, 96, 192, 384, 766. 5. Determine the next three terms of the sequence 1, 5, 9, 31, 53, 75, 97, . . . , and the rule that generates the sequence. 6. Determine the next three terms of the sequence 5, 8, 21, 62, 86, 39, 74, 38, . . . , and the rule that generates the sequence. 7. Are the following natural numbers happy or sad? (a) 392, (b) 193, (c) 269, (d) 285, (e) 521. 8. Determine the nine cycles that occur in sequences of natural numbers where each succeeding term is the sum of the cubes of the digits of the previous number. 9. Determine the six cycles that occur if succeeding terms of a sequence are the sum of the fourth powers of the digits of the previous term. 10. Determine the six different cycles that result from applying Sidney’s algorithm to two-digit numbers. What is the sum of the periods of the six cycles? 11. Given any m-digit natural number a1a2 Á Á Á am, let the first m terms of the sequence be a1, a2, . . . , am; then, for k . m, akþ1 is defined to be the units digit of the product of the previous nonzero m terms of the sequence. The sequence terminates when a repeating pattern of digits occurs. What repeating patterns result from this Sidney product sequence algorithm for m ¼ 2? (for m ¼ 3?) 12. For what values of n is un, the nth Fibonacci number, even. 38 The intriguing natural numbers 13. Show that the sum of any 10 consecutive Fibonacci-type numbers is always equal to 11 times the seventh term in the sequence. 14. Show that ô ¼ (1 þ (1 þ (1þ Á Á Á)1=2)1=2)1=2 (hint: square both sides of the equation). 15. In Figure 1.16, show that jABj=jACj ¼ ô. 16. In Figure 1.17, show that jAGj=jADj ¼ ô. 17. A golden box is a parallelepiped whose height, width, and length are in the geometric proportion ó:1:ô. Show that a golden box may also be defined as a parallelepiped whose height, width, and length are in the geometric proportion 1:ô:ô2. 18. Determine the first ten Lucas numbers. 19. Show that 5p77ffi8ffi is a triangular–Lupcffiaffis number. 20. If ô ¼ (1 þ 5)=2 and ó ¼ (1 À 5)=2, show that vn ¼ ôn þ ó n. 21. The tribonacci numbers an are defined recursively as follows: a1 ¼ a2 ¼ 1, a3 ¼ 2, and an ¼ anÀ1 þ anÀ2 þ anÀ3, for n > 4. Generate the first 20 tribonacci numbers. 22. The tetranacci numbers bn are defined as follows: b1 ¼ b2 ¼ 1, b3 ¼ 2, b4 ¼ 4, and bn ¼ bnÀ1 þ bnÀ2 þ bnÀ3 þ bnÀ4, for n > 5. Generate the first 20 tetranacci numbers. 23. Verify the Collatz conjecture for the following numbers: (a) 9, (b) 50, (c) 121. 24. Determine the three cycles that occur when 3an À 1 is substituted for 3an þ 1 in the Collatz algorithm. 25. Perform the Kaprekar routine on the following natural numbers until you obtain the Kaprekar constant: (a) 3996, (b) 1492, (c) your birth year, (d) the current calendar year. 26. Use the Kaprekar algorithm to determine the three-digit Kaprekar constant for three-digit numbers. 27. The reverse–subtract–reverse–add algorithm is stated as follows: given a three-digit natural number with the outer two digits differing by at least 2, reverse the digits of the number and subtract the smaller from the larger of the two numbers to obtain the number A, take A, reverse its digits to obtain the number B, add A and B. The sum, A þ B, will always be 1089. Verify this algorithm for the following numbers: (a) 639, (b) 199, (c) 468. 28. Given a four-digit number n for which not all the digits are equal, let abcd represent the largest integer possible from permuting the digits a, b, c, d of n, that is, so a > b > c > d. The Trigg operator, T(n), is defined such that T(n) ¼ badc À cdab. The Trigg constant is the 1.2 Sequences of natural numbers 39 integer m such that iterations of T always lead to m and T (m) ¼ m. Determine the Trigg constant. 29. Determine the three basic digital root sequences. 30. For any natural number n prove that r(n þ 9) ¼ r(n), where r(n) denotes the digital root of n. 31. Show that the 19th term of the digital sum sequence whose 1st term is 220 and the 10th term of the digital sum sequence whose 1st term is 284 both equal 418. 32. Determine the sum of the digits of the first million positive integers. 33. The sequence a1, a2, . . . is called a Kaprekar sequence, denoted by Ka1, if a1 is a positive integer and akþ1 ¼ ak þ sd(ak), for k . 1, where sd(n) denotes the sum of the digits of n. For example, if a1 ¼ 1, we obtain the Kaprekar sequence K1 ¼ 1, 2, 4, 8, 16, 23, 28, . . . : In 1959, Kaprekar showed that there are three types of Kaprekar sequence: (I) each term is not divisible by 3, (II) each term is divisible by 3 but not by 9, and (III) each term is divisible by 9. For example, K1 is type I. Determine the Kaprekar type for Ka1, when a1 ¼ k, for 2 < k < 10. 34. Kaprekar called a positive integer a self number if it does not appear in a Kaprekar sequence except as the first term. That is, a natural number n is called a self, or Columbian, number if it cannot be written as m þ sd(m), where m is a natural number less than n. For example, 1 and 3 are self numbers. Determine all the self numbers less that 100. 35. In The Educational Times for 1884, Margaret Meyer of Girton College, Cambridge, discovered a set of conditions under which a number n is such that sd(n) ¼ 10 and sd(2n) ¼ 11. Find such a set of conditions. 36. Determine the persistence of the following natural numbers: (a) 543, (b) 6989, (c) 86 898, (d) 68 889 789, (e) 3 778 888 999. 37. Determine the smallest natural numbers with persistence 3, with persistence 4, with persistence 5. 38. Determine the first 15 u(1, 3)-numbers. 39. Determine the first 15 u(2, 3)-numbers. 40. Determine the first 30 u(2, 5)-numbers. 41. Determine the first 15 u(2, 3, 5)-numbers. 42. Determine the first 15 v(1, 2)-numbers. 43. Determine the first 15 v(1, 3)-numbers. 44. Determine the first 15 v(3, 4, 6, 9, 10, 17)-numbers. 45. Define the sequence a1, a2, . . . of w(m, n)-numbers as follows. Let a1 ¼ m, a2 ¼ n, and ak, for k . 2, be the unique smallest number 40 The intriguing natural numbers greater than akÀ1 equal to a product aia j, where i , j , k. Determine the first eight w(2, 3)-numbers. 1.3 The principle of mathematical induction Most students of mathematics realize that a theorem is a statement for which a proof exists, a lemma is a subordinate theorem useful in proving other theorems, and a corollary is a result whose validity follows directly from a theorem. Proofs of theorems and lemmas may be constructive or nonconstructive, that is, in general, practical or elegant. It should also be evident that in mathematical problems, ‘establish’, ‘show’ and ‘prove’ are the same commands. One of the most important techniques in establishing number theoretic results is the principle of mathematical induction. The method was first employed by Pascal in 1665 and named as such by Augustus De Morgan in 1838. It is a technique that is not very satisfying to students since it is usually nonconstructive and does not give any clue as to the origin of the formula that it verifies. Induction is not an instrument for discovery. Nevertheless, it is a very important and powerful tool. The principle of mathematical induction follows from the well-ordering principle which states that every nonempty set of natural numbers has a least element. Theorem 1.1 (Principle of mathematical induction) Any set of natural numbers that contains the natural number m, and contains the natural number n þ 1 whenever it contains the natural number n, where n > m, contains all the natural numbers greater than m. Proof Let S be a set containing the natural number m and the natural number n þ 1 whenever it contains the natural number n, where n > m. Denote by T the set of all natural numbers greater than m that are not in S. Suppose that T is not empty. By the well-ordering principle T has a least element, say r. Now, r À 1 is a natural number greater than or equal to m and must lie in S. By the induction assumption, (r À 1) þ 1 ¼ r must also lie in S, a contradiction. Hence, the assumption that T is not empty must be false. We conclude that T is empty. Therefore, S contains all the natural numbers greater than m. j In most applications of the principle of mathematical induction, we are interested in establishing results that hold for all natural numbers, that is, when m ¼ 1. There is an alternate principle of mathematical induction, 1.3 The principle of mathematical induction 41 equivalent to the principle of mathematical induction stated in Theorem 1.1, in which, for a given natural number m, we require the set in question to contain the natural number n þ 1 whenever it contains all the natural numbers between m and n, where n > m. The alternate principle of mathematical induction is very useful and is stated in Theorem 1.2 without proof. Theorem 1.2 (Alternate principle of mathematical induction) Any set of natural numbers that contains the natural number m, and contains n þ 1 whenever it contains all the natural numbers between m and n, where n > m, contains all the natural numbers greater than m. The alternate principle of mathematical induction implies the well-ordering principle. In order to see this, let S be a nonempty set of natural numbers with no least element. For n . 1, suppose 1, 2, . . . , n are elements S, the complement of S. A contradiction arises if n þ 1 is in S for it would then be the least positive natural number in S. Hence, n þ 1 must be in S. From the alternate principle of mathematical induction, with m ¼ 1, S must contain all natural numbers. Hence, S is empty, a contradiction. Establishing results using induction is not as difficult as it seems and it should be in every mathematician’s repertoire of proof techniques. In Example 1.3, we use induction to establish a result known to the early Pythagoreans. Example 1.3 The sum of consecutive odd natural numbers beginning with 1 is always a square. This result first appeared in Europe in 1225 in Fibonacci’s Liber quadratorum. The statement of the problem can be expressed in the form of a variable proposition P(n), a statement whose truth or falsity varies with the natural number n, namely P(n): 1 þ 3 þ 5 þ Á Á Á þ (2n À 1) ¼ n2. In order to establish the truth of P(n), for all natural numbers n, using induction, we first show that P(1) is true. This follows since 1 ¼ 12. We now assume that proposition P(n) holds for an arbitrary value of n, say k, and show that P(k þ 1) follows from P(k). Since we are assuming that P(n) holds true for n ¼ k, our assumption is P(k): 1 þ 3 þ 5 þ 7 þ Á Á Á þ (2k À 1) ¼ k2: Adding 2k þ 1 to both sides yields 1 þ 3 þ 5 þ 7 þ Á Á Á þ (2k À 1) þ (2k þ 1) ¼ k2 þ (2k þ 1), or 42 The intriguing natural numbers 1 þ 3 þ 5 þ 7 þ Á Á Á þ (2k À 1) þ (2k þ 1) ¼ (k þ 1)2, establishing the truth of P(k þ 1). Hence, by the principle of mathematical induction, P(n) is true for all natural numbers n. Example 1.4 We show that u1 þ u2 þ Á Á Á þ un ¼ unþ2 À 1, where n is any natural number and un represents the nth Fibonacci number. We have u1 ¼ 1 ¼ 2 À 1 ¼ u3 À 1, hence P(1) is true. Assume that P(n) is true for an arbitrary natural number k, hence, we assume that u1 þ u2 þ u3 þ Á Á Á þ uk ¼ ukþ2 À 1. Adding ukþ1 to both sides of the equation we obtain u1 þ u2 þ u3 þ · · · þ uk þ ukþ1 ¼ (ukþ2 À 1) þ ukþ1 ¼ (ukþ1 þ ukþ2) À 1 ¼ ukþ3 À 1. Thus, P(k þ 1) follows from P(k), and the result is established for all natural numbers by the principle of mathematical induction. It is important to note that verifying both conditions of the principle of mathematical induction is crucial. For example, the proposition P(n): 1 þ 3 þ 5 þ Á Á Á þ (2n À 1) ¼ n3 À 5n2 þ 11n À 6 is only true when n ¼ 1, 2, or 3. Further, P(n): 1 þ 3 þ 5 þ Á Á Á þ (2n À 1) ¼ n2 þ n(n À 1)(n À 2) Á Á Á (n À 1000) is true for n ¼ 1, 2, 3, . . . , 1000 and only those natural numbers. Algebraically, the proposition P(n): 1 þ 3 þ 5 þ Á Á Á þ (2n À 1) ¼ n2 þ 5 implies the proposition P(n þ 1): 1 þ 3 þ 5 þ Á Á Á þ (2n À 1) þ (2n þ 1) ¼ (n þ 1)2 þ 5. However, P(n) is not true for any value of n. In the exercises the reader is asked to establish formulas for the natural numbers, many of which were known to the ancient mathematicians. Exercises 1.3 Establish the following identities for all natural numbers n, unless otherwise noted, where un and vn represent the general terms of the Fibonacci and Lucas sequences, respectively. 1. 12 þ 22 þ 32 þ Á Á Á þ n2 ¼ n(n þ 1)(2n þ 1) : 6 2. 12 þ 32 þ 52 þ Á Á Á þ (2n À 1)2 ¼ n(4n2 À 1) : [Fibonacci] 3 3. 1 1 . 2 þ 2 1 . 3 þ 3 1 . 4 þ ÁÁÁ þ 1 n(n þ 1) ¼ n n þ 1 : 4. t1 þ t2 þ Á Á Á þ tn ¼ n( n þ 1)( n 6 þ 2) : [Aryabhata] 5. 13 þ 23 þ 33 þ Á Á Á þ n3 ¼ (1 þ 2þ Á Á Á n)2. [Aryabhata Bachet] 1.4 Miscellaneous exercises 43 6. (1 þ a)n > 1 þ na, where a is any real number greater than À1. [Jakob Bernoulli] 7. n! . n2 for all natural numbers n . 3. 8. u1 þ u3 þ u5 þ Á Á Á þ u2nÀ1 ¼ u2n. 9. u21 þ u22 þ u23 þ Á Á Á þ u2n ¼ ununþ1: 10. u2 þ u4 þ u6 þ Á Á Á þ u2n ¼ u2nþ1 À 1. [Lucas] 11. un > ônÀ2: 12. u2nþ1 À u2n ¼ unÀ1unþ2, if n > 1. [Lucas] 13. un þ vn ¼ 2unþ1. [Lucas] 14. vnÀ1 þ vnþ1 ¼ 5un, for n > 2. [Lucas] 15. vn ¼ unÀ1 þ unþ1 if n > 2. [Lucas] 16. u2n ¼ unvn. [Lucas] 17. u2nþ2 À u2n ¼ u2nþ2. [Lucas] 18. In 1753 Robert Simson proved that unþ1unÀ1 þ (À1)nþ1 ¼ u2n, for n . 1. Use induction to establish the formula. 19. If S ¼ fa1, a2, a3, . . .g is a set of natural numbers with a1 . a2 . a3 . . . . , then show S is finite. 20. Show that there are no natural numbers between 0 and 1. 21. Prove Wallis’s result concerning figurate numbers, namely for natural numbers n and r, f r nþ1 ¼ f 1n þ f 2n þ ÁÁÁ þ f r n . 1.4 Miscellaneous exercises 1. Show that 1 533 776 805 is a triangular, pentagonal, and hexagonal number. 2. A natural number is called palindromic if it reads the same backwards as forwards. For example, 3 245 423 is palindromic. Determine all two- and three-digit palindromic triangular numbers. 3. Show that the squares of 1 270 869 and 798 644 are palindromic. 4. Show that the squares of the numbers 54 918 and 84 648 are pandigital, that is they contain all the digits. 5. In 1727, John Hill, of Staffordshire, England, claimed that the smallest pandigital square was (11 826)2. Was he correct? 6. The number 16 583 742 contains all the digits except 9 and 0. Show that 90 . 16 583 742 is pandigital. 7. A positive integer n is called k-transposable if, when its leftmost digit is moved to the unit’s place, the result is k . n. For example, 285 714 is 3-transposable since 857 142 ¼ 3 . 285 714. Show that 142 857 is 3transposable. 8. A number n is called automorphic if its square ends in n. For example, 44 The intriguing natural numbers 25 is automorphic since 252 ¼ 625. Show that 76 and 625 are automorphic. 9. A number is called trimorphic if it is the nth triangular number and its last digits match n. For example, 15 is trimorphic since it is the fifth triangular number and it ends in 5. Show that 325, 195 625, and 43 959 376 are trimorphic. 10. A number is called a Kaprekar number if its square can be partitioned in ‘half’ such that the sum of the first half and the second half equals the given number. For example, 45 is a Kaprekar number since 452 ¼ 2025 and 20 þ 25 ¼ 45. Show that 297, 142 857 and 1 111 111 111 are Kaprekar numbers. 11. A number is called an Armstrong number if it can be expressed as a sum of a power of its digits. For example 407 is Armstrong since 407 ¼ 43 þ 03 þ 73. Show that 153 and 371 are Armstrong numbers. 12. A number is called narcissistic if its digits can be partitioned in sequence so that it can be expressed as a power of the partitions. For example, 101 is narcissistic since 101 ¼ 102 þ 12. All Armstrong numbers are narcissistic. Show that 165 033 is narcissistic. 13. A number a1a2 . . . an is called handsome if there exist natural num- bers x1, x2, ..., xn such that a1 a2 ... an ¼ a1x1 þ a2x2 þ ÁÁÁ þ a xn n . For example 24 is handsome since 24 ¼ 23 þ 42. Show that 43, 63, 89 and 132 are handsome. 14. A number abcd is called extraordinary if abcd ¼ abcd. Show that 2592 is extraordinary. 15. A number is called curious if it can be expressed as the sum of the factorials of its digits. For example 1, 2, and 145 are curious since 1 ¼ 1!, 2 ¼ 2!, 145 ¼ 1! þ 4! þ 5! Show that 40 585 is curious. 16. Multiplying 142 857 by 2, 3, 4, 5 or 6 permutes the digits of 142 857 cyclically. In addition, 4 times 2178 reverses the digits of 2178. Show that multiplying by 4 reverses the digits of 21 978 and 219 978 and multiplying by 9 reverses the digits of 10 989. 17. Determine how long it will take to return all the gifts mentioned in the song ‘The twelve days of Christmas’ if the gifts are returned at the rate of one gift per day. 18. Take the month that you were born, January ¼ 1, December ¼ 12, etc., multiply by 5, and add 6. Then multiply the result by 4 and add 9. Then take that result, multiply by 5, and add the day of the month that you were born. Now from the last result subtract 165. What does the answer represent? 19. Given any integer between 1 and 999, multiply it by 143. Take the 1.4 Miscellaneous exercises 45 number represented by the last three digits of the result and multiply it by 7. The number represented by the last three digits of this result is the original number. Explain why. 20. Note that 2666 6665 ¼ 266 665 ¼ 26 65 ¼ 25, and 16 64 ¼ 14. Find all pairs of two-digit numbers ab and bc with the property that ab=bc ¼ a=c. 21. The following puzzle was devised by William Whewell [YOU ell], Master of Trinity College, Cambridge. Represent each of the first 25 natural numbers using exactly four nines, any of the four basic operations (addition, subtraction, multiplication,paffinffi d division), parentheses and, if absolutely necessary, allowing 9 ¼ 3 and :9 ¼ 1. Whewell was a philosopher of science and historian who, in his correspondence with Michael Faraday, coined the terms anode, cath- ode, and ion. He also introduced the terms ‘‘physicist’’ and ‘‘scientist’’. Obtain a solution to Whewell’s puzzle. 22. Exhibit 25 representations for zero using Whewell’s conditions. 23. Solve Whewepllffi’ffis puzzle using four fours, the four basic operations and, if necessary, 4 and/or 4! 24. Prove that ô ¼ lim unþ1 : n!1 un 25. Consider integer solutions to the equation x1 þ x2 þ Á Á Á þ xn ¼ x1 . x2 Á Á Á xn, where x1 < x2 < Á Á Á < xn. For example, when n ¼ 2, we have 2 þ 2 ¼ 2 . 2, hence, x1 ¼ x2 ¼ 2 is a solution. Find a general solution to the equation. 26. Gottfried Leibniz and Pietro Mengoli determined the sum of the reciprocals of the triangular numbers, X 1 n¼1 1 tn ¼ 1 þ 1 3 þ 1 6 þ 1 10 þ Á Á Á : What does the sum equal? 27. A lone reference to Diophantus in the form of an epitaph appears in the Greek Anthology of Metrodorus, a sixth century grammarian. According to the translation by W.R. Paton, ‘This tomb holds Dio- phantus. Ah, how great a marvel! the tomb tells scientifically the measure of his life. God granted him to be a boy for the sixth part of his life, and adding a twelfth part to this, he clothed his cheeks with down; he lit him the light of wedlock after a seventh part, and five years after his marriage he granted him a son. Alas! late-born wretched child; after attaining the measure of half his father’s life, chill Fate took him. After consoling his grief by this science of numbers for four Century Year Month 0 1500 1900 2300 00 23 0268à 17 34 45 51 56à 6824à 73 90 79 January October Day 7 14 21 28 Day of Sunday the week 0 7 14 21 1 01 07 12à 18 29 35 40à 63 85 4668à 91 57 7946à May 1 8 15 22 29 Monday 1 8 15 22 Table 1.7. 2 3 1800 2200 2042à 13 30 19 41 47 69 52à 75 5880à 86 97 Februaryà August 2 9 16 23 30 Tuesday 2 9 16 23 03 25 08à 31 1346à 4624à 87 53 7902à 59 81 98 February March November 3 10 17 24 31 Wednesday 3 10 17 24 4 1700 2100 09 15 20à 26 37 43 48à 71 5746à 65 82 93 99 June 4 11 18 25 Thursday 4 11 18 5 04à 27 1302à 21 38 49 55 60à 6868à 77 94 83 September December 5 12 19 26 Friday 5 12 19 6 1600à 22400000Ãà 05 11 16à 22 33 39 44à 67 5702à 61 78 89 95 Januaryà April July 6 13 20 27 Saturday 6 13 20 1.4 Miscellaneous exercises 47 years he ended his life.’ How old was Diophantus when he died? (Hint: if n denotes his age at his death then, according to the epitaph, n=6 þ n=12 þ n=7 þ n=2 þ 9 ¼ n.) 28. De Morgan and Whewell once challenged each other to see who could come the closest to constructing sentences using each letter in the alphabet exactly once, precursors to ‘the quick brown fox jumps over the lazy dog’ and ‘pack my box with five dozen liquor jugs’. It was decided that De Morgan’s ‘I, quartz pyx, who flung muck beds’ just edged out Whewell’s ‘phiz, styx, wrong, buck, flame, quid’. Try your hand at the equally hard puzzle of trying to come up with a 26-word abecedarian phrase such that each word begins with a different letter of the alphabet in lexicographical order. 29. Table 1.7 is based on the Gregorian calendar that began replacing the Julian calendar in 1582. The table may be used to find the day of the week, given the date, by adding the figures at the top of each column and noting what column contains the sum. Asterisks denote leap years. For example, consider December 7, 1941. Century 19 0 Year 41 2 Month December 5 Day 7 0 SUM 7 Therefore, from Table 1.7, we find that December 7, 1941 was a Sunday. What day of the week was July 4, 1776? 30. On what day of the week were you born? 31. What was the date of the fourth Tuesday in June 1963? 32. What was the date of the first Tuesday of October 1917? 33. What day of the week was August 31, 1943? 34. Even though weekday names were not common until the fourth century, use the fact that in most Catholic countries Thursday October 4, 1582 in the Julian calendar was followed by Friday October 15, 1582 in the Gregorian and that all century years, prior to 1700, were leap years to determine the day of the week that each of these events occurred: (a) the Battle of Hastings (October 14, 1066), (b) the signing of Magna Carta (June 15, 1215), and (c) the marriage of Henry VIII and Ann Boleyn (January 25, 1533). 35. At a square dance each of the 18 dancers on the floor is identified with a distinct natural number from 1 to 18 prominently displayed on their 48 The intriguing natural numbers back. Suppose the sum of the numbers on the back of each of the 9 couples is a square number. Who is dancing with number 6? 36. An even natural number n is called a square dance number if the numbers from 1 to n can be paired in such a way that the sum of each pair is square. Show that 48 is a square dance number. 37. Determine all the square dance numbers. 38. John H. Conway and Richard K. Guy have defined an nth order zigzag number to be an arrangement of the numbers 1, 2, 3, . . . , n in such a manner that the numbers alternately rise and fall. For example, the only first and second order zigzag numbers are 1 and 12, respectively. There are two third order zigzag numbers, namely, 231 and 132. There are five fourth order zigzag numbers, namely, 3412, 1423, 2413, 1324, and 2314. Determine all fifth order zigzag numbers. 39. In 1631, Johann Faulhaber of Ulm discovered that 1kÀ1 þ 2kÀ1 þ Á Á Á þ nkÀ1 ¼ 1 k nk þ (1k )nkÀ1 . À1 2 þ (2k )nkÀ2 . 1 6 ! þ (3k ) n kÀ3 . 0 þ (4k )nkÀ4 . À1 30 þ ÁÁÁ : The coefficients, 1, À12, 16, 0, À310, 0, . . . , are called Bernoulli numbers and appear in the 1713 edition of Jakob Bernoulli’s Ars conjectandi. In general, (nþ1 1)Bn þ ( nþ1 2 ) B nÀ1 þ ÁÁÁ þ ( nþn1 ) B1 þ B0 ¼ 0: Hence, B0 ¼ 1, B1 ¼ À12, B2 ¼ 16, B3 ¼ 0, B4 ¼ À310, B5 ¼ 0, and so forth. For example, 5B4 þ 10B3 þ 10B2 þ 5B1 þ B0 ¼ 0. Hence, B4 ¼ À310. In addition, if n . 1, then B2nþ1 ¼ 0. Find the Bernoulli numbers B6, B8, and B10. 40. Lucas defined the general term of a sequence to be wn ¼ u3n=un. Determine the first six terms of the sequence. Is the sequence gener- ated a Fibonacci-type sequence? 41. Given the 2 3 2 matrix  A¼ 1 1 1 0 , use induction to show that, for n > 1,   An ¼ u nþ1 un un u nÀ1 , 1.4 Miscellaneous exercises 49 where un represents the nth Fibonacci number with the convention that u0 ¼ 0. 42. If  A¼ 1 1 1 0 , find a numerical value for the determinant of An. 43. Evaluate 32 12 þ þ 42 22 þ þ 52 32 þ þ 62 42 þ þ 72 52 þ þ 82 62 þ þ 92 72 : 44. Establish the following algebraic identity attributed to the Indian mathematician Srinivasa Ramanujan: (a þ 1)(b þ 1)(c þ 1) þ (a À 1)(b À 1)(c À 1) ¼ 2(a þ b þ c þ abc): 45. Ramanujan stated a number of formulas for fourth power sums. Estab- lish his assertion that a4 þ b4 þ c4 ¼ 2(ab þ bc þ ca)2 provided a þ b þ c ¼ 0. 46. Prove or disprove that 3an À anþ1 ¼ unÀ1(unÀ1 þ 1), for n > 1, where an denotes the coefficient of xn in (1 þ x þ x2)n, for n ¼ 0, 1, 2, . . . , and un represents the nth Fibonacci number. 47. The curriculum of universities in the Middle Ages consisted of the seven liberal arts, seven flags flew over Texas, Rome and Providence, Rhode Island, were built on seven hills. Determine the following septets: (a) the seven wonders of the ancient world; (b) the seven sages of antiquity; (c) the seven wise women of antiquity. 48. In 1939, Dov Juzuk established the following extension to Nicoma- chus’s method of generating the cubes from an arithmetic triangle. Show that if the even rows of the arithmetic triangle shown below are deleted, the sum of the natural numbers on the first n remaining rows is given by n4. For example, 1 þ (4 þ 5 þ 6) þ (11 þ 12 þ 13 þ 14 þ 15) ¼ 81 ¼ 34. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ............................................................. 49. In 1998, Ed Barbeau of the University of Toronto generalized Nicoma- 50 The intriguing natural numbers chus’s cubic result to hexagonal numbers. Show that if the even rows of the arithmetic triangle shown below are deleted, the sum of the natural numbers on the first n remaining rows is given by ( p6 n)2. For example, 1 þ (5 þ 6 þ 7 þ 8 þ 9) þ (17 þ 18 þ Á Á Á þ 25) ¼ 225 ¼ ( p63)2. 1 234 56789 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 .......................................................... 50. If every other row in the following triangle is deleted, beginning with the second row, identify the partial sums of the first n remaining rows. Hint: there are 3n À 2 numbers in the nth row. 1 23 45 678 9 10 11 12 13 14 15 16 17 18 19 20 21 22 1.5 Supplementary exercises 1. Use the method of finite differences to determine a formula for the general term of the sequence 2, 12, 28, 50, 78, 112, . . . 2. Use the method of finite differences to determine a formula for the general term of the sequence whose first seven terms are: 14, 25, 40, 59, 82, 109, 149, . . . Hint: Match the first diagonal of finite differences with that of f (n) ¼ an3 þ bn2 þ cn þ d. 3. Use the method of finite differences to determine a formula for the general term of the sequence whose first seven terms are: 5, 19, 49, 101, 181, 295, 449, . . . 4. Given the following array 2 21 2 31 2 541 2 7951 2 9 16 14 6 1 2 11 25 30 20 7 1 2 13 26 55 50 27 8 1 ..................................... 1.5 Supplementary exercises 51 where a(i, j), the element in the ith row and jth column, is obtained by successive additions using the recursive formula a(i, j) ¼ a(i À 1, j À 1) þ a(i À 1, j), the second column consists of the odd positive integers and the third column squares of the positive integers, determine a formula for the positive integers 1, 5, 14, 30, 50, . . . in the fourth column. 5. Determine a formula for the general term of the sequence 1, 6, 20, 50, . . . in the fifth column of the previous exercise. 6. Determine a general formula for a(i, j), in Exercise 5, where i > j. 7. Generalize the result in Exercise 4 in Section 1.1, by finding functions f (m), g(m) h(m, n) such that f (m)tn þ g(m) ¼ th(m,n). 8. Show that n3 þ 6t n þ 1 ¼ (n þ 1)3. [Bachet] 9. Show that tmþn ¼ tm þ tn þ mn. [Bachet] 10. Which triangular number is 2nÀ1(2n À 1)? 11. Can every positive integer be expressed as a difference of two nonconsecutive triangular numbers? If so, in how may ways? 12. Show that 3 divides t3k and t3kþ2 but not t3kþ1. 13. Let rn ¼ t n=3. Show that r12kþ5 and r12kþ6 are both odd, r12k and r12kþ11 are both even. 14. Show that both r12kþ2 and r12kþ3 have opposite parity, as do r12kþ8 and r12kþ9. 15. Show that each of the first fifty positive integers can be expressed as a sum of pentagonal numbers. 16. Find two hexagonal numbers such that their sum plus one is square and their difference minus one is square. 17. A positive integer is called pheptagonal if it is palindromic and heptagonal. Determine the first six pheptagonal numbers. 18. According to Nicomachus, oddly-even numbers are positive integers of the form 2n(2n þ 1) and oddly-odd numbers are numbers of the form (2m þ 1)(2n þ 1). Determine the first fifteen oddly-even numbers and the first fifteen oddly-odd numbers. 19. Bantu numbers are positive integers that do not contain a ‘‘2’’ when expressed decimally. List the first twenty-five bantu numbers. 20. Eban numbers are positive integers that can be written in English without using the letter ‘e’. Determine the first twenty eban numbers. 21. Curvaceous numbers are those positive integers that can be written with curves only, for example 3, 6, 8, and 9. Determine the first fifteen curvaceous numbers. 22. Cheap numbers are positive integers formed using 1, 2 and 3, but not two of them. The first ten cheap numbers are 1, 2, 3, 11, 22, 33, 111, 52 The intriguing natural numbers 222, 333, 1111. Cheaper numbers are positive integers formed using any two of 1, 2, or 3. Cheapest numbers are positive integers formed using only 1, 2, and 3. Determine the first twenty-five cheaper numbers and the first fifteen cheapest numbers. 23. A Stern number an, first described by M.A. Stern in 1838, is a positive integer such that a1 ¼ 1 and an is the sum of the previous n À 1 numbers. Determine the first fifteen Stern numbers. 24. A positive integer is called a neve number if it is nonpalindromic, even, and remains even when the digits are reversed. Determine the first fifteen neve numbers. 25. A positive integer is called strobogrammatic if it is vertically palindromic, for example, 8 and 96. Determine the first fifteen strobogrammatic numbers. 26. Generate the first six terms of a Galileo sequence with first term 1 and ratio 6. 27. Generate the first six terms of a Galileo sequence with first term 2 and ratio 6. 28. A positive integer is called phappy if it is palindromic and happy. Determine the first five phappy numbers. 29. Happy couple numbers are consecutive positive integers that are both happy. Determine the first twenty-five happy couples. 30. What is the value of the smallest happy number of height 3, of height 4, of height 5, and of height 6. 31. Investigate the outcome of successive iterations of S3 on positive integers of the form 3k þ 1 and of the form 3k þ 2, for k a positive integer. 32. Let Sr,b(n) denote the sum of the rth powers of the digit in base b and S kr,b(n) ¼ Sr,b(S kr,Àb1(n)). For example, in base 3 with r ¼ 3, 2 ! 22 ! 121 ! 101 ! 2. Investigate the action of S3,3 on the first 25 positive integers. 33. Find the height of the cubic happy number 112. 34. Find the cubic heights of 189 and 778. 35. Determine the least positive integer with persistence 6. 36. Investigate properties of the Pell sequence, determined by P0 ¼ 0, P1 ¼ 1, and Pnþ1 ¼ 2Pnþ1 þ Pn. 37. A MacMahon sequence is generated by excluding all the sums of two or more earlier members of the sequences. For example, if a1 ¼ 1 and a2 ¼ 2, the sequence formed is 1, 2, 4, 5, 8, 10, 14, 15, 16, 21. Determine the next ten terms of the sequence. 38. The general term of a Hofstader sum sequence has the property that it 1.5 Supplementary exercises 53 is the least integer greater than the preceding term that can be expressed as a sum of two or more consecutive terms of the sequence. For example, if a1 ¼ 1 and a2 ¼ 2, the first twelve terms of the resulting Hofstadter sum sequence are 1, 2, 3, 5, 6, 8, 10, 11, 14, 16, 17, 18. Determine the next twelve terms of the sequence. 39. The general term of a Hofstater product sequence is defined as follows, given a1, a2, . . . , an form all possible products ai . a j À 1 with 1 < i , j < n and append them to the sequence. For example, the first ten terms of the Hofstader sequence with a1 ¼ 2 and a2 ¼ 3 are 2, 3, 5, 9, 14, 17, 26, 27, 33, 41. Determine the next ten terms of the sequence. 40. Define f r(n) to be the least number of rs that can be used to represent n using rs and any number of plus and times signs and parentheses. For example, f 1(2) ¼ 2 since 2 ¼ 1 þ 1. Determine f 1(3k) for k a positive integer. 41. In 1972, D.C. Kay investigated properties of the following generalized Collatz algorithm given by anþ1 ¼ an= p if pjn and anþ1 ¼ an . q þ r if p B n. Investigate the actions of the generalized algorithm on the positive integers when ( p, q, r) ¼ (2, 5, 1). 42. Determine the next two rows of the Lambda Triangle 1 2 3 4 6 9 8 12 18 27 43. Determine the next three terms of the sequence 71, 42, 12, 83, 54, . . . 44. A postive integer is called pfibonacci if it is palindromic and Fibo- nacci. Determine the first six pfibonacci numbers. 45. If an denotes the nth tribonacci number determine limn!1(anþ1=an). 46. If bn denotes the nth tetrancci number determine limn!1(bnþ1=bn). 47. If d n denotes the nth deacci number (add the previous ten terms) where the first ten terms are 1, 1, 2, 4, 8, 16, 32, 64, 128, 256, determine limn!1(d nþ1=d n). 48. Determine the first fifteen u(3, 4) numbers. 49. Determine the first fifteen v(3, 4) numbers. 50. Show for any positive integer n: 13 þ 33 þ 53 þ Á Á Á þ (2n À 1)3 ¼ n2(2n2 À 1). 51. For any positive integer n show that 1 . 2 þ 2 . 3 þ Á Á Á þ n(n þ 1) ¼ n(n þ 1)(n þ 2) : 3 52. For any positive integer n show that 54 The intriguing natural numbers 1 3 þ 1 15 þ 1 35 þ Á Á Á þ 1 4n2 À 1 ¼ 2n n þ 1 : 53. For any positive integer n show that 2 þ 5 þ 8 þ Á Á Á þ (3n À 1) ¼ n(3n þ 1) : 2 54. If un and vn represent the nth Fibonacci and Lucas numbers, respec- tively, show that un þ vn ¼ 2unþ1. 55. Show that for any positive integer n, (vnþ1)2 À (vn)2 ¼ vnÀ1vnþ2. 56. Show that for any positive integer n, (vnþ2)2 À (vn)2 ¼ 5u2nþ2. 57. Show that for any positive integer n, u2nþ1 þ u2n ¼ u2nþ1. 58. Show that for any positive integer n, u3nþ1 þ u3n À u3nÀ1 ¼ u3n. 59. Show that for any positive integer n, u3nþ2 À 3u3n þ u3nÀ2 ¼ 3u3n. 60. For any positive integer n, establish the Gelin-Cesa`ro identity 61. unÀ2 . unÀ1 . unþ1 . unþ2 À u4n ¼ À1. Given a positive integer n an expression of the form n ¼ Pmk¼0åk uk, where the åk equal 0 or 1, åkåkþ1 ¼ 0 for 1 < k < m, and un denotes the nth Fibonacci number is called a Zeckendorf representation of n. We may denote the Zeckendorf representation of n using the function Z(n), which represents binarily the Fibonacci numbers in the Zeck- endorf representation of n. For example, 30 ¼ 21 þ 8 þ 1, hence Z(30) ¼ 101001. Determine Zeckendorf representations for the first fifty positive integers and the associated function Z(n). 62. Show that every positive integer has a Zeckendorf representation. 63. Compute the Zeckendorf representation for u2n, where 1 < n < 25. 64. Compute the Zeckendorf representation for v2n, where 1 < n < 25. 65. Compute the Zeckendorf representation for ununþ1, where 1 < n < 25. 66. Let un! ¼ un . unÀ1 Á Á Á u1. Find the values of un! for 1 < n10. 67. Let (nk)u ¼ un!=uk!unÀk! if n > k and 0 otherwise. Determine the 68. values of Consider (nk)u for the sum 1P<1n n¼1 < 10 1=(u n and 0 < )r, where k r < is n. a positive integer. Estimate the sum when r ¼ 1. 69. Show that (5=32)u26n is an integer, whenever n is a positive integer. 70. Show that X 1 n¼1 un 1 . unþ2 ¼ 1: 2 Divisibility If you are going to play the game, you’d better know all the rules. Barbara Jordan 2.1 The division algorithm We extend our universe of discourse from the set of natural numbers to the set of integers, . . . , À3, À2, À1, 0, 1, 2, 3, . . . , by adjoining zero and the negatives of the natural numbers. The integers are closed under addition, subtraction, and multiplication. We use the additive inverse to define subtraction. That is, by the expression a À b, we mean a þ (Àb). In order to work with integers efficiently we rely heavily on the following basic properties of addition and multiplication of integers. Properties of the integers Associativity a þ (b þ c) ¼ (a þ b) þ c a(bc) ¼ (ab)c Commutativity a þ b ¼ b þ a ab ¼ ba Distributivity a(b þ c) ¼ ab þ ac (a þ b)c ¼ ac þ bc Identity aþ0 ¼ 0þa ¼ a a.1¼1.a¼ a Inverse a þ (Àa) ¼ (Àa) þ a ¼ 0 Transitivity a . b and b . c implies a . c Trichotomy Either a . b, a , b, or a ¼ b Cancellation law If a . c ¼ b . c and c 6¼ 0, then a ¼ b: The set of rational numbers, a superset of the integers, consists of numbers of the form m=n, where m and n are integers and n 6¼ 0. We employ multiplicative inverses to define division on the rationals, that is by r Ä s we mean r Á (1=s). Since a Æ c ¼ ad Æ bc , b d bd a . c ¼ ac , b d bd and 55 56 Divisibility a Ä c ¼ ad , b d bc the rationals are closed under the binary operations of addition, subtraction, multiplication, and division (except by zero). Furthermore, every rational number can be expressed as a repeating decimal and vice versa. For example, if n ¼ 0:63, then 100n ¼ 63:63. Thus, 99n ¼ 100n À n ¼ 63. Therefore, n ¼ 63 99 ¼ 171. Conversely, since there are only n possible remain- ders when dividing by the integer n, every rational number can be ex- pressed as a repeating decimal. The rationals are not closed under the unary operation of taking the square root of a positive number. However, if we adjoin nonrepeating decimal expansions, called irrational numbers, to the rationals we obtain the real numbers. The reals are closed under the four basic binary operations (except division by zero) and the unary operation of taking the square root of a positive number. By extending the reals to the complex numbers, numbers of the form a þ bi, where a and b are real and i2 ¼ À1, we obtain a set closed under the four basic binary operations (except division by zero) and the unary operation of taking the square root. A function is a rule or correspondence between two sets that assigns to each element of the first set a unique element of the second set. For example, the absolute value function, denoted by j . j, is defined such that jxj equals x when x is nonnegative and Àx when x is negative. It follows immediately from the definition that if jxj , k, then Àk , x , k, and if jxj . k, then x . k or x , Àk. Two vertical bars, the notation used for the absolute value, were introduced by Karl Weierstrass in 1841. Weierstrass, a German mathematician, who taught at the University of Berlin, was advocate for mathematical rigor. An important property of the absolute value function is expressed in the following result. Theorem 2.1 (Triangle inequality) For any two real numbers a and b, jaj þ jbj > ja þ bj. Proof Since Àjaj < a < jaj and Àjbj < b < jbj it follows that Àjaj À jbj < a þ b < jaj þ jbj. Therefore, ja þ bj < jaj þ jbj. j We define the binary relation ‘divides’ on the integers as follows: if a and b are integers, with a 6¼ 0, and c is an integer such that ac ¼ b, then we say that a divides b and write ajb. It should be noted that there can be but one integer c such that ac ¼ b. If a divides b, then a is called a divisor of b, and b is called a multiple of a. We write a6 jb if a does not divide b. If 2.1 The division algorithm 57 a divides b with 1 < a , b, then we say that a is a proper divisor of b. The basic properties of division are listed below, where a, b and c represent integers. Properties of division (1) If a 6¼ 0, then aja and aj0. (2) For any a, 1ja. (3) If ajb and ajc then for any integers x and y, aj(bx þ cy). (4) If ajb and bjc, then ajc. (5) If a . 0, b . 0, ajb and bja, then a ¼ b. (6) If a . 0, b . 0, and ajb, then a < b. The first two properties follow from the fact that a . 1 ¼ a and a . 0 ¼ 0. In order to establish the third property, suppose that a divides b and c. There exist integers r and s such that ar ¼ b and as ¼ c. Hence, bx þ cy ¼ arx þ asy ¼ a(rx þ sy). Since bx þ cy is a mulitple of a, a divides bx þ cy. Proofs of the other properties are as straightforward and are left as exercises for the reader. From the third property, it follows that if ajb and ajc, then aj(b þ c), aj(b À c), and aj(c À b). From the definition of division and the fact that divisions pair up, it follows that, for any positive integer n, there ispaffiffiffione-to-one correspondence betwepenffiffiffi the divisors of n that are less than n and those which are greater than n. Example 2.1 Using induction, we show that 6 divides 7n À 1, for any positive integer n. Let P(n) represent the variable proposition 6 divides 7n À 1. P(1) is true since 6 divides 7 À 1. Suppose for some positive integer k, P(k) is true, that is, 6 divides 7k À 1 or, equivalently, there is an integer x such that 7k À 1 ¼ 6x. We have 7kþ1 À 1 ¼ 7 . 7k À 1 ¼ 7(6x þ 1) À 1 ¼ 6(7x þ 1) ¼ 6 y. Thus, 7kþ1 À 1 is a multiple of 6. Therefore, P(k) implies P(k þ 1) and the result follows from the principle of mathematical induction. Example 2.2 We determine three distinct positive integers a, b, c such that the sum of any two is divisible by the third. Without loss of generality, suppose that a , b , c. Since cj(a þ b) and a þ b , 2c, a þ b must equal c. In addition, since 2a þ b ¼ a þ c and bj(a þ c), bj2a. Since 2a , 2b, b must equal 2a. Hence, c ¼ a þ b ¼ 3a. Therefore, n, 2n and 3n, for any positive integer n, are three distinct integers with the property that the sum of any two is divisible by the third. 58 Divisibility Many positive integers have interesting divisibility properties. For example, 24 is the largest integer divisible by all the positive integers less than its square root. It is also the only integer greater than unity such that the sum of the squares from 1 to itself is a square. One of the most basic tools for establishing divisibility properties is the division algorithm found in Book VII of Euclid’s Elements. According to Euclid, given two line segments the shorter one can always be marked off a finite number of times on the longer length either evenly or until a length shorter than its own length remains and the process cannot continue. A more algebraic version of the division algorithm, one more appropriate for our use, is stated in the next theorem. Theorem 2.2 (The division algorithm) For any integer a and positive integer b there exist unique integers q and r with the property that a ¼ bq þ r with 0 < r , b. Proof Consider the set S ¼ fa À sb: s is an integer and a À sb > 0g. S consists of the nonnegative elements of the set f. . . , a À 2b, a À b, a, a þ b, a þ 2b, . . .g. If a , 0, then a À ab ¼ a(1 À b) > 0, hence, a À ab is in S. If a > 0, then a À (0 . b) ¼ a > 0, hence a is in S. In either case, S is a nonempty set of positive integers. By the well-ordering principle S contains a least element that we denote by r ¼ a À bq > 0. In addition, r À b ¼ (a À bq) À b ¼ a À (q þ 1)b , 0, hence, 0 < r , b. In order to show that q and r are unique, suppose that there are two other integers u, v such that a ¼ bu þ v, with 0 < v , b. If u , q, then since u and q are integers, we have u þ 1 < q. Thus, r ¼ a À bq < a À b(u þ 1) ¼ (a À ub) À b ¼ v À b , 0, contradicting the fact that r is nonnegative. A similar contradiction arises if we assume u . q. Hence, from the law of trichotomy, u ¼ q. Thus, a ¼ bq þ r ¼ bq þ v implying that v ¼ r, and the uniqueness of q and r is established. j Corollary For an integer a and positive integer b, there exist unique integers q and r such that a ¼ bq þ r, with Àjbj=2 , r < jbj=2. One of the most important consequences of the division algorithm is the fact that for any positive integer n . 1 every integer can be expressed in the form nk, nk þ 1, nk þ 2, . . . , or nk þ (n À 1), for some integer k. Equivalently, every integer either is divisible by n or leaves a remainder 1, 2, . . . , or n À 1 when divided by n. This fact is extremely useful in establishing results that hold for all integers. 2.1 The division algorithm 59 n 7k 7k þ 1 7k þ 2 7k þ 3 7k þ 4 7k þ 5 7k þ 6 Table 2.1. n2 7r 7r þ 1 7r þ 4 7r þ 2 7r þ 2 7r þ 4 7r þ 1 n3 7s 7s þ 1 7s þ 1 7s þ 6 7s þ 1 7s þ 6 7s þ 6 If we restrict our attention to division by the integer 2, the division algorithm implies that every integer is even or odd, that is, can be written in the form 2k or 2k þ 1. Since (2k)2 ¼ 4k2 and (2k þ 1)2 ¼ 4k2 þ 4k þ 1 ¼ 4(k2 þ k) þ 1, we have established the following result. Theorem 2.3 Every square integer is of the form 4k or 4k þ 1, where k is an integer. Since x2 and y2 must be of the form 4k or 4k þ 1, x2 þ y2, the sum of two squares, can only be of the form 4k, 4k þ 1, or 4k þ 2 and we have established the next result. Theorem 2.4 No integer of the form 4k þ 3 can be expressed as the sum of two squares. If we restrict ourselves to division by the integer 3, the division algorithm implies that every integer is of the form 3k, 3k þ 1, or 3k þ 2. That is, division by 3 either goes evenly or leaves a remainder of 1 or 2. Using this fact, Theon of Smyrna claimed that every square is divisible by 3 or becomes so when 1 is subtracted from it. Similarly, every integer is of the form 7k, 7k þ 1, 7k þ 2, 7k þ 3, 7k þ 4, 7k þ 5, or 7k þ 6. That is, according to the division algorithm, the only remainders possible when dividing by 7 are 0, 1, 2, 3, 4, 5, and 6. From Table 2.1, it follows that any integer that is both a square and a cube must be of the form 7k or 7k þ 1. For example, (7k þ 2)2 ¼ 49k2 þ 28k þ 4 ¼ 7k(7k þ 4) þ 4 ¼ 7r þ 4, and (7k þ 2)3 ¼ 343k3 þ 294k2 þ 8k þ 8 ¼ 7(49k3 þ 42k2 þ 12k þ 1) þ 1 ¼ 7s þ 1. Therefore, any integer that is both a square and a cube cannot be of the form 7k þ 2. In Theaetetus, Plato remarks that his teacher, Theodorus of Cyrene, 60 Divisibility pffiffi pffiffi pffiffi pffiffiffiffiffi pffiffiffiffiffi pffiffiffiffiffi proved the irrationality of 3, 5, 7, 11, 13, and 17, but he gives no indication ofpTffihffi eodorus’s method of proof. A number of proofs of the irrationality of 2 were known to ancient mathematicians. (Euclid in- cluded a generalization of the result in Book X of the Elements.) A proof that appears in Aristotle’s Prior Analytics using the fact that integers are either even or odd, is demonstrated in the next example. pffiffi Example 2.3 We use the indirect method to show that 2 is irrational. Suppose that it is rational. Thups,ffiffithere exist positive integers p and q, with no common factors, such that 2 ¼ p=q. Since p2 ¼ 2q2, p2 is even and, hence, p is even. Let p ¼ 2m; then p2 ¼ 4m2, hence, q2 ¼ 2m2. Since q2 is even, q must be even, contpraffidffi icting the assumption that p and q have no common factors. Therefore, 2 is irrational. In 1737, the irrationality of e, the base of the natural logarithm, was established by Euler. The irrationality of ð was established by Johann Lambert in 1767. Lambert was self-educated and made significant contributions to physics, mathematics, and cartography. He developed the transverse Mercator projection by projecting onto a cylinder tangent to a meridian. In physics, the lambert is a unit of brightness. In non-Euclidean geometry, a Lambert quadrilateral is a four-sided figure having three right angles. A short proof of the irrationality of e is demonstrated in the next example. Example 2.4 By definition, e ¼ 1 þ 1 1! þ 1 2! þ 1 3! þ ÁÁÁ : Suppose that e is rational, that is, e ¼ p=q, where p and q are integers with no common factors. Let e ¼ a þ b, where a ¼ 1 þ 1 1! þ 1 2! þ ÁÁÁ þ 1 q! and b ¼ (q 1 þ 1)! þ (q 1 þ 2)! þ ÁÁÁ : Multiplying both sides of the expression for e by q!, we obtain q! . e ¼ q! . a þ q! . b. Since q! . a is an integer and q! . e is an integer, it follows that q! . b, the difference of two integers, is an integer. However, 2.1 The division algorithm 61 q! . b ¼ (q 1 þ 1) þ (q þ 1 1)(q þ 2) þ (q þ 1)(q 1 þ 2)(q þ 3) þ Á Á Á , 1 2 þ 1 4 þ 1 8 þ Á Á Á ¼ 1, implying that 0 , q! . b , 1, a contradiction. Therefore, e is irrational. Most of our work in this book will be done in base 10. However, there are occasions when it is useful to consider other bases, in particular base 2. When b 6¼ 10, we use the notation nb to denote the integer n written in base b. For example, 101 1012 ¼ 45, since 1 . 25 þ 0 . 24 þ 1 . 23 þ 1 . 22 þ 0 . 2 þ 1 ¼ 45. Representing integers in bases other than base 10 is useful if such representations are unique, which we establish with the next result. Theorem 2.5 If a and b are positive integers with b . 1, then a can be uniquely represented in the form a ¼ ckbk þ ckÀ1bkÀ1 þ Á Á Á þ c1b þ c0, with integers ci such that 0 < ci , b, for i ¼ 0, 1, 2, . . . , k and ck 6¼ 0. Proof From the division algorithm, we have that a ¼ bq1 þ c0, with 0 < c0 , b and q1 , a. If q1 > b, we employ the division algorithm again to obtain q1 ¼ bq2 þ c1, with 0 < c1 , b and q2 , q1. If q2 > b, we continue the process, obtaining a decreasing sequence of positive integers q1 . q2 . . . .. Eventually, we obtain a positive number, say qk, such that qk , b. Set qk ¼ ck. Eliminating qk, qkÀ1, . . . , q1 from the system a ¼ bq1 þ c0, q1 ¼ bq2 þ c1, ... qkÀ2 ¼ bqkÀ1 þ ckÀ2, qkÀ1 ¼ bqk þ ckÀ1, qk ¼ ck, we obtain a ¼ ckbk þ Á Á Á þ c1b þ c0, with 0 < ci , b, for i ¼ 0, 1, 2, . . . , k À 1 and ck 6¼ 0. The uniqueness of this expansion follows from the fact that if a ¼ dkbk þ d kÀ1bkÀ1 þ Á Á Á þ d1b þ d0, then d0 is the remainder when a is divided by b, hence, d0 ¼ c0. Similarly, d1 is the remainder when q1 ¼ (a À d0)=b is divided by b, hence, d1 ¼ c1, and so forth. Therefore, it follows that di ¼ ci, for i ¼ 0, 1, 2, . . . , k, and the proof is complete. j Theorem 2.5 implies that every nonzero integer can be expressed uniquely in base 3, in the form ck3k þ ckÀ13kÀ1 þ Á Á Á þ c13 þ c0, when ci ¼ 0, 1, 62 Divisibility or 2, for i ¼ 0, 1, 2, . . . , k, and ck 6¼ 0, or equivalently, with ci ¼ À1, 0, or 1. An elementary version of the game of nim consists of two players and a single pile of matches. Players move alternately, each player is allowed to take up to half the number of matches in the pile, and the player who takes the last match loses. A player can force a win by leaving 2n À 1 matches in the pile, where n is a positive integer. For example, if there were 73 matches in the pile a player attempting to force a win would remove 10 matches leaving 73 À 10 ¼ 63 ¼ (26 À 1) matches in the pile. In 1901, using properties of binary representations, Charles Bouton of Harvard developed several winning strategies for a more advanced version of nim where several piles of matches were involved and where players who moved alternately were allowed to remove matches from but a single pile on each move. His techniques were generalized by E. H. Moore in 1910. Exercises 2.1 1. If a ¼ b þ c, and d divides both a and b, show that d divides c. 2. If ajb and bjc, then show that ajc. 3. If a . 0, b . 0, ajb, and bja, then show that a ¼ b. 4. If a . 0, b . 0, and ajb, then show that a < b. 5. Use the definition of division to prove that if a þ b ¼ c and ajb, then ajc. 6. Prove that if ajb and cjd, then acjbd. 7. True or false (if false give a counterexample): (a) if ajbc, then either ajb or ajc, (b) if aj(b þ c), then either ajb or ajc, (c) if a2jb3, then ajb, (d) if a2jc and b2jc and a2 < b2, then ajb, (e) if b is the largest square divisor of c and a2jc, then ajb? 8. Prove that every rational number can be represented by a repeating decimal. 9. Determine the fractional representation for 0.123. 10. Use the facpt tffihffi at every integer is of the form 3k, 3k þ 1, or 3k þ 2 to show that 3 is irrational. (Hint: Assume it is rational and get a contradiction.) 2.1 The division algorithm 63 11. For any integer n, show that (a) 2 divides n(n þ 1), (b) 3 divides n(n þ 1)(n þ 2). 12. Prove that 6 divides n(n þ 1)(2n þ 1) for any positive integer n. 13. Show that the sum of the squares of two odd integers cannot be a perfect square. 14. Prove that the difference of two consecutive cubes is never divisible by 2. 15. Show that if n is any odd integer then 8 divides n2 À 1. 16. Show that if 3 does not divide the odd integer n then 24 divides n2 À 1. 17. Use induction to prove that 3 divides n(2n2 þ 7), for any positive integer n. 18. Show that 8 divides 52n þ 7, for any positive integer n. 19. Show that 7 divides 32nþ1 þ 2nþ2, for any positive integer n. 20. Show that 5 divides 33nþ1 þ 2nþ1, for any positive integer n. 21. Show that 4 does not divide n2 þ 2, for any integer n. 22. Show that the number of positive divisors of a positive integer is odd if and only if the integer is a square. 23. Show that any integer of the form 6k þ 5 is also of the form 3m þ 2, but not conversely. 24. Show that the square of any integer must be of the form 3k or 3k þ 1. [Theon of Smyrna] 25. Show that the cube of any integer is of the form 9k, 9k þ 1, or 9k À 1. 26. Show that the fourth power of any integer is of the form either 5k or 5k þ 1. 27. Prove that no integer of the form 8k þ 7 can be represented as the sum of three squares. 28. In an 1883 edition of The Educational Times, Emma Essennell of Coventry, England, showed for any integer n, n5 À n is divisible by 30, and by 240 if n is odd. Prove it. 29. Prove that 3n2 À 1 is never a square, for any integer n. 30. Show that no number in the sequence 11, 111, 1111, 11 111, . . . is a square. 31. Prove that if a is a positive proper divisor of the positive integer b, then a < b=2. 32. If a a < panffiffidffi b n or are b< ppoffiffisffi itive n. integers and ab ¼ n, then show that either 33. For any positive integer n, show that there is a one-to-one correspon- 64 Divisibility pffiffiffi dence between the divisors of n which are greater than or equal to n and the ways n may be expressed as the difference of two squares. 34. Determine the binary and ternary representations for 40, 173, and 5437. 35. Represent 101 0112 and 201 1023 in base 10. 36. Show that any integer of the form 111 1. . .19 is triangular. 37. Given a scale with a single pan, determine the least number of weights and precisely the values of the weights necessary in order to weigh all integral weights in kilograms from 1 kilogram to 40 kilograms. [Bachet] 38. A number n is called a Niven number, named for Ivan Niven, a number theorist at the University of Oregon, if it is divisible by the sum of its digits. For example 24 is a Niven number since 2 þ 4 ¼ 6 and 6 divides 24. In 1993, C. Cooper and R. E. Kennedy showed that it is not possible to have more than twenty consecutive Niven numbers. Niven numbers are also referred to as multidigital numbers or Har- shard numbers. The latter name was given by D.R. Kaprekar and comes from the sanskrit word for ‘great joy’. Determine the first twenty-five Niven numbers. 39. Let sd(n, b) denote the digital sum of the integer n expressed in base b > 2. That is, if n ¼ ckbk þ ckÀ1bkÀ1 þ Á Á Á þ c1b þ c0, with inte- gers sd ( n, cbi )s¼uchPtikh¼a1tci0. < ci For , b, for example, i ¼ 0, since 1, 9 2, ¼ . . . , k, 10012, and ck 6¼ 0, then sd(9, 2) ¼ 2. For convenience, we denote sd(n, 10) by sd(n). Let Sd(n, b), the extended digital sum of the integer n expressed in base b > 2, represent sd(n, b) summed over the digits of n. For example, since 3 ¼ 112, 6 ¼ 1102 and 7 ¼ 1112, Sd(367, 2) ¼ sd(3, 2) þ sd(6, 2) þ sd(7, 2) ¼ 2 þ 2 þ 3 ¼ 7. Determine Sd(n, 2) for n ¼ 7, 13, and 15. 40. For which values of n does Sd(n, 2) divide n? 41. Find a positive integer n such that n=2 is square, n=3 is cube, and n=5 is a fifth power. 2.2 The greatest common divisor If a and b are integers and d is a positive integer such that dja and djb, then d is called a common divisor of a and b. If both a and b are zero then they have infinitely many common divisors. However, if one of them is nonzero, the number of common divisors of a and b is finite. Hence, there must be a largest common divisor. We denote the largest common divisor of a and b by gcd(a, b) and, following standard convention, call it 2.2 The greatest common divisor 65 the greatest common divisor of a and b. It follows straightforwardly from the definition that d is the greatest common divisor of a and b if and only if (1) d . 0, (2) dja and djb, (3) if eja and ejb then ejd. As pointed out in [Schroeder], physiological studies have shown that, with few exceptions, the brain, upon being presented with two harmonically related frequencies, will often perceive the greatest common divisor of the two frequencies as the pitch. For example, if presented with frequencies of 320 hertz and 560 hertz the brain will perceive a pitch of 80 Hz. One of the most important properties of the greatest common divisor of two numbers is that it is the smallest positive integer that can be expressed as a linear combination of the two numbers. We establish this result in the next theorem. Theorem 2.6 If a and b are not both zero and d ¼ gcd(a, b), then d is the least element in the set of all positive linear combinations of a and b. Proof Let T represent the set of all linear combinations of a and b that are positive, that is, T ¼ fax þ by: x and y are integers and ax þ by . 0g. Without loss of generality, suppose that a 6¼ 0. If a . 0, then a . 1 þ b . 0 ¼ a is in T. If a , 0, then a(À1) þ b . 0 ¼ Àa is in T. Thus, in either case, T is a nonempty set of positive integers. By the well-ordering principle T contains a least element which we denote by e ¼ au þ bv. By the division algorithm, there exist integers q and r such that a ¼ eq þ r with 0 < r , e. Hence, r ¼ a À eq ¼ a À (au þ bv)q ¼ a(1 À uq) þ b(Àvq). If r 6¼ 0 we have a contradiction since r is in T and r , e, the least element in T. Thus, r ¼ 0 implying that e divides a. A similar argument shows that e divides b. Since e divides both a and b and d is the greatest common divisor of a and b, it follows that e < d. However, since e ¼ au þ bv and d divides both a and b, it follows that d divides e, hence, d < e. Therefore, e ¼ d and the proof is complete. j Corollary If d is the greatest common divisor of a and b, then there exist integers x and y such that d ¼ ax þ by. Example 2.5 Table 2.2 exhibits values for the linear combination 56x þ 35 y, where À4 < x < 4 and À4 < y < 4. Note that all entries are 66 Divisibility Table 2.2. x y À4 À3 À2 À1 0 1 23 4 À4 À364 À308 À252 À196 À140 À84 À28 28 84 À3 À329 À273 À217 À161 À105 À49 7 63 119 À2 À294 À238 À182 À126 À70 À14 42 98 154 À1 À259 À203 À147 À91 À35 21 77 133 189 0 À224 À168 À112 À56 0 56 112 168 224 1 À189 À133 À77 À21 35 91 147 203 259 2 À154 À98 À42 14 70 126 182 238 294 3 À119 À63 À7 49 105 161 217 273 329 4 À84 À28 28 84 140 196 252 308 364 multiples of 7 and the least positive linear combination is 7. From Theorem 2.6, the greatest common divisor of 56 and 35 is 7. Suppose d is the greatest common divisor and a and b, x and y are integers such that d ¼ ax þ by and A and B are integers such that a ¼ Ad and b ¼ Bd. It follows that d ¼ aX þ bY , where X ¼ x À Bt and Y ¼ y þ At, for any integer t. There are, therefore, an infinite number of ways to represent the greatest common divisor of two integers as a linear combination of the two given integers. In Chapter 5, we show that the linear equation ax þ by ¼ c, where a, b and c are integers, has integer solutions if and only if the greatest common divisor of a and b divides c. Other properties of the greatest common divisor include the following, where a, b, c are positive integers. (a) gcd(ca, cb) ¼ c . gcd(a, b).  (b) If dja and djb then gcd ab , ¼ gcd(a, b) . dd d   (c) gcd a b , ¼ 1: gcd(a, b) gcd(a, b) (d) If gcd(a, b) ¼ 1 then gcd(c, ab) ¼ gcd(c, a) . gcd(c, b). (e) If ax þ by ¼ m, then gcd(a, b) divides m. (f) If gcd(a, b) ¼ 1 and a . b ¼ nk, then there exist integers r and s such that a ¼ rk and b ¼ sk. One of the most useful results in number theory is that if a linear 2.2 The greatest common divisor 67 combination of two integers is unity then the greatest common divisor of the two integers is unity. This result appears in Book VII of Euclid’s Elements. We call two integers coprime (or relatively prime) if their greatest common divisor is unity. Theorem 2.7 Two integers a and b are coprime if and only if there exist integers x and y such that ax þ by ¼ 1. Proof This follows from Theorem 2.6. Sufficiency follows from the fact that no positive integer is less than 1. j For example, for any positive integer k, 6 . (7k þ 6) þ (À7) . (6k þ 5) ¼ 1. Hence, from Theorem 2.7, gcd(7k þ 6, 6k þ 5) ¼ 1, for any positive integer k. In addition, suppose that gcd(n! þ 1, (n þ 1)! þ 1) ¼ d, for some positive integer n. Since d divides n! þ 1, d divides (n þ 1)! þ 1, and n ¼ (n þ 1)[n! þ 1] À [(n þ 1)! þ 1], d must divide n. However, if djn and dj[n! þ 1] then d ¼ 1, since 1 ¼ 1 . (n! þ 1) þ (Àn) . (n À 1)!. Therefore, gcd(n! þ 1, (n þ 1)! þ 1) ¼ 1, for any positive integer n. Theorem 2.8 For integers a, b, and c, if ajc and bjc and a and b are coprime, then abjc. Proof Since a and b divide c, there exist integers x and y such that ax ¼ by ¼ c. It follows from Theorem 2.7 that there exist integers u and v such that au þ bv ¼ 1. Multiplying both sides of the equation by c we obtain c ¼ auc þ bvc ¼ au(by) þ bv(ax) ¼ ab(uy) þ ab(vx) ¼ (ab)(uy þ vx). Hence, abjc. j CQoin¼ro1 lmlair, ytheInf mijc, mjc. for 1 < i , n, gcd(mi, mj) ¼ 1, for i 6¼ j, and m¼ Example 2.6 Suppose gcd(a, b) ¼ 1 and d ¼ gcd(2a þ b, a þ 2b). Since d must divide any linear combination of 2a þ b and a þ 2b, d divides [2(2a þ b) þ (À1)(a þ 2b)] and d divides [(À1)(2a þ b) þ 2(a þ 2b)]. Hence, dj3a and dj3b. Since gcd(a, b) ¼ 1, d divides 3. Therefore, if gcd(a, b) ¼ 1, then gcd(2a þ b, a þ 2b) ¼ 1 or 3. If a and b are integers such that both a and b divide m then m is called a common multiple of a and b. If a and b are nonzero then ab and Àab are both common multiples of a and b and one of them must be positive. Hence, by the well-ordering principle, there exists a least positive common 68 Divisibility multiple of a and b. If m is the smallest positive common multiple of a and b, we call it the least common multiple of a and b, and denote it by lcm(a, b). Thus, m ¼ lcm(a, b) if and only if (1) m . 0, (2) both a and b divide m, (3) if both a and b divide n, then m divides n. Theorem 2.9 If either a or b is nonzero, then lcm(a, b) ¼ jabj= gcd(a, b)j, where jxj denotes the absolute value of x. Proof Let d ¼ gcd(a, b), a ¼ Ad, b ¼ Bd, and m ¼ jabj=d. It follows that m . 0, m ¼ jAbj ¼ Ab and m ¼ jaBj ¼ aB. Hence, both a and b divide m. Suppose n is any other multiple of a and b. That is, there exist integers C and D such that n ¼ aC ¼ bD. We have n ¼ AdC ¼ BdD so AC ¼ BD. Hence, A divides BD. However, since gcd(A, B) ¼ 1, A must divide D. That is, there exists an integer E such that AE ¼ D. Thus, n ¼ bD ¼ bAE ¼ mE implying that n is a multiple of m. Therefore, any multiple of both a and b is also a multiple of m. From the three-step criterion for least common multiple, we have that m ¼ lcm(a, b). j Note that gcd(56, 35) ¼ 7, lcm(56, 35) ¼ 280, and gcd(56, 35) . lcm(56, 35) ¼ 7 . 280 ¼ 1960. The greatest common divisor of more than two integers is defined as follows: gcd(a1, a2, . . . , an) ¼ d if and only if, for all i ¼ 1, 2, . . . , n, djai and if ejai, for all i ¼ 1, 2, . . . , n then ejd. Similarly for the least common multiple, lcm(a1, a2, . . . , an) ¼ m if and only if for i ¼ 1, 2, . . . , n, aijm and if aije for all i ¼ 1, 2, . . . , n then mje. If a1, a2, . . . , an are coprime in pairs then gcd(a1, a2, . . . , an) ¼ 1. For if gcd(a1, a2, . . . , an) ¼ d . 1, then dja1 and dja2 contradicting the fact that gcd(a1, a2) ¼ 1. The converse is not true since gcd(6, 10, 15) ¼ 1 but neither 6 and 10, 6 and 15, nor 10 and 15 are coprime. Given positive integers d and m then a necessary and sufficient condition for the existence of positive integers a and b such that (a) gcd(a, b) ¼ d and lcm(a, b) ¼ m is that djm, (b) gcd(a, b) ¼ d and a þ b ¼ m is that djm, and (c) gcd(a, b) ¼ d and a . b ¼ m is that d2jm. In order to establish (b), note that if gcd(a, b) ¼ d and a þ b ¼ m, then there exist integers r and s such that a ¼ dr and b ¼ ds. Hence, m ¼ a þ b ¼ dr þ ds ¼ d(r þ s) and so djm. Conversely, if djm then choose a ¼ d and b ¼ m À d. Then, a þ b ¼ m. Since 1 and m=d À 1 are 2.2 The greatest common divisor 69 relatively prime, the greatest common divisor of a ¼ d . 1 and b ¼ d . (m=d À 1) is d. Exercises 2.2 1. Prove that if a divides bc and gcd(a, b) ¼ 1, then ajc. 2. Prove that for any positive integer n, gcd(n, n þ 1) ¼ 1. 3. Show that for any integer n, gcd(22n þ 7, 33n þ 10) ¼ 1. 4. Show that there cannot exist integers a and b such that gcd(a, b) ¼ 3 and a þ b ¼ 65. 5. Show that there are infinitely many pairs of integers a and b with gcd(a, b) ¼ 5 and a þ b ¼ 65. 6. If un represents the nth Fibonacci number then show that gcd(unþ1, un) ¼ 1, for any positive integer n. 7. If gcd(a, b) ¼ d, and x and y are integers such that a ¼ xd and b ¼ yd, show that gcd(x, y) ¼ 1. 8. Prove that if gcd(a, b) ¼ 1 and gcd(a, c) ¼ 1, then gcd(a, bc) ¼ 1. [Euclid] 9. Prove that if gcd(a, b) ¼ 1 then gcd(am, bn) ¼ 1 for any positive integers m and n. 10. Prove that for integers a and b gcd(a, b) divides gcd(a þ b, a À b). 11. Prove that if gcd(a, b) ¼ 1, then gcd(a þ ab, b) ¼ 1. 12. Prove that if gcd(a, b) ¼ 1, then gcd(a þ b, a À b) ¼ 1 or 2. 13. Suppose that gcd(a, b) ¼ 1. For what values of a and b is it true that gcd(a þ b, a À b) ¼ 1? 14. If c . 0, then show that gcd(ca, cb) ¼ c . gcd(a, b). 15. Show that for integers a and b, gcd(a, a þ b) divides b. 16. Suppose that for integers a and b gcd(a, 4) ¼ 2 and gcd(b, 4) ¼ 2. Show that gcd(a þ b, 4) ¼ 2. 17. If c . 0, then show that lcm(ac, bc) ¼ c . lcm(a, b). 18. If a divides b determine gcd(a, b) and lcm(a, b). 19. Prove that ajb if and only if lcm(a, b) ¼ jbj. 20. For any positive integer n, find lcm(n, n þ 1). 21. For any positive integer n, show that lcm(9n þ 8, 6n þ 5) ¼ 54n2 þ 93n þ 40. 22. Give an example to show that it is not necessarily the case that gcd(a, b, c) . lcm(a, b, c) ¼ abc. 23. Find all positive integers a and b such that gcd(a, b) ¼ 10, and lcm(a, b) ¼ 100, with a > b. 70 Divisibility 24. If a and b are positive integers such that a þ b ¼ 5432 and lcm(a, b) ¼ 223 020 then find a and b. 25. f30, 42, 70, 105g is a set of four positive integers with the property that they are coprime when taken together, but are not coprime when taken in pairs. Find a set of five positive integers that are coprime when taken together, but are not coprime in pairs. 2.3 The Euclidean algorithm A method to determine the greatest common divisor of two integers, known as the Euclidean algorithm, appears in Book VII of Euclid’s Elements. It is one of the few numerical procedures contained in the Elements. It is the oldest algorithm that has survived to the present day. The method appears in India in the late fifth century Hindu astronomical work Aryabhatiya by Aryabhata. Aryabhata’s work contains no equations. It includes 50 verses devoted to the study of eclipses, 33 to arithmetic, and 25 to time reckoning and planetary motion. Aryabhata called his technique the ‘pulverizer’ and used it to determine integer solutions x, y to the equation ax À by ¼ c, where a, b and c are integers. We discuss Aryabhata’s method in Chapter 5. In 1624, Bachet included the algorithm in the second edition of his Proble`mes plaisants et de´lectables. It was the first numerical exposition of the method to appear in Europe. The Euclidean algorithm, is based on repeated use of the division algorithm. Given two integers a and b where, say a > b . 0, determine the sequences q1, q2, . . . , qnþ1 and r1, r2 . . . , rnþ1 of quotients and remainders in the following manner. a ¼ bq1 þ r1, b ¼ r1q2 þ r2, r1 ¼ r2q3 þ r3, where 0 < r1 , b: where 0 < r2 , r1: where 0 < r3 , r2: ... rnÀ2 ¼ rnÀ1 qn þ rn, where 0 < rn , rnÀ1: rnÀ1 ¼ rn qnþ1: Suppose rn 6¼ 0. Since b . r1 . r2 Á Á Á > 0, r1, r2, . . . , rnþ1 is a decreasing sequence of nonnegative integers and must eventually terminate with a zero remainder, say rnþ1 ¼ 0. From the last equation in the Euclidean algorithm, we have that rn divides rnÀ1 and from the penultimate equation it follows that rn divides rnÀ2. Continuing this process we find that rn divides both a and b. Thus, rn is a common divisor of a and b. Suppose that e is any positive integer which divides both a and b. From the 2.3 The Euclidean algorithm 71 first equation, it follows that e divides r1. From the second equation, it follows that, since e divides b and e divides r1, e divides r2. Continuing this process, eventually, we find that e divides rn. Thus, any common divisor of a and b is also a divisor of rn. Therefore, rn, the last nonzero remainder, is the greatest common divisor of a and b. We have established the following result. Theorem 2.10 Given two positive integers, the last nonzero remainder in the Euclidean algorithm applied to the two integers is the greatest common divisor of the two integers. According to the Euclidean algorithm the greatest common divisor of 819 and 165 is 3 since 819 ¼ 165 . 4 þ 159, 165 ¼ 159 . 1 þ 6, 159 ¼ 6 . 26 þ 3, 6 ¼ 3 . 2: One of the most important and useful applications of the Euclidean algorithm is being able to express the greatest common divisor as a linear combination of the two given integers. In particular, to express the greatest common divisor of 819 and 165 as a linear combination of 819 and 165, we work backwards step by step from the Euclidean algorithm. Using brute force, we accomplish the feat in the following manner. 3 ¼ 159 þ (À26)6, 3 ¼ (819 þ 165(À4)) þ (À26)(165 þ 159(À1)), 3 ¼ 819 þ 165(À30) þ 159(26), 3 ¼ 819 þ 165(À30) þ (819 þ 165(À4))(26), 3 ¼ 819(27) þ 165(À134): One of the earliest results in the field of computational complexity was established by Gabriel Lame´ in 1845. Lame´, a graduate of the E´ cole Polytechnique in Paris, was a civil engineer who made several notable contributions to both pure and applied mathematics. He was considered by Gauss to be the foremost French mathematician of his generation. Lame´ proved that the number of divisions in the Euclidean algorithm for two positive integers is less than five times the number of digits in the smaller of the two positive integers. If we apply the Euclidean algorithm to integers a and b where 72 Divisibility a > b . 0, then qi > 1, for 1 < i < n. Since rn , rnÀ1, qnþ1 . 1. Let a1, a2, . . . denote the Fibonacci-type sequence with a1 ¼ 1 and a2 ¼ 2. We have rn > 1 ¼ 1 ¼ a1, rnÀ1 ¼ rnqnþ1 > 1 . 2 ¼ 2 ¼ a2, rnÀ2 ¼ rnÀ1qn þ rn > 2 . 1 þ 1 ¼ 3 ¼ a3, rnÀ3 ¼ rnÀ2qnÀ1 þ rnÀ1 > 3 . 1 þ 2 ¼ 5 ¼ a4, rnÀ4 ¼ rnÀ3qnÀ2 þ rnÀ2 > 5 . 1 þ 3 ¼ 8 ¼ a5, ... b ¼ r1q2 þ r2 > anÀ1 . 1 þ anÀ2 ¼ an. It follows that b > an ¼ unþ1 ¼ (ônþ1 À ó nþ1)=(ô À ó ) . ôn. Since log ô . 15, n , log b=log ô , 5 . log b. If m denotes the number of digits in b, then b , 10m. Hence, log b , m. Therefore, n , 5m and we have estab- lished Lame´’s result. Theorem 2.11 (Lame´) The number of divisions in the Euclidean algorithm for two positive integers is less than five times the number of digits in the smaller of the two positive integers. In 1970, John Dixon of Carleton University improved the bound by showing that the number of steps in the Euclidean algorithm is less than or equal to (2:078)[log a þ 1], where a is the larger of the two positive integers. If there are a large number of steps in the Euclidean algorithm, expressing the greatest common divisor as a linear combination of the two integers by brute force can be quite tedious. In 1740, Nicholas Saunderson, the blind Lucasian Professor of Mathematics at Cambridge University, included an algorithm in his Elements of Algebra which greatly simplified the process. Saunderson attributed the origin of the method to Roger Cotes, the first Plumian Professor of Mathematics at Cambridge, who used the algorithm in the expansion of continued fractions. A similar technique can be traced back at least to the thirteenth century where it is found in Qin Jiushao’s (CHIN JEW CHOW) Mathematical Treatise in Nine Sections. Let a and b be integers, with a > b . 0. Utilizing the notation of the Euclidean algorithm let d ¼ gcd(a, b) ¼ rn so rnþ1 ¼ 0 and ri ¼ riþ1qiþ2 þ riþ2, for i ¼ 1, 2, . . . , n. In addition, let rÀ1 ¼ a, r0 ¼ b. Define xi ¼ xiÀ2 þ xiÀ1qi, yi ¼ yiÀ2 þ yiÀ1qi, for i ¼ 2, . . . , n þ 1. For completeness, let x0 ¼ 0, x1 ¼ 1, y0 ¼ 1, and y1 ¼ q1. Using this notation, we establish the following result. 2.3 The Euclidean algorithm 73 Theorem 2.12 (Saunderson’s algorithm) If d is the greatest common divisor of two integers a and b, with a . b > 0, then d ¼ a(À1)nÀ1xn þ b(À1)nyn. Proof Consider the variable proposition P(n): axn À byn ¼ (À1)nÀ1 rn. P(0): ax0 À by0 ¼ 0 À b ¼ (À1)À1 ro. P(1): ax1 À by1 ¼ a . 1 À bq1 ¼ r1. Hence, P(1) is true. P(2): ax2 À by2 ¼ a(x0 þ x1q2) À b( y0 þ y1q2) ¼ ax1q2 À b(1 þ q1q2) ¼ (ax1 À bq1)q2 À b ¼ (À1)r2. Hence, P(2) is true. Assume that P(r) holds for all integers r between 1 and k for k . 1 and consider P(k þ 1). We have P(k þ 1): axkþ1 À bykþ1 ¼ a(xkÀ1 þ xkqkþ1) À b( ykÀ1 þ ykqkþ1) ¼ (axkÀ1 À bykÀ1) þ qkþ1(axk À byk) ¼ (À1)k rkÀ1 þ qkþ1(À1)kÀ1 rk ¼ (À1)k(rkÀ1 À qkþ1 rk) ¼ (À1)k rkþ1: Hence, P(k À 1) and P(k) imply P(k þ 1) and, from the alternate principle of mathematical induction, P(n) is true for all nonnegative integers. Therefore, d ¼ rn ¼ (À1)nÀ1(axn À byn) ¼ a(À1)nÀ1xn þ b(À1)nyn. j Example 2.7 We use Saunderson’s method to express the greatest com- mon divisor of 555 and 155 as a linear combination of 555 and 155. From the Euclidean algorithm it follows that 555 ¼ 155 . 3 þ 90, 155 ¼ 90 . 1 þ 65, 90 ¼ 65 . 1 þ 25, 65 ¼ 25 . 2 þ 15, 25 ¼ 15 . 1 þ 10, 15 ¼ 10 . 1 þ 5, 10 ¼ 5 . 2 þ 0, a ¼ bq1 þ r1, b ¼ r1q2 þ r2, r1 ¼ r2q3 þ r3, r2 ¼ r3q4 þ r4, r3 ¼ r4q5 þ r5, r4 ¼ r5q6 þ r6, r5 ¼ r6q7: Hence, 5, the last nonzero remainder, is the greatest common divisor of 555 and 155. Table 2.3 contains the basic elements in applying Saunder- son’s algorithm, where xi ¼ xiÀ2 þ xiÀ1qi, yi ¼ yiÀ2 þ yiÀ1qi, for i ¼ 1, 2, . . . , n þ 1, x0 ¼ 0, x1 ¼ 1, y0 ¼ 1, and y1 ¼ q1. A useful check when using Saunderson’s algorithm arises from the fact that rnþ1 ¼ 0, hence, axnþ1 ¼ bynþ1. For the case when a ¼ 55 and b ¼ 155, we fill in Table 2.3 with the appropriate terms to obtain Table 2.4. Therefore, 74 Divisibility Table 2.3. i 0 1 2 3 ... n nþ1 qi q1 q2 q3 ... qn q nþ1 xi 0 1 x2 x3 ... xn xnþ1 yi 1 q1 y2 y3 ... yn ynþ1 Table 2.4. i 0 1 2 3 4 5 6 7 qi 3 1 1 2 1 1 2 xi 0 1 1 2 5 7 12 31 yi 1 3 4 7 18 25 43 111 5 ¼ gcd(155, 555) ¼ (À12)555 þ (43)155. As a check, we have a . x7 ¼ 555 . 31 ¼ 17 205 ¼ 155 . 111 ¼ b . y7. In order to minimize the computations involved for his students, Saunderson devised an equivalent but more efficient algorithm illustrated in the next example. The simplified version determines the greatest common divisor to two natural numbers and expresses it as a linear combination of the two given integers in one fell swoop. Example 2.8 Given a ¼ 555 and b ¼ 155 form the following sequence of equations. 1 1 . a À 0 . b ¼ 555 2 0 . a À 1 . b ¼ À155 3 3 a À 3b ¼ 90 1 4 a À 4b ¼ À65 1 5 2a À 7b ¼ 25 2 6 5a À 18b ¼ À15 1 7 7a À 25b ¼ 10 1 8 12a À 43b ¼ À5 1 9 À 12a þ 43b ¼ 5 The first two equations are straightforward. Since 3 is the quotient when dividing 155 into 555, we multiply the second equation by 3 and add it to 2.3 The Euclidean algorithm 75 the first equation to obtain the third equation. We obtain the fourth equation by multiplying the third equation by unity, since 90 goes into 155 once, and adding it to the second equation, as so forth. After obtaining the eighth equation, 12a À 43b ¼ À5, we note that 5 divides into 10 evenly. Hence, gcd(555, 155) ¼ 5. Multiplying both sides of the eighth equation by À1 we obtain the desired result, À12a þ 43b ¼ 5. Similarly if a ¼ 6237 and b ¼ 2520, we obtain 1 . a À 0 . b ¼ 6237 0 . a À 1 . b ¼ À2520 2 a À 2b ¼ 1197 2 2a À 5b ¼ À126 9 19a À 47b ¼ 63 2 40a À 99b ¼ 0 Hence, gcd(6237, 2520) ¼ 63 ¼ 19(6237) þ (À47)(2520). Furthermore, lcm(6237, 2520) ¼ 40a ¼ 99b ¼ 249 480. At Cambridge Saunderson tutored algebra and lectured on calculus in the Newtonian style. Each year he gave a very acclaimed series of natural science lectures. Several copies of notes from students who attended his course are extant. However, it appears that their popularity may have rested on the fact that they were virtually devoid of mathematical content. Albeit he was an excellent teacher, he often wondered if his everlasting fate would include a stint in Hades teaching mathematics to uninterested students. Saunderson was very diligent and forthright. He once told Horace Walpole, the author and third son of England’s first Prime Minister Robert Walpole, that he would be cheating him to take his money, for he could never learn what he was trying to teach. Lord Chesterfield said of Saunderson that, ‘He did not have the use of his eyes, but taught others to use theirs’. Exercises 2.3 1. Find the greatest common divisors and the least common multiples for the following pairs of integers. Determine the Lame´ and Dixon limits. (a) a ¼ 93 and b ¼ 51; (b) a ¼ 481 and b ¼ 299; (c) a ¼ 1826 and b ¼ 1742; (d) a ¼ 1963 and b ¼ 1941; (e) a ¼ 4928 and b ¼ 1771. 76 Divisibility 2. Express the greatest common divisor of each pair of integers as a linear combination of the two integers. (a) a ¼ 93 and b ¼ 51; (b) a ¼ 481 and b ¼ 299; (c) a ¼ 1826 and b ¼ 1742; (d) a ¼ 1963 and b ¼ 1941; (e) a ¼ 4928 and b ¼ 1771. 2.4 Pythagorean triples One of the earliest known geometric applications of number theory was the construction of right triangles with integral sides by the Babylonians in the second millennium BC. In particular, if x, y and z are positive integers with the property that x2 þ y2 ¼ z2 then the 3-tuple (x, y, z) is called a Pythagorean triple. In 1945 Otto Neugebauer and A. Sachs analyzed a nineteenth century BC Babylonian cuneiform tablet in the Plimpton Library archives at Columbia University. The tablet, designated Plimpton 322, lists 15 pairs (x, z) for which there is a y such that x2 þ y2 ¼ z2 referring to Pythagorean triples ranging from (3, 4, 5) to (12 709, 13 500, 18 541). The Babylonians undoubtedly had an algorithm to generate such triples long before Pythagoras was born, but such are the whims of eponymy. The earliest appearance of Pythagorean triples in Europe was in the 1572 edition of Rafael Bombelli’s Algebra. Twenty years later, they appear in Franc¸ois Vie`te’s Introduction to the Analytic Art. It will be convenient to restrict our attention to primitive Pythagorean triples, which are Pythagorean triples (x, y, z) with the additional property that x, y and z have no positive common divisor other than unity. For example, (3, 4, 5) is a primitive Pythagorean triple. In Theorem 3.3, we show the Pythagorean triple (x, y, z) is primitive if and only if gcd(x, y) ¼ 1, gcd(x, z) ¼ 1, and gcd(x, y) ¼ 1. We use this fact now to establish an algorithm, a version of which appears in Book X of Euclid’s Elements that may have been used by the Babylonians to determine Pythagorean triples. Theorem 2.13 If (x, y, z) is a primitive Pythagorean triple, then there exist positive integers s and t, s . t, gcd(s, t) ¼ 1, one even and the other odd such that x ¼ 2st, y ¼ s2 À t2, and z ¼ s2 þ t2. Proof If (x, y, z) is a primitive Pythagorean triple, then x, y and z are coprime in pairs. If x and y are even then z is even. If x and y are odd, then 2.4 Pythagorean triples 77 Table 2.5. s t x y z 2 1 3 2 4 1 4 3 5 2 4 3 5 12 5 13 8 15 17 24 7 25 20 21 29 z2 is not of the form 4k or 4k þ 1, a contradiction. Hence, x and y must be of different parity. Without loss of generality, let x be even and y be odd. Hence, z is odd. In addition, x2 ¼ z2 À y2 ¼ (z À y)(z þ y). Since z À y and z þ y must be even let z À y ¼ 2u and z þ y ¼ 2v. Now u and v must be coprime for if gcd(u, v) ¼ d . 1, then d divides both u and v implying that d divides both y and z, which contradicts the assumption that y and z are coprime. In addition, if u and v were both odd, then y and z would be even, a contradiction. So one of u and v is even and the other is odd. Since x is even, x=2 is an integer, and x2¼ ! ! (z À y) (z þ y) ¼ uv: 2 2 2 Since uv ¼ (x=2)2 and gcd(u, v) ¼ 1, u and v must be perfect squares, say u ¼ s2 and v ¼ t2, where one of s and t is even and the other is odd. It follows that x ¼ 2st, y ¼ s2 À t2, and z ¼ s2 þ t2. j Example 2.9 Using Theorem 2.12, and several values of s and t, we obtain the primitive Pythagorean triplets shown in Table 2.5. The next result implies that neither the equation x4 þ y4 ¼ z4 nor the equation x2n þ y2n ¼ z2n, with n a positive integer greater than 1, have integral solutions. We employ Fermat’s method of descent to establish the result. In essence, Fermat’s technique is a proof by contradiction. There are two paths we may take. Either we assume that a particular number is the least positive integer satisfying a certain property and proceed to find a smaller positive integer having the same property or we proceed to construct an infinitely decreasing sequence of positive integers. In either case, we arrive at a contradiction. The next result was arrived at independently by Fermat and his long-time correspondent Bernard Frenicle de Bessy. Frenicle, an official at the French Mint, discovered in 1634, that the frequency of a pendulum is inversely proportional to the square root of its 78 Divisibility length. Frenicle was a good friend of Galileo and offered to publish a French translation of his Dialogue. Theorem 2.14 The equation x4 þ y4 ¼ z2 has no integral solutions. Proof Without loss of generality, we consider only primitive solutions to the equation. Let a4 þ b4 ¼ c4 be the solution with gcd(a, b, c) ¼ 1 and least positive value for c. From Theorem 2.13, since (a2)2 þ (b2)2 ¼ c2, there exist coprime integers s and t of opposite parity such that s . t, a2 ¼ 2st, b2 ¼ s2 À t2, and c ¼ s2 þ t2. Hence, s , c, b2 þ t2 ¼ s2, with gcd(b, t) ¼ gcd(s, t) ¼ 1, with say s odd and t even. Applying Theorem 2.13 to b2 þ t2 ¼ s2, we find that t ¼ 2uv, b ¼ u2 À v2, and s ¼ u2 þ v2, with u and v coprime, of opposite parity, and u . v. In addition, (a=2)2 ¼ st=2 and gcd(s, t=2) ¼ gcd(t, s) ¼ 1. Hence, s ¼ r2 and t=2 ¼ w2, with (r, w) ¼ 1. Further, w2 ¼ t=2 ¼ uv, so u ¼ m2 and v ¼ n2, with gcd(m, n) ¼ 1. Thus, m4 þ n4 ¼ u2 þ v2 ¼ s ¼ r2, with r < s , c contradicting the minimality of c. Therefore x4 þ y4 ¼ z2 has no integral solutions. j Problems concerning integral areas of rational right triangles go back to Diophantus. A right triangle whose sides form a primitive Pythagorean triple is called a Pythagorean triangle. The area of a Pythagorean triangle, sans the units of measurement, is called a Pythagorean number. It follows, from Theorem 2.13, that a Pythagorean number P can be represented as a product of the form P ¼ st(s þ t)(s À t), where s and t are of different parity and gcd(s, t) ¼ 1. Among the properties of Pythagorean numbers are: every Pythagorean number is divisible by 6; for every integer n . 12 there is a Pythagorean number between n and 2n; the units digit of a Pythagorian number is either 0, 4, or 6; there are infinitely many Pythagorean numbers of the form 10k, 10k þ 4, and 10k þ 6; no Pythagorean number is square; no Pythagorean number is a Lucas number. The Pythagorean triple (9999, 137 532, 137 895) is unusual since its associated Pythagorean triangle has area 687 591 234 which is almost pandigital. Note that the Pythagorean triangles (20, 21, 29) and (12, 35, 51) have different hypotenuses but the same area. In addition, for any positive integer k, triangles with sides x ¼ 20k4 þ 4k2 þ 1, y ¼ 8k6 À 4k4 À 2k2 þ 1, and z ¼ 8k6 þ 8k4 þ 10k2, have area 4k2(2k2 þ 1)2(2k2 À 1)2; however, none is a right triangle. The incenter of a triangle is the center of the inscribed circle. The incenter is also the intersection of the angle bisectors. 2.4 Pythagorean triples 79 Theorem 2.15 The radius of the incircle of a Pythagorean triangle is an integer. Proof Denote the area, inradius, and incenter of the Pythagorean triangle ABC shown in Figure 2.1 by K, r, and I, respectively. Let a ¼ y þ z, b ¼ x þ z, and c ¼ x þ y. From Theorem 2.13, K ¼ 1 2 ab þ 1 2 ra þ 1 2 rb þ 1 2 rc ¼ 1 2 r(a þ b þ c) ¼ 1 2 r(2st þ s2 À t2 þ s2 þ t2) ¼ rs( t þ s). Similarly, K ¼ 12xy ¼ st(s2 À t2). Hence, r ¼ t(s À t), which is an integer. j It has been shown that no infinite set of noncollinear planar points exist whose pairwise distances are all integral. However, we can generate such finite sets with that property using primitive Pythagorean triples as shown in the next example. Example 2.10 We use n À 2 primitive Pythagorean triples to determine n noncollinear points in the plane with the property that each is an integral distance from any other. Let (x, y) denote a point in the Cartesian plane with abscissa x and ordinate y. Suppose n ¼ 7 and choose five different primitive Pythagorean triples, for example, those in Table 2.6. Let p1 ¼ (0, 0), p2 ¼ (0, 3 . 5 . 7 . 15 . 21) ¼ (0, 33 075), and pi ¼ (xi, 0), for 3 < i < 7, where x3 ¼ 4 . 5 . 7 . 15 . 21 ¼ 44 100, x4 ¼ 3 . 12 . 7 . 15 . 21 ¼ 79 380, x5 ¼ 3 . 5 . 24 . 15 . 21 ¼ 113 400, x6 ¼ 3 . 5 . 7 . 8 . 21 ¼ 17 640, x7 ¼ 3 . 5 . 7 . 15 . 20 ¼ 31 500: The basic structure of xi, the nonzero coordinate in pi, for i ¼ 3, 4, 5, 6, 7, derives from the product of the terms in the first column of Table 2.6. However, the (n À 2)nd term in the product is replaced by the correspond- Az z r y x rI r Bx y C Figure 2.1. 80 Divisibility Table 2.6. 3 4 5 5 12 13 7 24 25 15 8 17 21 20 29 ing term in the second column of Table 2.6. By construction f p1, p2, . . . , p7g forms a set of seven noncollinear points in the plane with the property that any pair of points in the set are an integral distance apart. This follows by construction since the distance separating each pair is the length of a side of a Pythagorean triangle. In 1900, D. H. Lehmer showed that the number of primitive Pythagorean triples with hypotenuse less than or equal to n is approximately n=2ð. Pythagorean triangles can be generalized to Pythagorean boxes, rectangular parallelepipeds with length, width, height, and all side and main diagonals having integral values. It is an open question whether or not a Pythagorean box exists. Exercises 2.4 1. For any positive integer n, show that (2n2 þ 2n, 2n þ 1, 2n2 þ 2n þ 1) is a Pythagorean triple in which one side and the hypotenuse differ by one unit. Such triples were studied by Pythagoras, and rediscovered by Stifel when he was investigating properties of the mixed fractions 113, 225, 337, 449 . . . , n þ n=(2n þ 1) ¼ (2n2 þ 2n)= (2n þ 1). 2. For any positive integer n . 1, show that (2n, n2 À 1, n2 þ 1) is a Pythagorean triple in which one side differs from the hypotenuse by two units. Such triples were studied by Plato. 3. If (a, b, c) and (x, y, z) are Pythagorean triples, show that (ax À by, ay þ bx, cz) is a Pythagorean triple. 4. Prove that (3, 4, 5) is the only primitive Pythagorean triple whose terms are in arithmetic proportion, that is, they are of the form (a, a þ d, a þ 2d). 5. Why is it not the case that the values s ¼ 3 and t ¼ 5 generate a primitive Pythagorean triple? 6. Show that if (x, y, z) is a primitive Pythagorean triple then the sum of the legs of the Pythagorean triangle generated is of the form 8m Æ 1. 2.5 Miscellaneous exercises 81 7. For any positive integer n > 3, show that there exists a Pythagorean triple (x, y, z) with n as one if its elements. 8. Define the Pell sequence, 0, 1, 2, 5, 12, 27, . . . , an, . . . , recursively such that anþ2 ¼ 2anþ1 þ an, with a0 ¼ 0 and a1 ¼ 1. Show that if xn ¼ a2nþ1 À a2n, yn ¼ 2anþ1an, and zn ¼ a2nþ1 þ a2n, with n > 1, then (xn, yn, zn) is a Pythagorean triple with xn ¼ yn þ (À1)n. 9. Show that if the pair (s, t), from Theorem 2.13, with s . t, generates a Pythagorean triple with jx À yj ¼ k > 0, then (2s þ t, s) generates a Pythagorean triple with jx À yj ¼ k. 10. Ignoring the dimensions of the units, find two Pythagorean triangles with the same area as perimeter. 11. Show that the Pythagorean triples (40, 30, 50), (45, 24, 51), and (48, 20, 52) have equal perimeters and their areas are in arithmetic proportion. 12. Prove that the product of three consecutive positive integers, with the first number odd, is a Pythagorean number. 13. Show that every Pythagorean number is divisible by 6. 14. Show that a Pythagorean number can never be a square. 15. What positive integers n are solutions to x2 À y2 ¼ n? 16. Show that if (x, y, z) is a primitive Pythagorean triple then 12jxyz. 17. Show that if (x, y, z) is a primitive Pythagorean triple then 60jxyz. [P. Lenthe´ric 1830] 18. Find the coordinates of a set of eight noncollinear planar points each an integral distance from the others. 19. How many primitive Pythagorean triangles have hypotenuses less than 100? How accurate is Lehmer’s prediction in this case? 2.5 Miscellaneous exercises 1. A raja wished to distribute his wealth among his three daughters Rana, Daya, and Cyndi such that Rana, the eldest, received half of his wealth, Daya received one-third, and Cyndi, the youngest, received one-ninth. Everything went well until the raja came to his seventeen elephants. He was in a quandary as to how to divide them amongst his daughters. To solve the problem he called in his lawyer who came riding her own elephant, which she, after surveying the situation, had coloured pink and placed among the seventeen elephants. The lawyer told Rana to take half or nine of the elephants, but not the pink one, which she did. The lawyer then told Daya to take a third or six of the elephants, but not the pink one, which Daya did. Then the lawyer told Cyndi to take 82 Divisibility the two elephants remaining that were not pink. The raja and his daughters were happy and after collecting her fee the lawyer took her pink elephant and rode home. How was she able to accomplish this remarkable feat? 2. Elephantine triples are triples or 3-tuples of numbers of the form (1=a, 1=b, 1=c) such that for the distinct positive integers a, b, c and some positive integer n, we have that 1=a þ 1=b þ 1=c ¼ n=(n þ 1). For example, (12, 13, 19) is an elephantine triple. Find two more examples of elephantine triples. 3. A reciprocal Pythagorean triple (a, b, c) has the property that (1=a)2 þ (1=b)2 ¼ (1=c)2. Show that (780, 65, 60) is a reciprocal Pythagorean triple. 4. Take three consecutive integers, with the largest a multiple of 3. Form their sum. Compute the sum of its digits, do the same for the result until a one-digit number is obtained. Iamblichus of Chalis claimed that the one-digit number obtained will always equal 6. For example, the sum of 9997, 9998 and 9999 is 29 994. The sum of the digits of 29 994 is 33 and the sum of the digits of 33 is 6. Prove Iamblichus’s claim. 5. Given a scale with two pans, determine the least number of weights and the values of the weights in order to weigh all integral weights in kilograms from 1 kilogram to 40 kilograms. [Bachet] 6. Explain how the following multiplication rule works. To multiply two given numbers, form two columns, each headed by one of the numbers. Successive terms in the left column are halved, always rounding down, and successive terms in the right column are doubled. Now strike out all rows with even numbers in the left column and add up the numbers remaining in the right column to obtain the product of a and b. For example, to determine 83 3 154 ¼ 12 782, we have: 83 154 41 308 20 616 10 1 232 5 2 464 2 4 928 1 9 856 12 782 7. In The Educational Times for 1882, Kate Gale of Girton College, Cambridge, proved that if 3n zeros are placed between the digits 3 and 7, then the number formed is divisible by 37. In addition, if 3n þ 1 2.5 Miscellaneous exercises 83 zeros are placed between the digits 7 and 3, the number formed is divisible by 37. Prove these statements. 8. LPetn f k¼1 ( n) xÀk 1 be the ¼ 1, for smallest positive integer value some positive integers x1, x2, . . of xn . , xnÀ1 such such that that 1 , x1 , x2 , Á Á Á , xn. Since 1 2 þ 1 3 þ 1 6 ¼ 1 and 6 is the smallest posi- tive integer with this property for n ¼ 3 it follows that f (3) ¼ 6. Determine f (4). 9. If a . 0, b . 0, and 1=a þ 1=b is an integer then show that a ¼ b and a ¼ 1 or a ¼ 2. 10. Show that in any set of n þ 1 integers selected from the set f1, 2, . . . , 2ng there must exist a pair of coprime integers. 11. Show that the product of k consecutive natural numbers is always divisible by k! [J.J. Sylvester] 12. Show that in any set of five consecutive positive integers there always exists at least one integer which is coprime to every other integer in the set. 13. A positive integer is called polite if it can be represented as a sum of two or more consecutive integers. For example, 7 is polite since 7 ¼ 3 þ 4. Similarly, 2 is impolite since it cannot be written as a sum of two or more consecutive integers. Show that the only impolite positive integers are powers of 2. 14. Use Heron’s foprmffiffiffiffiuffiffilffiffiaffiffiffiffifffioffiffiffirffiffiffitffiffihffiffieffiffiffiffiaffiffirffiffieffiffiaffiffiffiffiKffiffiffiffiffioffi f a triangle with sides a, b, c, namely, K ¼ s(s À a)(s À b)(s À c), where s ¼ (a þ b þ c)=2, to show that triangles with sides x ¼ 20k4 þ 4k2 þ 1, y ¼ 8k6 À 4k4 À 2k2 þ 1, and z ¼ 8k6 þ 8k4 þ 10k2, for k a positive integer, all have area 4k2(2k2 þ 1)2(2k2 À 1)2. 15. Prove that every natural number belongs to one of three basic digital root sequences. 16. Use the principle of induction to show that if c1, c2, . . . , ck are Qpaiik¼rw1 icsie, coprime then mjn. integers and ci j n, for i ¼ 1, 2, . . . , k, and m¼ 17. Prove, for all positive integers n, that n5=5 þ n3=3 þ 7n=15 is always an integer. 18. For n a positive integer, the Smarandache function S(n) is the smallest positive integer m such that n divides m!. For example, S(1) ¼ 1, S(2) ¼ 2, and S(3) ¼ 3. Determine S(n) for n ¼ 4, 5, . . . , 10. 19. Let h( p) denote the divisible by p, where p smallest positive . 3 is prime and ! nin¼tegPernk¼Às01ukc!hfotrhaant y!pho( spi)tivies integer n. For example, !4 ¼ 0! þ 1! þ 2! þ 3! ¼ 10, hence, h(5) ¼ 4. Determine h( p) when p ¼ 7 and p ¼ 11. 84 Divisibility 20. Establish the following connection between Fibonacci-type sequences and Pythagorean triples discovered by A.F. Horadam in 1961. If a1, a2, . . . is a Fibonacci-type sequence then for n > 3, (ananþ3, 2anþ1anþ2, 2anþ1anþ2 þ an2) is a Pythagorean triple. 21. If we were to extend the Fibonacci numbers, un, to include negative subscripts, that is unþ2 ¼ unþ1 þ un, where n is any integer, then determine a general rule for determining such an extended Fibonacci array. 2.6 Supplementary exercises 1. Show that if a divides c and a þ b ¼ c then a divides b. 2. If d 6¼ 0, c ¼ ax þ by, and d divides b and c, must d divide a? 3. For every positive integer n show that 2 divides n2 À n and 6 divides n3 À n. 4. For any positive integer n, show that 6 divides 7n3 þ 5n. 5. For any positive integer n show that 15 divides 24n À 1. 6. If n is an integer not divisible by 2 or 3, show that 24 divides n2 þ 23. 7. For any positive integer n show that 4 does not divide n2 þ 2. 8. Prove or disprove that for any positive integer n, 3 divides 2n3 þ 7. 9. Show that if a and b are odd integers then 8 divides a2 À b2. 10. If n is an odd integer show that 12 divides n2 þ (n þ 2)2 þ (n þ 4)2 þ 1. 11. If n is an odd integer show that 32 divides (n2 þ 3)(n3 þ 7). 13. Show that for any positive integer n, 1 þ 2 þ Á Á Á þ n divides 3(12 þ 22 þ Á Á Á þ n2). 14. Find a six-digit number n such that when the digit on the left is removed and placed at the end the new number equals 3n. 15. Show that the square of any odd integer must be of the form 8k þ 1. 16. A positive integer is called evil if it has an even number of ones in its base 2 representation. Determine the first fifteen evil numbers. 17. Show that if y2 ¼ x3 þ 2, then both x and y are odd. 18. Find gcd(23 . 52 . 7, 2 . 34 . 56). 19. Find the greatest common divisor of 1213 and 8658 and express it as a linear combination of 1213 and 8658. 20. Find the greatest common divisor of 198 and 243 and express it as a linear combination of 198 and 243. 21. Find the greatest common divisor of 527 and 765 and express it as a linear combination of 527 and 765. 2.6 Supplementary exercises 85 22. Find the greatest common divisor of 6409 and 42823 and express it as a linear combination of 6409 and 42823. 23. Find the greatest common divisor of 2437 and 51329 and express it as a linear combination of 2437 and 51329. 24. Find the greatest common divisor of 1769 and 2378 and express it as a linear combination of 1769 and 2378. 25. Show that for any integer n, gcd(14n þ 3, 21n þ 4) ¼ 1. 26. Determine the greatest common divisor of 5n þ 2 and 7n þ 3, where n is any integer. 27. Determine the least positive integer in the set f341x þ 527 yg, where x and y are integers. 28. If gcd(a, c) ¼ 1 and b divides c, show that gcd(a, b) ¼ 1. 29. Show that if gcd(a, b) ¼ 1 and ajbc, than ajc. 30. If a divides b, show that gcd(a, c) ¼ gcd(a, b þ c). 31. Show that gcd(un, unþ2) ¼ 1 or 2, where un denotes the nth Fibonacci number. 32. If gcd(a, b) ¼ 1, show that gcd(2a þ b, a þ 2b) ¼ 1 or 3. 33. Fin a, b, c such that gcd(a, b, c) ¼ 1, but gcd(a, b) . 1, gcd(a, b) . 1, and gcd(b, c) . 1. 34. Find two primitive Pythagorean triples that contain 17. 35. Find two primitive Pythagorean triples that contain 27. 36. If (x, y, z) and (z, xy, xy þ 1) are primitive Pythagorean triples show that x and y must be consecutive positive integers. 37. If (x, x þ 1, z) is a primitive Pythagorean triple show that (3x þ 2z þ 1, 3x þ 2z þ 2, 4x þ 3z þ 2) is a primitive Pythagorean triple. Hence, there are an infinite number of primitive Pythagorean triples whose legs are consecutive positive integers. 38. Show that (z, x(x þ 1), x(x þ 1) þ 1) is a primitive Pythagorean triple if and only if (x, x þ 1, z) is a primitive Pythagorean triple. 39. If the sum of two consecutive integers is a square, show that the two integers form the side and a diagonal of a Pythagorean triple. 40. If x2 þ y2 ¼ z2 show that 3 divides xy. 41. A positive integer n has the cycling digits property if every fraction m=n, with 1 < m , n, has a block of repeated digits (the repetend of m=n). That is a cyclic permutation of the repetend of 1=n. Show that 7, 17, and 19 have the cycling digits property. 42. Show that if an integer has the cycling digits property then it must be prime. 43. A positive integer n is called a Curzon number if 2n þ 1 divides 2n þ 1. Determine the first ten Curzon numbers. 86 Divisibility 44. A positive integer n is called a Zuckerman number if it is divisible by the product of its digits. Show that 3111, 1311, 1131, and 1113 are Zuckerman numbers. 45. Given that 1, 2, . . . , 9 are Zuckerman numbers. Determine the next fifteen Zuckerman numbers. 46. A positive integer n is called a riven (or reduced Niven) number if it is divisible by its digital root. Determine the first ten riven numbers. 47. A positive integer is called b-Niven (b-riven) if it is divisible by the sum of its digits (digital root) in base b. Show that every positive integer is 2-riven and 3-riven. 48. In the fourth, fifth and sixth row of Pascal’s Triangle the hexagon 46 5 10 15 20 appears. Note that 5 . 6 . 20 ¼ 4 . 10 . 15 and gcd(5, 6, 20) ¼ 1 ¼ gcd(4, 10, 15). Is this true in general? Namely, for positive integersnand k, with n . k,does    n kþ1 nþ1 kþ 2 n k þ2 þ3  ¼ n nþ1 k k þ 3 nþ2 kþ2 and gcd n kþ1 , nþ1 kþ2 , nþ2 k þ 3      ¼ gcd n k , nþ1 kþ3 , nþ2 kþ2 ? 49. 50. FIPfoSr1k¼(nn1a1) =dpSeo(nsniotktiev)seditivhneetergSgemesraftroharenadpnasycehupedoosf-uitSnivmcetaioirnantnesdghaeocrwhne.thfuant ctthieoninSfiÃn(itne) series is the smallest positive integer m such that n divides the mth triangular number. Determine SÃ(n) for n ¼ 2 to 15. 3 Prime numbers I was taught that the way of progress is neither swift nor easy. Marie Curie 3.1 Euclid on primes In this section, we investigate the fundamental structure of the integers. Playing the role of indivisible quantities are those integers designated as being prime. A positive integer, other than unity, is said to be prime if its only positive divisors are unity and itself. That is, a prime number is an integer greater than 1 with the minimal number of positive integral divisors. A positive integer which is neither unity nor prime is called composite. By considering unity as being neither prime or composite, we follow the custom of the Pythagoreans, the first group to distinguish between primes and composites. Unfortunately, there is no efficient method to determine whether or not a given number is prime. Eratosthenes of Cyrene (now in Libya) devised a technique, referred to as the sieve of Eratosthenes, to find prime numbers. Eratosthenes was a Greek mathematician–astronomer who served as director of the Library at Alexandria under Ptolemy III and was the first to calculate accurately the size of the earth and the obliquity of the earth’s axis. He was also an athlete, a poet, a philosopher and an historian. He was called Pentathlus by his friends for his success in five Olympic sports. His enemies called him Beta for they considered him to be second in most fields of learning and first in none. Eratosthenes called himself Philologus, one who loves learning. According to legend, Eratosthenes, after all his accomplishments, ended his life at age 80 by starvation. In order to determine all the primes less than or equal to the positive integer n using Eratosthenes’s sieve, list all the integers from 2 to n. The smallest number, 2, must be prime making it the only even prime and perhaps the oddest prime of all. Every alternate number after 2 must be composite so cross them out. The smallest integer greater than 2 not 87