Problem Solving and Recreational

Paul Yiu

Department of Mathematics Florida Atlantic University

Summer 2012

Chapters 1–44

August 1

Monday 6/25 7/2 7/9 7/16 7/23 7/30 Wednesday 6/27 *** 7/11 7/18 7/25 8/1 Friday 6/29 7/6 7/13 7/20 7/27 8/3 ii Contents

1 Digit problems 101 1.1 When can you cancel illegitimately and yet get the cor- rectanswer? ...... 101 1.2 ...... 103 1.3 Sortednumberswithsortedsquares ...... 105 1.4 Sumsofsquaresofdigits ...... 108

2 Transferrable 111 2.1 Right-transferrablenumbers ...... 111 2.2 Left-transferrableintegers ...... 113

3 Arithmetic problems 117 3.1 AnumbergameofLewisCarroll ...... 117 3.2 Reconstruction of multiplicationsand divisions . . . . . 120 3.2.1 Amultiplicationproblem...... 120 3.2.2 Adivisionproblem ...... 121

4 Fibonacci numbers 201 4.1 TheFibonaccisequence ...... 201 4.2 SomerelationsofFibonaccinumbers ...... 204 4.3 Fibonaccinumbersandbinomialcoefficients ...... 205

5 Counting with Fibonacci numbers 207 5.1 Squaresanddominos ...... 207 5.2 Fatsubsetsof [n] ...... 208 5.3 Anarrangementofpennies ...... 209

6 Fibonacci numbers 3 211 6.1 FactorizationofFibonaccinumbers ...... 211 iv CONTENTS

6.2 TheLucasnumbers ...... 214 6.3 Countingcircularpermutations ...... 215

7 Subtraction games 301 7.1 TheBachetgame ...... 301 7.2 TheSprague-Grundysequence ...... 302 7.3 Subtraction of powers of 2 ...... 303 7.4 Subtractionofsquarenumbers ...... 304 7.5 Moredifficultgames...... 305

8 The games of Euclid and Wythoff 307 8.1 ThegameofEuclid ...... 307 8.2 Wythoff’sgame ...... 309 8.3 Beatty’sTheorem ...... 311

9 Extrapolation problems 313 9.1 Whatis f(n + 1) if f(k)=2k for k =0, 1, 2 ...,n? . . 313 1 9.2 Whatis f(n + 1) if f(k)= k+1 for k =0, 1, 2 ...,n? . 315 9.3 Whyis ex notarationalfunction? ...... 317

10 The Josephus problem and its generalization 401 10.1 TheJosephusproblem ...... 401 10.2 Chamberlain’ssolution ...... 403 10.3 The generalized Josephus problem J(n, k) ...... 404

11 The nim game 407 11.1 Thenimsum...... 407 11.2 Thenimgame ...... 408

12 Prime and perfect numbers 411 12.1 Infinitudeofprimenumbers ...... 411 12.1.1 Euclid’sproof...... 411 12.1.2 Fermatnumbers ...... 411 12.2 ThesieveofEratosthenes ...... 412 12.2.1 A visualization of the sieveof Eratosthenes . . . 412 12.3 Theprimenumbersbelow20000 ...... 414 12.4 Perfectnumbers ...... 415 12.5 Mersenneprimes...... 416 12.6 CharlesTwiggonthefirst10perfectnumbers . . . . . 417 12.7 Primesinarithmeticprogression ...... 421 CONTENTS v

12.8 Theprimenumberspirals ...... 421 12.8.1 The prime spiral beginningwith 17 . . . 422 12.8.2 The spiral beginningwith 41 . . . 423

13 Cheney’s card trick 501 13.1 Threebasicprinciples ...... 501 13.1.1 Thepigeonholeprinciple ...... 501 13.1.2 Arithmetic modulo 13 ...... 501 13.1.3 Permutationsofthreeobjects...... 502 13.2 Examples...... 503

14 Variations of Cheney’s card trick 505 14.1 Cheney card trick with spectator choosing secret card . 505 14.2 A 3-cardtrick ...... 507

15 The Catalan numbers 511 15.1 Numberofnonassociativeproducts ...... 511

16 The golden ratio 601 16.1 Divisionofasegmentinthegoldenratio ...... 601 16.2 Theregularpentagon ...... 603 16.3 Construction of 36◦, 54◦, and 72◦ angles ...... 604 16.4 Themostnon-isoscelestriangle ...... 608

17 Medians and angle Bisectors 609 17.1 Apollonius’Theorem ...... 609 17.2 Anglebisectortheorem ...... 611 17.3 Theanglebisectors ...... 612 17.4 Steiner-LehmusTheorem ...... 613

18 Dissections 615 18.1 Dissection of the 6 6 square...... 615 × 18.2 Dissectionof a 7 7 squareintorectangles...... 617 18.3 Dissectarectangletoformasquare× ...... 619 18.4 Dissectionofasquareintothreesimilarparts ...... 620

19 Pythagorean triangles 701 19.1 PrimitivePythagoreantriples ...... 701 19.1.1 Rationalangles ...... 702 vi CONTENTS

19.1.2 Some basic properties of primitive Pythagorean triples...... 702 19.2 A Pythagorean trianglewithan inscribedsquare . . . . 704 19.3 When are x2 px q bothfactorable? ...... 705 19.4 Dissection of− a square± into Pythagorean triangles . . . . 705

20 Integer triangles with a 60◦ or 120◦ angle 707 20.1 Integer triangles with a 60◦ angle ...... 707 20.2 Integer triangles with a 120◦ angle ...... 710

21 Triangles with centroid on incircle 713 21.1 Construction ...... 714 21.2 Integertriangleswithcentroidontheincircle ...... 715

22 The area of a triangle 801 22.1 Heron’sformulafortheareaofatriangle ...... 801 22.2 Herontriangles...... 803 22.2.1 TheperimeterofaHerontriangleiseven . . . . 803 22.2.2 The area of a Heron triangle is divisible by 6 . . 803 22.2.3 Heron triangles with sides < 100 ...... 804 22.3 Heron triangles with sides in arithmetic progression . . 805 22.4 IndecomposableHerontriangles ...... 807 22.5 Herontriangleaslatticetriangle...... 809

23 Heron triangles 811 23.1 Herontriangleswithareaequaltoperimeter ...... 811 23.2 Herontriangleswithintegerinradii ...... 812 23.3 Division of a triangle into two subtriangles with equal incircles ...... 813 23.4 Inradiiinarithmeticprogression...... 817 23.5 Herontriangleswithintegermedians ...... 818 23.6 Herontriangleswithsquareareas ...... 819

24 TriangleswithsidesandonealtitudeinA.P. 821 24.1 Newton’ssolution ...... 821 24.2 Thegeneralcase ...... 822

25 The Pell Equation 901 25.1 The equation x2 dy2 =1 ...... 901 25.2 The equation x2 − dy2 = 1 ...... 903 − − CONTENTS vii

25.3 The equation x2 dy2 = c ...... 903 − 26 Figurate numbers 907 26.1 Whichtriangularnumbersaresquares?...... 907 26.2 Pentagonalnumbers ...... 909 26.3 Almostsquaretriangularnumbers...... 911 26.3.1 Excessivesquaretriangularnumbers ...... 911 26.3.2 Deficientsquaretriangularnumbers ...... 912

27 Special integer triangles 915 27.1 AlmostisoscelesPythagoreantriangles ...... 915 27.1.1 The generators of the almost isosceles Pythagorean triangles...... 916

27.2 Integer triangles (a, a +1, b) with a 120◦ angle . . . . . 917

28 Heron triangles 1001 28.1 Herontriangleswithconsecutivesides ...... 1001 28.2 Heron triangles with two consecutivesquare sides . . . 1002

29 Squares as sums of consecutive squares 1005 29.1 Sumofsquaresofnaturalnumbers ...... 1005 29.2 Sumsofconsecutivesquares: oddnumbercase . . . . . 1008 29.3 Sumsofconsecutivesquares: evennumbercase . . . . 1010 29.4 Sumsofpowersofconsecutiveintegers ...... 1012

30 Lucas’ problem 1013 30.1 Solution of n(n + 1)(2n +1)=6m2 for even n . . . . 1013 30.2 The Pell equation x2 3y2 =1 revisited ...... 1014 − 30.3 Solution of n(n + 1)(2n +1)=6m2 for odd n . . . . .1015

31 Some geometry problems 1101

32 Basic geometric constructions 1109 32.1 Somebasicconstructionprinciples ...... 1109 32.2 Geometricmean ...... 1110 32.3 Harmonicmean ...... 1111 32.4 A.M G.M. H.M...... 1112 ≥ ≥ viii CONTENTS

33 Construction of a triangle from three given points 1115 33.1 Someexamples ...... 1115 33.2 Wernick’sconstructionproblems ...... 1117

34 The classical triangle centers 1201 34.1 Thecentroid ...... 1201 34.2 Thecircumcircleandthecircumcenter ...... 1202 34.3 Theincenterandtheincircle ...... 1203 34.4 TheorthocenterandtheEulerline...... 1204 34.5 Theexcentersandtheexcircles ...... 1205

35 The nine-point circle 1207 35.1 Thenine-pointcircle...... 1207 35.2 Feuerbach’stheorem...... 1208 35.3 Lewis Carroll’s unused geometry pillowproblem . . . . 1209 35.4 Johnson’stheorem ...... 1211 35.5 Triangles with nine-point center on the circumcircle . . 1212

36 The excircles 1213 36.1 Arelationamongtheradii ...... 1213 36.2 Thecircumcircleoftheexcentraltriangle ...... 1214 36.3 Theradicalcircleoftheexcircles ...... 1215 36.4 Apollonius circle: the circular hull of the excircles . . . 1216 36.5 Three mutually orthogonal circles with given centers . . 1217

37 The Arbelos 1301 37.1 Archimedes’twincircletheorem ...... 1301 37.2 Incircleofthearbelos ...... 1302 37.2.1 Constructionofincircleofarbelos ...... 1304 37.3 Archimedeancirclesinthearbelos ...... 1304 37.4 Constructionsoftheincircle...... 1307

38 Menelaus and Ceva theorems 1309 38.1 Menelaus’theorem ...... 1309 38.2 Ceva’stheorem...... 1311

39 Routh and Ceva theorems 1317 39.1 Barycentriccoordinates ...... 1317 39.2 Cevianandtraces ...... 1318 39.3 Areaandbarycentriccoordinates ...... 1320 CONTENTS ix

40 Elliptic curves 1401 40.1 AproblemfromDiophantus...... 1401 40.2 Dudeney’spuzzleofthedoctorofphysic ...... 1403 40.3 Grouplawon y2 = x3 + ax2 + bx + c ...... 1404

41 Applications of elliptic curves to geometry problems 1407 41.1 Pairs of isoscelestriangleand rectanglewithequal perime- tersandequalareas ...... 1407 41.2 Triangles with a median, an altitude, and an angle bi- sectorconcurrent...... 1409

42 Integer triangles with an altitude equal to a bisector 1411 42.1 Aquarticequation ...... 1411 42.2 Transformation of a quartic equation into an elliptic curve1413

43 The equilateral lattice L (n) 1501 43.1 Countingtriangles ...... 1501 43.2 Countingparallelograms...... 1504 43.3 Countingregularhexagons ...... 1505

44 Counting triangles 1509 44.1 Integer triangles of sidelengths n ...... 1509 44.2 Integer scalene triangles with sidelengths≤ n . . . . .1510 44.3 Number of integer triangles with perimeter≤n ...... 1511 44.3.1 The partition number p3(n) ...... 1511

Chapter 1

Digit problems

1.1 When can you cancel illegitimately and yet get the correct answer?

Let ab and bc be 2-digit numbers. When do such illegitimate cancella- tions as

ab ab a bc = bc6 = c , 6 a allowing perhaps further simplifications of c ? 16 1 19 1 26 2 49 4 Answer. 64 = 4 , 95 = 5 , 65 = 5 , 98 = 8 . Solution. We may assume a, b, c not all equal. 10a+b a Suppose a, b, c are positive integers 9 such that 10b+c = c . (10a + b)c = a(10b + c), or (9a + b≤)c = 10ab. If any two of a, b, c are equal, then all three are equal. We shall therefore assume a, b, c all distinct. 9ac = b(10a c). If b is not divisible− by 3, then 9 divides 10a c = 9a +(a c). It follows that a = c, a case we need not consider. − − It remains to consider b =3, 6, 9. Rewriting (*) as (9a + b)c = 10ab. If c is divisible by 5, it must be 5, and we have 9a + b = 2ab. The only possibilities are (b, a)=(6, 2), (9, 1), giving distinct

(a, b, c)=(1, 9, 5), (2, 6, 5). 102 Digit problems

If c is not divisible by 5, then 9a + b is divisible by 5. The only possibilities of distinct (a, b) are (b, a) = (3, 8), (6, 1), (9, 4). Only the latter two yield (a, b, c)=(1, 6, 4), (4, 9, 8).

Exercise 1. Find all possibilities of illegitimate cancellations of each of the fol- lowing types, leading to correct results, allowing perhaps further simplifications.

abc c (a) b6 ad6 = d , 6 6 cab c (b) d6ba6 = d , 6 6 abc a (c) bcd6 6 = d . 6 6 2. Find all 4-digit numbers like 1805 = 192 5, which, when divided by the its last two digits, gives the square× of the number one more than its first two digits. 1.2 Repdigits 103

1.2 Repdigits

A is a number whose decimal representation consists of a rep- etition of the same decimal digit. Let a be an integer between 0 and 9. For a positive integer n, the repdigit an consists of a string of n digits each equal to a. Thus, a a = (10n 1). n 9 −

Exercise 1. Show that 16 1 19 1 26 2 49 4 n = , n = , n = , n = . 6n4 4 9n5 5 6n5 5 9n8 8

Solution. More generally, we seek equalities of the form abn = a for bnc c distinct integer digits a, b, c. Here, abn is digit a followed by n digits each equal to b. To avoid confusion, we shall indicate multiplication with the sign . The condition× (ab ) c =(b c) a is equivalent to n × n × b 10b 10na + (10n 1) c = (10n 1)+ c a, 9 − 9 −     b 10b (10n 1)a + (10n 1) c = (10n 1) a. − 9 − 9 −     10n 1 Cancelling a common 9− , we obtain (9a + b)c = 10ab, which ab a is the same condition for bc = c . 104 Digit problems

Exercise 1. Prove that for 1 a, b 9, a b = b a . ≤ ≤ × n × n 2. Complete the following multiplication table of repdigits.

1n 2n 3n 4n 5n 6n 7n 8n 9n 1 1n 2n 3n 4n 5n 6n 7n 8n 9n 2 4n 6n 8n 1n0 13n 12 15n 14 17n 16 19n 18 − − − − 3 9n 13n 12 16n 15 19n 18 23n 11 26n 14 29n 17 − − − − − − 4 17n 16 2n0 26n 14 31n 208 35n 12 39n 16 − − − − − 5 27n 15 3n0 38n 15 4n0 49n 15 − − − 6 39n 16 46n 12 53n 228 59n 14 − − − − 7 54n 239 62n 216 69n 13 − − − 8 71n 204 79n 12 − − 9 98n 201 −

3. Verify 26n = 2 . 6n5 5 Solution. It isenoughto verify 5 (26 )=2 (6 5). × n × n

5 (26 )= 5(20 +6 )=10 +3 0=13 0; × n n n n+1 n n 2 (6n5)= 2(6n0+5)=13n 120+10=13n0. × −

4. Simplify (1n)(10n 15). − Answer. (1n)(10n 15)=1n5n. − 1.3Sortednumberswithsortedsquares 105

1.3 Sorted numbers with sorted squares

A number is sorted if its digits are nondecreasing from left to right. It is strongly sorted if its square is also sorted. It is known that the only strongly sorted integers are given in the table below. 1 1, 2, 3, 6, 12, 13, 15, 16, 38, 116, 117. • 16 7. • n 3 4. • n 3 5. • n 3 6 7. • m n

(3 5 )2 =(10 3 + 5)2 n 1 · n =100 (3 )2 + 100 (3 )+25 · n · n =1n 108n 19102 +3n25 − − =1n 112n 1225 − − =1n2n+15.

If x =3m6n7, then 3x = 10m 110n1, and it is easy to find its square. −

2 1m3m4n m+16m8n9, if n +1 m, (3m6n7) = − ≥ 1m3n+15m n 16n+18n9, if n +1 < m. ( − −

More generally, the product of any two numbers of the form 3m6n7 is sorted.

1Problem 1234, Math. Mag., 59 (1986) 1, solution, 60 (1987)1. See also R. Blecksmith and C. Nicol, Monotonic numbers, Math. Mag., 66 (1993) 257–262. 106 Digit problems

Exercise

1. Find all natural numbers whose square (in base 10) is represented by odd digits only.

2. Find the three 3-digit numbers each of which is equal to the product of the sum of its digits by the sum of the squares of its digits. Answer. 133, 315, 803.

3. Find all 4-digit numbers abcd such that √3 abcd = a + b + c + d. Answer. 4913 and 5832. Solution. There are only twelve 4-digit numbers which are cubes. For only two of them is the root equal to the sum of digits.

n 10 11 12 13 14 17 16 17 18 19 20 21 n3 1000 1331 1728 2197 2744 3375 4096 4913 5832 6859 8000 9261 ∗∗∗ ∗∗∗

4. Use each digit 1, 2, 3, 4, 5, 6, 7, 8, 9 exactly once to form prime numbers whose sum is smallest possible. What if we also include the digit 0?

5. There are exactly four 3-digit numbers each equal to the sum of the cubes of its own digits. Three of them are 153, 371, and 407. What is the remaining one?

6. Find all possibilities of a 3-digit number such that the three num- bers obtained by cyclic of its digits are in arithmetic progression. Answer. 148, 185, 259, 296. Solution. Let abc be one such 3-digit numbers, with a smallest among the digits (which are not all equal). The other two numbers are bca and cab. Their sum abc + bca + cab = 111 (a + b + c). Therefore the middle number = 37 (a + b + c). × × We need therefore look for numbers of the form abc = 37 k with equal to s, and check if 37 s = bca or cab.× We may ignore multiples of 3 for k (giving repdigits× for 37 k). Note that 3k < 27. We need only consider k =4, 5, 7, 8. × 1.3Sortednumberswithsortedsquares 107

k 37 k s 37 s arithmetic progression 4 148× 13 13 37=481× 148, 481, 814 5 185 14 14 × 37=518 185, 518, 851 7 259 16 16 × 37=592 259, 592, 925 8 296 17 17 × 37=629 296, 629, 962 ×

7. A 10-digit number is called pandigital if it contains each of the dig- its 0, 1,..., 9 exactly once. For example, 5643907128 is pandigi- tal. We regard a 9-digit number containing each of 1,..., 9 exactly once as pandigital (with 0 as the leftmost digit). In particular, the number A := 123456789 is pandigital. There are exactly 33 positive integers n for which nA are pandigital as shown below.

n nA n nA n nA 1 123456789 2 246913578 4 493827156 5 617283945 7 864197523 8 987654312 10 1234567890 11 1358024679 13 1604938257 14 1728395046 16 1975308624 17 2098765413 20 2469135780 22 2716049358 23 2839506147 25 3086419725 26 3209876514 31 3827160459 32 3950617248 34 4197530826 35 4320987615 40 4938271560 41 5061728349 43 5308641927 44 5432098716 50 6172839450 52 6419753028 53 6543209817 61 7530864129 62 7654320918 70 8641975230 71 8765432019 80 9876543120

How would you characterize these values of n? 8. Find the smallest N, such that, in the decimal nota- tion, N and 2N together use all the ten digits 0, 1,..., 9. Answer. N = 13485 and 2N = 26970. 108 Digit problems

1.4 Sums of squares of digits

Given a number N = a1a2 an of n decimal digits, consider the “sum of digits” ···

s(N)= a2 + a2 + + a2 . 1 2 ··· n For example

s(11) = 2, s(56) = 41, s(85) = 89, s(99) = 162.

For a positive integer N, consider the sequence

S(N) : N, s(N), s2(N), ...,sk(N), ...,

where sk(N) is obtained from N by k applications of s. Theorem 1.1. For every positive integer N, the sequence S(N) is either eventually constant at or periodic. The period has length 8 and form a cycle

Exercise

n 1 1. Prove by mathematical induction that 10 − > 81n for n 4. ≥ Solution. Clearly this is true for n =4: 103 > 81 4. n 1 · Assume 10 − > 81n. Then

n n 1 10 = 10 10 − > 10 81n> 81(n + 1). · · n 1 Therefore, 10 − > 81n for n 4. ≥ 1.4 Sums of squares of digits 109

2. Prove that if N has 4 or more digits, then s(N) < N. Solution. If N has n digits, then n 1 (i) N 10 − , (ii) s(N≥) 81n. ≤ n 1 From the previous exercise, for n 4, N 10 − > 81n s(N). ≥ ≥ ≥ 3. Verify a stronger result: if N has 3 digits, then s(N) < N. Solution. We seek all 3-digit numbers N = abc for which s(N) N. ≥ (i) Since s(N) 243, we need only consider n 243. ≤ ≤ (ii) Now if a =2, then s(N)=4+ b2 + c2 186 < N. Therefore a =1. ≤ (iii) s(N)=12 +b2 +c2 is a 3-digit number if and only if b2 +c2 99. Here are the only possibilities: ≥

(b, c) (5, 9) (6, 9) (7, 9) (8, 9) (9, 9) (6, 8) (7, 8) (8, 8) (9, 5) (9, 6) (9, 7) (9, 8) (8, 6) (8, 7) s(N) 107 118 131 146 183 101 114 129

Therefore there is no 3-digit number N satisfying s(N) N. ≥ 4. For a given integer N, there is k for which sk(N) is a 2-digit num- ber. 5. If n is one of the integers 1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, then sk(N)=1 for some k.

7 70

44 94 19 91

49 23 79 82 32 28 97 31 86

13 130 68

10 100

1 110 Digit problems

6. If N is a 2-digit integer other than 1, 7, 10, 13, 19, 23, 28, 31, 32, 44, 49, 68, 70, 79, 82, 86, 91, 94, 97, then the sequence S(N) is eventually cycling between 4, 16, 37, 58, 89, 145, 42, 20.

60 6

63

36

66 54

45

84 48 22 27 14

72 41

35 71

80 8 53 17

46 43 5

64 34 50

52 25

29

67 76 92 3 77 83

85 9 30 98 38 81 73 89 56 39 145 58 61 90 47 65 93

42 37 33 95 18 57

20 16 106 74 75 4 59 40 24 62

2 26

11 51

113 117

69 78 87

128

88 Chapter 2

Transferrable numbers

2.1 Right-transferrable numbers

A positive integer is right-transferrable if in moving its leftmost digit to the rightmost position results in a multiple of the number. Suppose a right-transferrable number X has n digits, with leftmost digit a. We have

n 1 10(X a 10 − )+ a = kX − · for some integer k satisfying 1 k 9. From this, ≤ ≤ (10 k)X = a(10n 1)=9 a , − − × n and 9 a 1 X = × × n . 10 k −

Clearly, k =1 if and only if X = an, a repdigit. We shall henceforth assume k > 1. Since X is an n-digit number, we must have a< 10 k. Most of the combinations of (a, k) are quickly eliminated. In the table− below, N indicates that X is not an integer, and R indicates that X is a repdigit (so that k cannot be greater than 1). 112 Transferrable numbers

k a 1 2 3 4 5 6 7 8 9 2\ N N N N N N N 3 ∗ ∗ 4 N R N R N ∗ ∗ ∗ 5 N N N N ∗ ∗ ∗ ∗ 6 N N N ∗ ∗ ∗ ∗ ∗ 7 R R ∗ ∗ ∗ ∗ ∗ ∗ 8 N ∗ ∗ ∗ ∗ ∗ ∗ ∗ 9 ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ This table shows that k must be equal to 3, and a(10n 1) X = − . 7 Since a < 7, we must have 7 dividing 10n 1. This is possible only if 106m−1 n is a multiple of 6. Therefore X = a 7 − and has first digit a. Now, · 106m 1 − = (142857) . 7 m It is easy to see that a can only be 1 or 2. Therefore, the only right-transferrable numbers are (142857)m and (285714)m with k =3: 3 (142857) = (428571) , × m m 3 (285714) = (857142) . × m m 2.2 Left-transferrable integers 113

2.2 Left-transferrable integers

A positive integer is left-transferrable if moving its rightmost digit to the leftmost results in a multiple of the number. Suppose Y is a left- transferrable with rightmost digit b. Then

n 1 Y b b 10 − + − = kY · 10 for an integer k. From this,

(10k 1)Y = b(10n 1). − −

Again, k =1 if and only if Y = bn. We shall assume k> 1. Note that for k = 2, 3, 6, 8, 9, p = 10k 1 is a prime number p > 10 > b. It divides 10n 1. By Fermat’s theorem,− the order of 10 mod p is a divisor of p 1. − −

k n 2 19Y = b(10n 1) 19 10n 1 18m 3 29Y = b(10n − 1) 29|10n − 1 28m 4 39Y = b(10n − 1) b =3| , 6−, 9; 39 10n 1 6m 5 49Y = b(10n − 1) b =7;6 49 10n | 1− 42m − b =7;6 7 10| n −1 6m 6 59Y = b(10n 1) 59 10n | 1− 58m 7 69Y = b(10n − 1) b =3| , 6−, 9; 69 10n 1 22m 8 79Y = b(10n − 1) 796 10n 1| − 13m 9 89Y = b(10n − 1) 89|10n − 1 44m − | −

Consider the case k =2. We have n = 18m. If we take n = 18, then

b(1018 1) Y = − = b 52631578947368421. 19 ×

1018 1 Note that A = 19− = 52631578947368421 has only 17 nonzero digits, we treat it as an 18-digit number 052631578947368421. For each b(1018 1) − b =1,..., 9, the number Yb = 19 is right-transferrable with k =2: 114 Transferrable numbers

b b A rightmost digit to leftmost × 1 052631578947368421 105263157894736842 2 105263157894736842 210526315789473684 3 157894736842105263 315789473684210526 4 210526315789473684 421052631578947368 5 263157894736842105 526315789473684210 6 315789473684210526 631578947368421052 7 368421052631578947 736842105263157894 8 421052631578947368 842105263157894736 9 473684210526315789 947368421052631578

More generally, for each of these Yb and arbitrary positive integer m,

Yb,m = Yb ((1017)m 1)1=(Yb)m × − is also left-transferrable with k =2.

Proof. Write Yb = Xbb for a 17-digit number Xb. Transferring the right- most digit of (Yb)m to the leftmost, we have (bX ) = (2 Y ) =2 (Y ) . b m × b m × b m

The same holds for the other values of k > 1 as shown in the table below, except for k =5, where we also have 714285 = 5 142857. ×

k p 2 19 052631578947368421 3 29 0344827586206896551724137931 4 025641 5 020408163265306122448979591836734693877551 142857 6 59 016949152542372881355932203389830508474576271186440∗ 6779661 7 0144927536231884057971 8 79 0126582278481 9 89 01123595505617977528089887640449438202247191 2.2 Left-transferrable integers 115

Exercise 1. What digits should be substituted for the letters so that the sum of the nine identical addends will be a ?

REPUNITS REPUNITS REPUNITS REPUNITS REPUNITS REPUNITS REPUNITS + REPUNITS

2. Are two repunits with consecutive even numbers as their subscripts relatively prime? 3. Are two repunits with consecutive numbers as their subscripts rel- atively prime? 4. Are two repunits with consecutive odd numbers as their subscripts relatively prime? 5. What digit does each letter of this multiplication represent?

RRRRRRR RRRRRRR REPUNIT× INUPER

6. An old car dealer’s record in the 1960’s shows that the total receipts for the sale of new cars in one year came to 1, 111, 111.00 dollars. If each car had eight cylinders and was sold for the same price as each other car, how many cars did he sell? (Note: This riddle was written before the inflation in the 1980’s). 7. If a Mersenne number M =2p 1 is prime, is the corresponding p − repunit 1p also prime? 116 Transferrable numbers Chapter 3

Arithmetic problems

3.1 A number game of Lewis Carroll

How would you get A from D?

Take a secret number A Multiply it by 3 Tell me if it is even or odd Do the corresponding routine as instructed below. Multiply by 3 Tell me if it is even or odd Do the corresponding routine B Add 19 to the original number A and put an extra digit at the end C Now add B and C Divide by 7 and get the quotient only Further divide by 7 and get the quotient only D Tell me this D and I shall give you back your A

odd routine: Add 5 or 9, then divide by 2, and then add 1. • even routine: Subtract 2 or 6, then divide by 2, and then add 29 or • 33 or 37. 118 Arithmetic problems

Solution. A can be obtained from D by (i) forming 4D 15, (ii) subtracting 3−if the first parity answer is even, and (iii) subtracting 2 if the second parity answer is even. Analysis.

e and e′ are either 0 or 1. • f and f ′ are 1, 0, or 1. • − g is an integer between 0 and 9. • The last two steps of dividing by 7 and keeping the quotients can • be combined into one single step of dividing by 49.

A 4k + 1 4k + 2 4k + 3 4k + 4 3A 12k + 3 12k + 6 12k + 9 12k + 12 Parity odd even odd even Routine 6k +5+2e 6k + 35 6k +8+2e 6k + 38 −2e + 4f −2e + 4f 3 times 18k + 15 + 6e 18k + 105 18k + 24 + 6e 18 + 114 −6e + 12f −6e + 4f Parity odd odd even even Routine B 9k + 11 9k + 56 9k + 43 9k + 89 ′ ′ ′ ′ +3e + 2e −3e + 2e +3e − 2e −3e − 2e ′ ′ +6f +4f +6f + 4f C 40k + 200 + g 40k + 210 + g 40k + 220 + g 40k + 230 + g B + C 49k + 211 + g 49k + 266 + g 49k + 263 + g 49k + 319 + g +3e + 2e′ −3e + 2e′ +3e − 2e′ −3e − 2e′ ′ ′ +6f +4f +6f + 4f lower bound 49k + 211 49k + 257 49k + 257 49k + 304 upper bound 49k + 225 49k + 283 49k + 279 49k + 318 D k + 4 k + 5 k + 5 k + 6 A 4D − 15 4D − 18 4D − 17 4D − 20 3.1 A number game of Lewis Carroll 119

Exercise 1. There is a list of n statements. For k = 1, 2,...,n, the k-th state- ment reads:

The number of false statements in this list is greater than k.

Determine the truth value of each of the statements.

Answer. n must be an odd number. Write n =2m +1. Statements 1,..., m are true, and statements m+1,..., n are false. 2. A man rowing upstream passes a log after a miles, then contin- ues for b hours, and then rows downstream, meeting the log at his starting point. What is the rate of the stream? 3. If a man takes h hours to make a certain trip, how much faster must he travel to make a trip m miles longer in the same time? 4. The ratio of the speeds of two trains is equal to the ratio of the time they take to pass each other going in the same direction to the time they take to pass each other in the opposite direction. Find the ratio of the speeds of the two trains. 5. You and I are walking toward each other along a straight road, each at a steady speed. A truck (also traveling at a steady speed) passes you in one second, and one second later it reaches me. One second after the truck has passed me, you and I meet. How long does the truck take to pass me? 6. The two hands of a clock have the same length. One can, neverthe- less, normally tell the correct time. For example, when the hands point at 6 and 12, it must be 6 O’clock, and cannot be otherwise. In every 12 hours period, there are, however, a number of occa- sions when it is impossible to tell the time. Exactly how many such occasions are there? 120 Arithmetic problems

3.2 Reconstruction of multiplications and divisions

3.2.1 A multiplication problem A multiplication of a three-digit number by 2-digit number has the form in which all digits involved are prime numbers. Reconstruct the multi- plication. (Note that 1 is not a prime number).

p p p p p × p p p p p ppp p pppp 3.2 Reconstruction of multiplications and divisions 121

3.2.2 A division problem

This is Problem E1 of the AMERICAN MATHEMATICAL MONTHLY:

x 7 x x x x x x) xxxxxxxx xxxx x x x x x x xxxx x x x xxxx xxxx

Clearly, the last second digit of the quotient is 0. Let the divisor be the 3-digit number d. Consider the 3-digit number in the seventh line, which is a multiple of d. Its difference from the 4-digit number in the sixth line is a 2-digit number. This must be 9xx. This cannot be the same as the 3-digit number in the fifth line, since the difference between the 3-digit numbers in the fourth and fifth lines is a 3-digit number. Therefore, in the quotient, the digit after 7 is a larger one, which must be smaller than the first and the last digits, since these give 4-digit multiples of d. It follows that the quotient is 97809. Since 8d is a 3-digit number 9xx, the 4-digit number in the third and bottom lines is 9d = 10xx or 11xx. From this 8d must be 99x, and therefore 992 = 8 124. × 97809 124)12128316 1116 9 6 8 8 6 8 1003 9 9 2 1116 1116 122 Arithmetic problems

Exercise

Reconstruct the following division problems.

1.

) ∗∗∗∗∗2 ∗ ∗ ∗∗∗∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗

2.

) ∗∗∗∗∗9 ∗ ∗ ∗∗∗∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗ ∗

3.

x x 8 x x x x x) xxxxxxxx x x x xxxx x x x xxxx xxxx 3.2 Reconstruction of multiplications and divisions 123

4. xxxxxx x x x) xxxxxxxx x x x xxxx x x x xxxx x x x xxxx xxxx Chapter 4

Fibonacci numbers

4.1 The Fibonacci sequence

The Fibonacci numbers Fn are defined recursively by

Fn+1 = Fn + Fn 1, F0 =0, F1 =1. − The first few Fibonacci numbers are n 0123456 7 8 9 1011 12 . . . Fn 0 1 1 2 3 5 8 13 21 34 55 89 144 . . .

An explicit expression can be obtained for the Fibonacci numbers by finding their , which is the formal

F (x) := F + F x + + F xn + . 0 1 ··· n ··· From the defining relations, we have

F x2 = F x x + F x2, 2 1 · 0 · F x3 = F x2 x + F x x2, 3 2 · 1 · F x4 = F x3 x + F x2 x2, 4 3 · 2 · . . n n 1 n 2 2 Fnx = Fn 1x − x + Fn 2x − x , − · − · . . 202 Fibonacci numbers

Combining these relations we have F (x) (F + F x)= (F (x) F ) x + F (x) x2, − 0 1 − 0 · · F (x) x = F (x) x + F (x) x2, − · · (1 x x2)F (x)= x. − − Thus, we obtain the generating function of the Fibonacci numbers: x F (x)= . 1 x x2 − − There is a factorization of 1 x x2 by making use of the roots of the quadratic polynomial. Let α− > β−be the two roots. We have α + β =1, αβ = 1. − More explicitly, √5+1 √5 1 α = , β = − . 2 − 2

Now, since 1 x x2 = (1 αx)(1 βx), we have a partial fraction decomposition − − − − x x 1 1 1 = = . 1 x x2 (1 αx)(1 βx) α β 1 αx − 1 βx − − − − −  − −  1 1 Each of 1 αx and 1 βx has a simple power series expansion. In fact, making use− of −

1 ∞ =1+ x + x2 + + xn + = xn, 1 x ··· ··· n=0 − X and noting that α β = √5, we have − x 1 ∞ ∞ = αnxn βnxn 1 x x2 √ − 5 n=0 n=0 ! − − X X ∞ αn βn = − xn. √ n=0 5 X The coefficients of this power series are the Fibonacci numbers: αn βn Fn = − , n =0, 1, 2,.... √5 4.1 The Fibonacci sequence 203

n n 1. F is the integer nearest to α : F = α . n √5 n √5 n o Proof. αn βn 1 1 F = < < . n − √ √ √ 2 5 5 5

2. For n 2, F = αF . ≥ n+1 { n} Proof. Note that

n n+1 αβ β α β n n Fn+1 αFn = − − β = β . − = √5 · For n 2, ≥ 1 F αF = β n < . | n+1 − n| | | 2

Fn+1 3. limn = α. →∞ Fn

Exercise 1. (a) Make use of only the fact that 987 is a to confirm that 17711 is also a Fibonacci number, and find all inter- mediate Fibonacci numbers. (b) Make use of the result of (a) to decide if 75026 is a Fibonacci number. 2. Prove by mathematical induction the Cassini formula:

2 n Fn+1Fn 1 Fn =( 1) . − − −

3. The conversion from miles into kilometers can be neatly expressed by the Fibonacci numbers.

miles 5 8 13 kilometers 8 13 21 204 Fibonacci numbers

How far does this go? Taking 1 meter as 39.37 inches, what is the largest n for which Fn miles can be approximated by Fn+1 kilome- ters, correct to the nearest whole number? 4. Prove the Fermat Last Theorem for Fibonacci numbers: there is no solution of xn + yn = zn, n 2, in which x, y, z are (nonzero) Fibonacci numbers. ≥

4.2 Some relations of Fibonacci numbers

1. Sum of consecutive Fibonacci numbers: n F = F 1. k n+2 − k X=1

2. Sum of consecutive odd Fibonacci numbers: n

F2k 1 = F2n. − k X=1

3. Sum of consecutive even Fibonacci numbers: n F = F 1. 2k 2n+1 − k X=1

4. Sum of squares of consecutive Fibonacci numbers:

n 2 Fk = FnFn+1. k X=1

5. Cassini’s formula:

2 n Fn+1Fn 1 Fn =( 1) . − − − 4.3 Fibonacci numbers and binomial coefficients 205

4.3 Fibonacci numbers and binomial coefficients

x x Rewriting the generating function 1 x x2 = 1 (x+x2) as − − −

x + x(x + x2) + x(x + x2)2 + x(x + x2)3 + x(x+2)4 + · · · = x + x2(1 + x) + x3(1 + x)2 + x4(1 + x)3 + x5(1 + x)4 + · · · = x + x2 + x3 + x4 + x5 + · · · + x3 + 2x4 + 3x5 + 4x6 + · · · + x5 + 3x6 + 6x7 + · · · + x7 + 4x8 + · · · + x9 + · · · . + . we obtain the following expressions of the Fibonacci numbers in terms of the binomial coefficents:

0 F1 = = 1, 0! 1 F2 = = 1, 0! 2 1 F3 = + = 2, 0! 1! 3 2 F4 = + =1+2=3, 0! 1! 4 3 2 F5 = + + =1+3+1=5, 0! 1! 2! 5 4 3 F6 = + + =1+4+3=8, 0! 1! 2! 6 5 4 3 F7 = + + + =1+5+6+1=13, 0! 1! 2! 3! 7 6 5 4 F8 = + + + =1+6+10+4=21, 0! 1! 2! 3! . . 206 Fibonacci numbers

Theorem 4.1. For k 0, ≥ k ⌈ 2 ⌉ k j F = − . k+1 j j=0 X   Proof.

x ∞ = x (x + x2)n 1 x x2 · n=0 − − X ∞ = xn+1(1 + x)n n=0 X n ∞ n = xn+1 xm m n=0 m=0   X n X ∞ n = xn+m+1 m n=0 m=0   X Xk 2 ∞ ⌈ ⌉ k j = − xk+1.  j  k j=0 X=1 X     Chapter 5

Counting with Fibonacci numbers

5.1 Squares and dominos

In how many ways can a 1 n rectangle be tiled with unit squares and dominos (1 2 squares)? × 3 × 3 3 3 2 2 2 2 1 0 1 2 3 4 5 1 7 8 9 1011121 1415161718191 212223242526 0 0 0 0 0 1 2 3 4 5 7 8 9 101112 141516171819 212223242526 Suppose there are an ways of tiling a 1 n rectangle. There are two types of such tilings. × (i) The rightmost is tiled by a unit square. There are an 1 of these tilings. − (ii) The rightmost is tiled by a domino. There are an 2 of these. There- fore, − an = an 1 + an 2. − − Note that a1 =1 and a2 =2. These are consecutive Fibonacci numbers: a1 = F2 and a2 = F3. Since the recurrence is the same as the Fibonacci sequence, it follows that a = F for every n 1. n n+1 ≥ 208 Counting with Fibonacci numbers

5.2 Fat subsets of [n]

A subset A of [n] := 1, 2 ...,n is called fat if for every a A, a A (the number of{ elements} of A). For example, A = 4,∈5 is fat≥ but | B| = 2, 4, 5 is not. Note that the empty set is fat. How many{ } fat subsets does{[n] have?} Solution. Suppose there are bn fat subsets of [n]. Clearly, b1 =2 (every subset is fat) and b2 =3 (all subsets except [2] itself is fat). Here are the 5 fat subsets of [3]: , 1 , 2 , 3 , 2, 3 . ∅ { } { } { } { }

There are two kinds of fat subsets of [n]. (i) Those fat subsets which do not contain n are actually fat subsets of [n 1], and conversely. There are bn 1 of them. (ii)− Let A be a fat subset of m elements− and n A. If m = 1, then A = n . If m > 1, then every element of A is∈ greater than 1. The subset{ } A′ := j 1 : j < n, j A { − ∈ } has m 1 elements, each m 1 since j m for every j A. Note − ≥ − ≥ ∈ that A′ does not contain n 1. It is a fat subset of [n 2]. There are − − bn 2 such subsets. −We have established the recurrence

bn = bn 1 + bn 2. − − This is the same recurrence for the Fibonacci numbers. Now, since b1 =2= F3 and b2 =3= F4, it follows that bn = Fn+2 for every n 1. ≥ Exercise 1. (a) How many permutations π : [n] [n] satisfy → π(i) i 1, i =1, 2,...,n ? | − | ≤

(b) Let π be a satisfying the condition in (a). Suppose for distinct a, b [n], π(a)= b. Prove that π(b)= a. ∈ 5.3 An arrangement of pennies 209

5.3 An arrangement of pennies

Consider arrangements of pennies in rows in which the pennies in any row are contiguous, and each penny not in the bottom row touches two pennies in the row below. For example, the first one is allowed but not the second one:

How many arrangements are there with n pennies in the bottom row? Here are the arrangements with 4 pennies in the bottom, altogether 13.

Solution. Let an be the number of arrangements with n pennies in the bottom. Clearly

a1 =1, a2 =3, a3 =5, a4 = 13.

A can be constructed by considering the number of pennies in the second bottom row. This may be n 1, n 2,..., 1, and also possibly none. − −

an = an 1 +2an 2 + +(n 1)a1 +1. − − ··· − 210 Counting with Fibonacci numbers

Here are some beginning values:

n an 1 1 2 2 3 5 4 5+2 2+3 1+1=13, 5 13+2 5+3· 2+4· 1+1=34, 6 34+2 13+3· 5+4· 2+5· 1+1=89, . · · · · . These numbers are the old Fibonacci numbers:

a1 = F1, a2 = F3, a3 = F5, a4 = F7, a5 = F9, a6 = F11.

From this we make the conjecture an = F2n 1 for n 1. − ≥ Proof. We prove by mathematical induction a stronger result:

an = F2n 1, − n

ak = F2n. k X=1 These are clearly true for n =1. Assuming these, we have

an+1 = an +2an 1 +3an 2 + + na1 +1 − − ··· = (an + an 1 + an 2 + + a1) − − ··· +(an 1 +2an 2 + +(n 1)a1 + 1) − − ··· − = F2n + an

= F2n + F2n 1 − = F2n+1; n+1 n

ak = an+1 + ak k k X=1 X=1 = F2n+1 + F2n

= F2(n+1). Therefore, the conjecture is established for all positive integers n. In particular, an = F2n 1. − Chapter 6

Fibonacci numbers 3

6.1 Factorization of Fibonacci numbers

1. gcd(Fm, Fn)= Fgcd(m,n).

2. If m n, then F F . | m| n 3. Here are the beginning values of F F : 2n ÷ n

n Fn F2n Ln = F2n Fn 111 1 ÷ 213 3 328 4 4321 7 55 55 11 6 8 144 18 7 13 377 29 8 21 987 47 . .

(a) These quotients seem to satisfy the same recurrence as the Fi- bonacci numbers: each number is the sum of the preceding two. (b) Therefore, it is reasonable to expect that each of these quo- tients can be expressed in terms of Fibonacci numbers. 212 Fibonacci numbers 3

n Fn F2n Ln = F2n Fn Fn 1 + Fn+1 − 111 1 ÷ 213 3 =1+2 328 4 =1+3 4321 7 =2+5 55 55 11 =3+8 6 8 144 18 =5+13 713377 29 =8+21 8 21987 47 =13+34 . .

(c) Conjectures: (a) Ln+2 = Ln+1 + Ln, L1 =1, L2 =3; (b) Ln = Fn+1 + Fn 1. − 4. These conjectures are true. They are easy consequences of Theorem 6.1 (Lucas’ Theorem). 2 2 F2n = Fn+1 Fn 1, − 2 − 2 F2n+1 = Fn+1 + Fn . Proof. We prove this by mathematical induction. These are true for n =1. Assume these hold. Then

F2n+2 = F2n+1 + F2n 2 2 2 2 = (Fn+1 + Fn )+(Fn+1 − Fn−1) 2 2 2 2 = (Fn+1 + Fn+1)+(Fn − Fn−1) 2 2 = Fn+1 + Fn+1 +(Fn + Fn−1)(Fn − Fn−1) 2 2 = Fn+1 + Fn+1 + Fn+1(Fn − Fn−1) 2 = Fn+1 + Fn+1(Fn+1 +(Fn − Fn−1)) 2 = Fn+1 + Fn+1(Fn +(Fn+1 − Fn−1)) 2 = Fn+1 + 2Fn+1Fn 2 2 2 = Fn+1 + 2Fn+1Fn + Fn − Fn 2 2 = Fn+2 − Fn ;

F2n+3 = F2n+2 + F2n+1 2 2 2 2 = (Fn+2 − Fn )+(Fn+1 + Fn ) 2 2 = Fn+2 + Fn+1. 6.1FactorizationofFibonaccinumbers 213

Therefore the statements are true for all n.

5. By Lucas’ theorem,

2 2 F2n = Fn+1 Fn 1 =(Fn+1 Fn 1)(Fn+1+Fn 1)= Fn(Fn+1+Fn 1). − − − − − −

If we put Ln = Fn+1 + Fn 1, then L1 = F2 + F0 = 1, L2 = − F1 + F3 =1+2=3, and

Ln+2 = Fn+3 +Fn+1 =(Fn+2 +Fn)+(Fn+1 +Fn 1)= Ln+1 +Ln. −

6. If Fn is prime, then n is prime. The converse is not true. Of course, F2 = 1 is not a prime. What is the least odd prime p for which Fp is not prime?

7. Apart from F0 = 0 and F1 = F2 = 1, there is only one more Fibonacci number which is a square. What is this? 214 Fibonacci numbers 3

6.2 The Lucas numbers

The sequence (Ln) satisfyin

Ln+2 = Ln+1 + Ln, L1 =1, L2 =3,

is called the , and Ln the n-th . Here are the beginning Lucas numbers.

n 1 2 3 4 5 6 7 8 9 10 11 12 Ln 1 3 4 7 11 18 29 47 76 123 199 322

Let α > β be the roots of the quadratic polynomial x2 x 1. − − n n 1. Ln = α + β .

2. Ln+1 + Ln 1 =5Fn. − 3. F k = L L L L L k−1 . 2 1 2 4 8 ··· 2 4. L1 =1 and L3 =4 are the only square Lucas numbers (U. Alfred, 1964).

Exercise

2 n 1 1. Prove that L = L + 2( 1) − . 2n n − Solution.

2n 2n L2n = α + β = (αn + βn)2 2(αβ)n − = L2 2( 1)n. n − − 2. Express F F in terms of L . 4n ÷ n n Solution.

3 n 1 F = F L = F L L = F (L + 2( 1) − L ). 4n 2n 2n n n 2n n n − n 3. Express F F in terms of L . 3n ÷ n n Answer. F = F (L2 +( 1)n). 3n n n − 6.3 Counting circular permutations 215

6.3 Counting circular permutations

Let n 4. The numbers 1, 2,..., n are arranged in a circle. How many permutations≥ are there so that each number is not moved more than one place? Solution. (a) π(n)= n. There are Fn permutations of [n 1] satisfying π(i) i 1. − | (b)−π(|n ≤)=1. (i) If π(1) = 2, then π(2) = 3,..., π(n 1) = n. (ii) If π(1) = n, then π restricts to a permutation− of [2,...,n 1] satis- − fying π(i) i 1. There are Fn 1 such permutations. (c)|π(n)=− n| ≤ 1. − (i) If π(n 1) =−n 2, then π(n 2) = n 3,..., π(2) = 1, π(1) = n. (ii) If π(n− 1) = n−, then π restricts− to a permutation− of [1, n 2] satis- − − fying π(i) i 1. There are Fn 1 such permutations. | − | ≤ −

Therefore, there are altogether Fn + 2(Fn 1 +1) = Ln + 2 such circular permutations. − For n =4, this is L4 +2=9. 4 4 4

4 4 4

3 3 1 1 3 3 1 2 2 3 1 1

2 2 2

2 1 3

1 1 1

4 4 4

4 3 1 2 3 3 1 4 2 3 1 4

2 2 2

3 2 3

3 3 3

4 4 4

2 3 1 4 4 3 1 1 4 3 1 2

2 2 2

1 2 1 Chapter 7

Subtraction games

7.1 The Bachet game

Beginning with a positive integer, two players alternately subtract a pos- itive integer

7.2 The Sprague-Grundy sequence

Let G be a two-person counter game in which two players alternately re- move a positive amount of counters according to certain specified rules. The Sprague-Grundy sequence of G is the sequence (g(n)) of nonnega- tive integers defined recursively as follows. (1) g(n)=0 for all n which have no legal move to another number. In particular, g(0) = 0. (2) Suppose from position n it is possible to move to any of positions m1, m2,..., mk, (all < n), then g(n) is the smallest nonnegative integer different from g(m1), g(m2),..., g(mk). Theorem 7.1. The player who secures a position n with g(n)=0 has a winning strategy. Example 7.1. The Bachet game:

n g(n) ← 0 0 1 0 1 2 1, 0 2 3 2, 1, 0 3 . . d 1 (d 2),..., 1, 0 d 1 −d (d − 1),..., 1 −0 . − .

More generally, g(kd + a) = a for integers k and a satisfying 0 a

7.3 Subtraction of powers of 2

n g(n) ← 0 0 1 0 1 2 1, 0 2 3 2, 1 0 4 3, 2, 0 1 5 4, 3, 1 2 6 5, 4, 2 0 7 6, 5, 3 1 8 7, 6, 4, 0 2 9 8, 7, 5, 1 0 10 9, 8, 6, 2 1 This suggests that the winning positions are the multiples of 3. Proof. If Player A occupies a multiple of 3, any move by Player B will results in a position 3k +1 or 3k +2. Player A can get to a smaller multiple of 3 by subtracting 1 or 2 accordingly.

Exercise 1. What are the winning positions in the game of subtraction of pow- ers of 3? Answer. Even numbers. 2. What are the winning positions in the game of subtraction of prime numbers or 1? Answer. Multiples of 4. 3. What are the winning positions in the game of subtraction of a proper divisor of the current number (allowing 1 but not the number itself) ? Note that 1 is not a proper divisor of itself Answer. Odd numbers except 1. Solution. The clue is that all factors of an odd number are odd. Subtracting an odd leaves an even number. Hence the winning strategy is to leave an odd number so that you opponent will always leave you an even number. From this you get to an odd number by subtracting 1. 304 Subtraction games

7.4 Subtraction of square numbers

Two players alternately subtract a positive . We calculate the Sprague-Grundy sequence.

n g(n) ← 0 0 1 0 1 2 1 0 3 2 1 4 3, 0 2 5 4, 1 0 6 5, 2 1 7 6, 3 0 8 7, 4 1 9 8, 5, 0 2 10 9, 6, 1 0

The values of n 500 for which g(n)=0 are as follows: 1 These are the winning positions.≤

0 2 5 7 10 12 15 17 20 22 34 39 44 52 57 62 65 67 72 85 95 109 119 124 127 130 132 137 142 147 150 170 177 180 182 187 192 197 204 210 215 238 243 249 255 257 260 262 267 272 275 312 317 322 327 332 335 340 345 350 369 377 390 392 397 425 430 437 442 447 449 464

Suppose we start with 74. Player A can subtract 9 to get to 65, or subtract 64 to get 10, which have value 0. In the latter case, B may move to 9, 6 or 1. A clearly wins if B moves to 9 or 1. But if B moves to 6, then A can move to 5 or 2 and win.

Exercise 1. How would you win if the starting number is 200? or 500?

1[Smith, p.68] incorrectly asserts that this sequence is periodic, with period 5. 7.5 More difficult games 305

7.5 More difficult games

1. Subtraction of proper divisor of current number (not allowing 1 and the number itself). The winning positions within 500 are as follows.

0 1 2 3 5 7 8 9 11 13 15 17 19 21 23 25 27 29 31 32 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 128 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 175 177 179 181 183 185 187 189 191 193 195 197 199 201 203 205 207 209 211 213 215 217 219 221 223 225 227 229 231 233 235 237 239 241 243 245 247 249 251 253 255 257 259 261 263 265 267 269 271 273 275 277 279 281 283 285 287 289 291 293 295 297 299 301 303 305 307 309 311 313 315 317 319 321 323 325 327 329 331 333 335 337 339 341 343 345 347 349 351 353 355 357 359 361 363 365 367 369 371 373 375 377 379 381 383 385 387 389 391 393 395 397 399 401 403 405 407 409 411 413 415 417 419 421 423 425 427 429 431 433 435 437 439 441 443 445 447 449 451 453 455 457 459 461 463 465 467 469 471 473 475 477 479 481 483 485 487 489 491 493 495 497 499

2. Subtraction of primes (not allowing 1). The winning positions within 500 are as follows.

0 1 9 10 25 34 35 49 55 85 91 100 115 121 125 133 145 155 169 175 187 195 205 217 235 247 253 259 265 289 295 301 309 310 319 325 335 343 355 361 375 385 391 395 403 415 425 445 451 469 475 481 485 493 306 Subtraction games Chapter 8

The games of Euclid and Wythoff

8.1 The game of Euclid

Two players alternately remove chips from two piles of a and b chips respectively. A move consists of removing a multiple of one pile from the other pile. The winner is the one who takes the last chip in one of the piles. Preliminary problem: Find a constant k such that for positive integers a and b satisfying bk(a b), (ii) a>kb =⇒ bϕ(a b), (ii) a>ϕb =⇒ b<ϕ(a− b). ⇒ − Proof. The golden ratio ϕ satisfies ϕ 1= 1 . − ϕ (i) a<ϕb = a b< (ϕ 1)b = 1 b = ϕ(a b) < b. ⇒ − − ϕ · ⇒ − (ii) a>ϕb = a b> (ϕ 1)b = 1 b = ϕ(a b) > b. ⇒ − − ϕ · ⇒ − Theorem 8.2. In the game of Euclid (a, b), the first player has a winning strategy if and only if a>ϕb. 308 The games of Euclid and Wythoff

Proof. The first player (A) clearly wins if a = kb for some integer k. Assume a>ϕb. Let q be the largest integer such that a>qb. If q =1, the only move is (a, b) / (b, a b). In this case, b<ϕ(a b) by Proposition 8.1(ii).− If q 2, we consider− the moves (i) (a, b≥) / (b, a qb) and (ii) (a, b) / (a −(q 1)b, b) (Note that a (q 1)b > b). If b<ϕ(a qb−), make− move (i). − − Otherwise,−b>ϕ(a qb). Make move (ii). In this case, − 1 1 a qb < b = a (q 1)b< +1 b = ϕb. − ϕ · ⇒ − − ϕ   / This means that A can make a move (a, b) (a′, b′) with a′ > b′ such that a′ < ϕb′. The second player B has no choice but only the move / (a′, b′) (a′ b′, b′). By Proposition 8.1, b′ >ϕ(a′ b′). Assume a<ϕb− . Then A has no choice except the move− (a, b) / (a b, b). Here, b>ϕ(a b). − − Winning strategy: Suppose a>ϕb. Let q be the largest integer such that a>qb. A chooses between (a′, b′)=(b, a qb) or (a (q 1)b, b) for − − − a′ < ϕb′. Examples:

(a,b) A moves to B moves to (a,b) A moves to B moves to (50, 29) (29, 21) (21, 8) (50, 31) (31, 19) (19, 12) (8, 5) (5, 3) (12, 7) (7, 5) (3, 2) (2, 1) (5, 3) (3, 2) (1, 0) (2, 1) (1, 0) wins wins 8.2 Wythoff’s game 309

8.2 Wythoff’s game

Given two piles of chips, a player either removes an arbitrary positive amount of chips from any one pile, or an equal (positive) amount of chips from both piles. The player who makes the last move wins. We describe the position of the game by the amounts of chips in the two piles. If you can make (1, 2), then you will surely win no matter how your opponent moves. Now, to forbid your opponent to get to this position, you should occupy (3, 5). The sequence of winning positions: starting with (a1, b1) = (1, 2), construct (an, bn) by setting a := min c : c = a , b , i

1 3 4 6 8 9 11 12 14 16 17 19 21 22 24 25 27 29 2 5 7 10 13 15 18 20 23 26 28 31 34 36 39 41 44 47

1. Every positive integer appears in the two sequences.

Proof. Suppose (for a contradiction) that not every positive inte- ger appears in the two sequences. Let N be the smallest of such integers. There is a sufficiently large integer M such that all inte- gers less than N are among a1,...,aM and b1,...,bM . Then by definition, aM+1 = N, a contradiction.

2. The sequence (an) is increasing.

Proof. Suppose an+1 an. This means that an+1 is the smallest integer not in the list ≤

a1, a2,...,an 1, an, b1, b2,...,bn 1, bn. − − In particular, a = a . This means that a < a < a + n = n+1 6 n n+1 n n bn. Ignoring an and bn from this list, an+1 is the smallest integer not in a1, a2,...,an 1, b1, b2,...,bn 1. − − This means, by definition, that an = an+1, a contradiction. 310 The games of Euclid and Wythoff

3. The sequence (bn) is increasing.

Proof. bn+1 = an+1 + n +1 > an + n = bn.

4. Since (a ) and (b ) are increasing, a n and b n for every n. n n n ≥ n ≥ 5. a = b for all integers m and n. m 6 n

Proof. If m n, then am an < bn. If m > n, then≤ n m 1 ≤and a is the smallest integer not among ≤ − m

a1,...,am 1, b1,...,bn,...,bm 1. − − In particular, a = b . m 6 n 6. Each positive integer appears in the list exactly once. Corollary of (1), (2), (3), (5).

7. It is not possible to move from (an, bn) to (am, bm) for m < n.

/ Proof. A move (an, bn) (am, bm) must subtract the same num- ber from an and bn. This is impossible since bn an = n > m = b a . − m − m 8. Let a < b. Suppose (a, b) = (a , b ) for any n. Then there is a 6 n n move into (an, bn) for some n.

Proof. Each of a and b appears exactly once in one of the sequences (an, bn). There are five possibilities for (a, b) (in each case, p < q): (i) (ap, aq), (ii) (bp, bq), (iii) (ap, bq), (iv) (aq, bp), (v) (bp, aq). / In each case, we move (a, b) (ap, bp) except when in (i) aq < bp. In this case, let n = b a. Note that − n = b a < a a < b a = p, − q − p p − p and bn an = b a = b bn = a an. The move −/ − ⇒ − − (a, b) (an, bn) is done by subtracting equal numbers from a and b. 8.3 Beatty’s Theorem 311

8.3 Beatty’s Theorem

Theorem 8.3 (Beatty). If α and β are positive irrational numbers satis- 1 1 fying α + β =1, then the sequences α , 2α , 3α , ... ⌊ ⌋ ⌊ ⌋ ⌊ ⌋ and β , 2β , 3β , ... ⌊ ⌋ ⌊ ⌋ ⌊ ⌋ form a partition of the sequence of positive integers. Proof. (1) If an integer q appears in both sequences, then there are inte- gers h and k such that q < hα < q +1, q > − , q +1 α q k 1 k 1 > > − . q +1 β q 312 The games of Euclid and Wythoff

Combining these, we have h + k h + k 2 > 1 > − , q +1 q and h + k > q +1 >q>h + k 2, an impossibility. This shows that every integer q appears in at least− one of the sequences. From (1) and (2) we conclude that every integer appears in exactly one of the sequences.

1 1 We try to find irrational numbers α and β satisfying α + β = 1 such that the two sequences ( nα ) and ( nβ ) are (a ) and (b ) for the ⌊ ⌋ ⌊ ⌋ n n winning positions of the Wythoff game. Since bn an = n, we require nβ nα = n. This is the case if we choose− α and β such that ⌊β ⌋α −= ⌊ 1.⌋ Since 1 + 1 = 1, we have 1 + 1 = 1 or α2 = α +1. − α β α α+1 1 √ Therefore, α = ϕ = 2 ( 5+1), the golden ratio, and β = ϕ +1. Here is a succinct description of the Wythoff sequence. Theorem 8.4. The winning positions of Wythoff’s game are the pairs ( nϕ , nϕ + n). ⌊ ⌋ ⌊ ⌋ Exercise 1. Where are the Fibonacci numbers in the Wythoff sequence? 2. Where are the Lucas numbers in the Wythoff sequence? Chapter 9

Extrapolation problems

9.1 Whatis f(n + 1) if f(k)=2k for k =0, 1, 2 ...,n?

Let f(x) be a polynomial of degree n such that

f(0) = 1, f(1) = 2, f(2) = 4, ..., f(n)=2n.

What is f(n + 1)? It is tempting to answer with 2n+1, but this assumes f(x)=2x,not a polynomial. 1 Here is an easier approach to the problem, by considering the succes- sive differences. If f(x) is a polynomial of degree n, then f(x+1) f(x) is a polynomial of degree n 1. Suppose the values of f(x) are− given at n +1 consecutive integers− 0, 1, ..., n. Then we can easily find the values of f(x + 1) f(x) at 1,2..., n. By repeating the process, we obtain the successive− differences.

1, 2, 4, 8, 16, 31, 57, 99 1, 2, 4, 8, 15, 26, 42 1, 2, 4, 7, 11, 16 1, 2, 3, 4, 5 1, 1, 1, 1

f(n +1)=2n+1 1. What is f(n + 2)?− How does the sequence

1, 4, 11, 26, 57,...

1There is also the famous Lagrange interpolation formula to find such a polynomial. 314 Extrapolation problems

continue? The differences are

3, 7, 15, 31,.... From these we have

f(n +2)= 1+(22 1)+(23 1) + + (2n+1 1) − − ··· − = (21 1)+(22 1)+(23 1) + + (2n+1 1) − − − ··· − = (2+22 + +2n+1) (n + 1) ··· − = 2n+2 2 (n + 1) − − = 2n+2 n 3. − − Exercise 1. Prove that 0 if n is odd, f( 1) = − 1 if n is even. 

2. Show that the values of f( 2) are − 2, 2, 3, 3, 4, 4, ... − − − for n =2, 3, 4, 5, 6, 7,... . 1 9.2 What is f(n + 1) if f(k)= k+1 for k =0, 1, 2 ...,n? 315

1 9.2 Whatis f(n +1) if f(k) = k+1 for k =0, 1, 2 ...,n? Suppose we have a polynomial f(x) of degree n with given values x 012345 n f(x) 1 1 1 1 1 1 ··· 1 2 3 4 5 6 ··· n+1 What are f(n + 1) and f(n + 2)? Solution. From the given data, we have (x + 1)f(x) 1=0 for x = 0, 1,...,n. Therefore, (x + 1)f(x) 1 is a polynomial− of degree n +1 with n +1 roots 0, 1,..., n. − (x + 1)f(x) 1= cx(x 1)(x 2) (x n), − − − ··· − for some constant c. With x = 1, we have − ( 1)n 1= c( 1)( 2)( 3) ( 1 n) c = − . − − − − ··· − − ⇒ (n + 1)! Hence, ( 1)nx(x 1) (x n) (x + 1)f(x)=1+ − − ··· − . (n + 1)!

(i) If n is odd, we have (n + 1)! (n + 2)f(n +1)= 1 =1 1=0 f(n +1)=0, − (n + 1)! − ⇒ (n + 2)! n +1 (n + 3)f(n +2)= 1 = (n + 1) f(n +2)= . − (n + 1)! − ⇒ −n +3 (ii) If n is even, we have (n + 1)! 2 (n + 2)f(n +1)= 1+ =2 f(n +1)= , (n + 1)! ⇒ n +2 (n + 2)! (n + 3)f(n +2)= 1+ = n +3 f(n +2)=1. (n + 1)! ⇒

Summary

n+1 0, if n is odd, n+3 , if n is odd, f(n+1) = 2 f(n+2) = − ( n+2 , if n is even; (1, if n is even. 316 Extrapolation problems

Exercise 1. Let f(x) be a polynomial of degree n such that for k =1, 2,...,n, ≤ f(k)= Fk, the k-th Fibonacci number. Find the value of f(n +1). F , if n is odd, Answer. f(n +1) = n (Ln, if n is even.

2. Find a quadratic polynomial f(x) such that f(1n)=12n for every integer n.

Note: 1n is the integer whose decimal expansion consists of n digits each equal to 1; similarly for 12n. Answer. f(x)= x(9x + 2).

3. Find a cubic polynomial g(x) such that g(1n)=13n for every n 1. ≥ 9.3 Why is ex not a rational function? 317

9.3 Whyis ex not a rational function?

We show why the exponential function, and some other elementary func- tions, are not rational functions by studying the degrees of rational func- P (x) tions. A rational function is one of the form f(x) = Q(x) , where P (x) and Q(x) are polynomials without common (other than scalars from the field of coefficients). Theorem 9.1. Let f and g be rational functions. (a) If f + g =0, then deg(f + g) max(deg f, deg g). (b) deg(fg)6 = deg f + deg g. ≤ (c) If f ′ =0, then deg f ′ < deg f. 6 (a) and (b) are well known. We prove (c). This depends on the simple fact that for a polynomial P (x), if the derivative P ′(x) is not identically zero, then deg P ′ = deg P 1. ′ ′ ′ P (x) − P Q PQ P ′ PQ Now let f(x)= . Then f ′ = −2 = 2 . Q(x) Q Q − Q Now,

P ′ deg = deg P ′ deg Q = (deg P 1) deg Q Q − − − = deg P deg Q 1 = deg f 1, − − − P Q deg ′ = deg P + (deg Q 1) 2 deg Q Q2 − − = deg P deg Q 1 = deg f 1. − − − It follows from (a) that deg f ′ deg f 1. This proves (c). ≤ − Corollary 9.2. ex is not a rational function.

x Proof. Note that f(x) = e satisfies the differential equation ′(x) = f(x). Suppose f(x)= ex is a rational function. Then

deg f = deg f ′ deg f 1, ≤ − a contradiction. 318 Extrapolation problems

Exercise

2 1. Make use of the fact (tan x)′ = sec x to show that tan x is not a rational function.

2 1 2. Make use of the identity cos x = 2 (1+cos2x) to show that cos x is not a rational function. 3. Deduce that sin x is not a rational function. 4. Show that the logarithm function log x is not a rational function. Chapter 10

The Josephus problem and its generalization

10.1 The Josephus problem

There are n people, numbered consecutively, standing in a circle. First, Number 2 sits down, then Number 4, Number 6, etc., continuing around the circle with every other standing person sitting down until just one person is left standing. What number is this person? This is Problem 1031 of MATHEMATICS MAGAZINE, a reformula- tion of the Josephus problem.

Example 10.1. n = 10: 2 6 4 3 * 1 5 2

3 6 1 8

7 10 7 5 8 9 4 9 (2) n = 21. After the removal of the 10 even numbered ones and then the first, there are the 10 odd numbers 3, 5, ..., 19, 21. The survivor is the 5-th of this list, which is 11. 402 The Josephus problem and its generalization

Theorem 10.1. Let J(n) be the “suvivor” in the Josephus problem for n people. J(2n) =2J(n) 1, − J(2n +1) =2J(n)+1. Example 10.2.

J(100) =2J(50) 1 − =2(2J(25) 1) 1=4J(25) 3 − − − =4(2J(12) + 1) 3=8J(12)+ 1 − =8(2J(6) 1)+1=16J(6) 7 − − =16(2J(3) 1) 7=32J(3) 23 − − − =32(2J(1)+ 1) 23 = 64J(1)+9 − =73.

There is an almost explicit expression for J(n): if 2m is the largest power of 2 n, then ≤ J(n)=2(n 2m)+1. (10.1) − Corollary 10.2. The binary expansion of J(n) is obtained by transfer- ring the leftmost digit 1 of the binary expansion of n to the rightmost.

J(100) = J([1100100]2) = [1001001]2 =64+8+1=73.

Exercise 1. For what values of n is J(n)= n? 2. For what values of n is J(n)= n 1? − 10.2 Chamberlain’s solution 403

10.2 Chamberlain’s solution

Here is M. Chamberlain’s solution to the MAGAZINE problem:

Write n =2m + k where 0 k 2m 1. Then seat the peo- ple numbered 2, 4, ..., 2k.≤ This≤ leaves− 2m people standing, beginning with the person numbered 2k +1; call him Stan. Now continue to seat people until you get back to Stan. It m 1 is easy to see that 2 − people will be left standing, starting with Stan again. On every subsequent pass of the circle half of those standing will be left standing with Stan always the first among them. Stan’s the man.

This proof clearly yields the expression for J(n) given in (10.1). 404 The Josephus problem and its generalization

10.3 The generalized Josephus problem J(n,k)

The generalized Josephus problem J(n, k) asks for the “survivor” J(n, k) with n people standing in a circle, successively seating every k-th one. Example 10.3. J(10, 3): J(10, 3)=4. * 1

4 3 8 4 5 2

2 6 1 6

7 10 5 9 8 9

7 3 For n = 10, here are the sequences of elimination depending on the values of k. The last column gives the survivors.

k J(10,k) 1 123456789 10 2 2 4 68103 7 1 9 5 3 3 6 927 1 8 510 4 4 4 8 273109 1 6 5 5 510629 8 1 4 7 3 6 6 2 975 8 1104 3 7 7 4 213 6105 8 9 8 8 6 57103 2 9 4 1 9 9 81025 3 4 1 6 7 10 101 362 9 5 7 4 8

Positions 2 and 6 are no-luck positions for the Josephus problem of 10 people and random choice of k. 10.3 The generalized Josephus problem J(n, k) 405

Exercise 1. Make a list of the no-luck positions of the Josephus problem for n =4, 5,..., 9. 2. For n = 7, there is only one no-luck position 1. This means that one other position is most likely to survive? Which one is it? 3. Find out the survivor in the Josephus problem J(24, 11).

3 8 7 6 9 5 10 4 1 11 3

12 2

13 1

14 24

15 23 16 22 17 21 2 18 20 19 4

4. The no-luck positions for J(24,k), k =1,..., 24 are 5, 12, 13, 16, 18, 19, 22. What is the one with the best chance of survival? 406 The Josephus problem and its generalization Chapter 11

The nim game

11.1 Thenimsum

The nim sum of two nonnegative integers is the addition in their base 2 notations without carries. If we write

0 ⊞ 0=0, 0 ⊞ 1=1 ⊞ 0=1, 1 ⊞ 1=0,

then in terms of the base 2 expansions of a and b, a ⊞ b =(a a a ) ⊞ (b b b )=(a ⊞ b )(a ⊞ b ) (a ⊞ b ). 1 2 ··· n 1 2 ··· n 1 1 2 2 ··· n n

The nim sum is associative, commutative, and has 0 as identity ele- ment. In particular, a ⊞ a =0 for every natural number a.

Example 11.1. (a) 6 ⊞ 5 = [110]2 ⊞ [101]2 = [011]2 =3.

(b) 34 ⊞ 57 = [100010]2 ⊞ [111001]2 = [011011]2 = 27. Here are the nim sums of numbers 15: ≤ 408 The nim game

⊞ 0 1 2 3 4 5 6 7 8 9 101112131415 0 0 1 2 3 4 5 6 7 8 9 101112131415 1 1 0 3 2 5 4 7 6 9 8 111013121514 2 2 3 0 1 6 7 4 5 1011 8 9 14151213 3 3 2 1 0 7 6 5 4 1110 9 8 15141312 4 4 5 6 7 0 1 2 3 12131415 8 9 1011 5 5 4 7 6 1 0 3 2 13121514 9 8 1110 6 6 7 4 5 2 3 0 1 141512131011 8 9 7 7 6 5 4 3 2 1 0 151413121110 9 8 8 8 9 101112131415 0 1 2 3 4 5 6 7 9 9 8 111013121514 1 0 3 2 5 4 7 6 10 1011 8 9 14151213 2 3 0 1 6 7 4 5 11 1110 9 8 15141312 3 2 1 0 7 6 5 4 12 12131415 8 9 1011 4 5 6 7 0 1 2 3 13 13121514 9 8 1110 5 4 7 6 1 0 3 2 14 141512131011 8 9 6 7 4 5 2 3 0 1 15 151413121110 9 8 7 6 5 4 3 2 1 0

11.2 Thenim game

Given three piles of marbles, with a, b, c marbles respectively, players A and B alternately remove a positive amount of marbles from any pile. The player who makes the last move wins. Theorem 11.1. In the nim game, the player who can balance the nim sum equation has a winning strategy. Therefore, provided that the initial position (a, b, c) does not satisfy a ⊞ b ⊞ c = 0, the first player has a winning strategy. For example, suppose the initial position is (12, 7, 9). Since 12 ⊞ 9=5, the first player can remove 2 marbles from the second pile to maintain a balance of the nim sum equation 12 ⊞ 5 ⊞ 9=0, thereby securing a winning position. Remarks. (1) This theorem indeed generalizes to an arbitrary number of piles. (2) The Miss`ere Nim game: Suppose now we change the rule: in the Nim game, the player who makes the last move loses. Here is a winning strategy: Play as for ordinary Nim, until you can move to a position in which all piles have just one marble. 11.2 The nim game 409

Exercise In each of the followingnime games, it is your turn to move. How would you ensure a winning position? (a) 3, 5, 7 marbles. (b) 9, 10, 12 marbles. (c) 1, 8, 9 marbles. (d) 1, 10, 12 marbles. 410 The nim game Chapter 12

Prime and perfect numbers

12.1 Infinitude of prime numbers

12.1.1 Euclid’s proof If there were only finitely many primes: 2, 3, 5, 7, ...,P, and no more, consider the number Q = (2 3 5 P )+1. · · ··· Clearly it is divisible by any of the primes 2, 3,..., P , it must be itself a prime, or be divisible by some prime not in the list. This contradicts the assumption that all primes are among 2, 3, 5,..., P .

12.1.2 Fermat numbers

2n The Fermat numbers are Fn := 2 +1. Note that 2n 2n−1 2n−1 Fn 2=2 1= 2 +1 2 1 = Fn 1(Fn 1 2). − − − − − − By induction,    

Fn = Fn 1Fn 2 F1 F0 +2, n 1. − − ··· · ≥ From this, we see that Fn does not contain any factor of F0, F1, ..., Fn 1. Hence, the Fermat numbers are pairwise relatively prime. From this,− it follows that there are infinitely primes. 1

1 It is well known that Fermat’s conjecture of the primality of Fn is wrong. While F0 = 3, F1 = 5, 32 F2 = 17, F3 = 257, and F4 = 65537 are primes, Euler found that F5 = 2 + 1 = 4294967297 = 641 6700417. × 412 Prime and perfect numbers

12.2 The sieve of Eratosthenes

If N is not a prime number, it must have a factor √N. Given an integer N, to determine all the prime≤ numbers N, we proceed as follows. Start with the sequence ≤

2, 3, 4, 5, 6,...,N, with each entry unmarked, and the set P = . (1) Note the smallest entry a of the sequence∅ that is not marked. (2) If a √N, mark each entry of the sequence which is a multiple of a, but not≤ equal to a, and replace P by P a . ∪{ } (3) If a > √N, stop. The set P now consists of the totality of prime numbers N. ≤ 12.2.1 A visualization of the sieve of Eratosthenes Let a and b be positive integers. The line

b(a + 1)x + y (a +1)=0 − 1 joins the points a , 0 and (0, b + 1) intersects the line x = 1 at the point ( 1, (a + 1)(b + 1)). Note that the y-coordinate is a composite− number.− Conversely,  if y is a , then it is of the form (a +1)(b +1) for some positive integers a and b, and is the y-coordinate of the intersection of the line x = 1 with the line joining 1 , 0 and − a (0, b + 1). 2 Here is a visualization for N = 35. 

2R. Juricevic, Notices of AMS, September, 2008, p.921. 12.2 The sieve of Eratosthenes 413

31

29

23

19

17

13

11

7

5

3

2

1 1 1 1 1 414 Prime and perfect numbers

12.3 The prime numbers below 20000

10 20 30 40 50 60 70 80 90 100 bbbb b b bb b b b b bb b b b bb b bb b b bb b b b b bb b b b b b bb b b b b b b b b bb b b b bb b b b b b b b b b b b b bb b b b bb b b b b b bb b b b b b b b b b b b b b b b b b b b b bb b b b bb b bb b b b bb b b b b b b b b b b b b bb b b b b b b b b b bb b b b b b b b b b b b b b b b b b b bb b b bb b b b b bb b b b bb b b b b b b b b 100 b b bb b bb b b bb b b b bb b b b b b bb b b b b b b b bb b bb b b b b b bb b b b bb b bb b b b b b b b b b b b b b b b b b bb b b b b b b bb b b b b b b bb b bb b b bb b b b b b b b bb b b b b b bb b b b b b b b bb b b b b bb b b b b b bb b b b 200 b b bb b b b b b b b b b b b b b b b b b bb b b b b bb b b b b bb b b b b b bb b b b b b b b b b b b b bb b b b b b b b b b bb b b bb b b b b b b bb bb b b b b b b bb b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b 300 bb b b b b b b b b b b b b b bb b b b b bb b b bb b b b bb b b b b b b b b b bb b b b b b bb b b b b bb b bb b b b b b b bb b b b b b b b b b b bb b bb b b b b b bb b b bb b b b b b bb b b b b b b b b bb b b b b b bb b b b bb b 400 b bb b b b b b b b bb b b b b b bb b b b b b b bb b b b b b b b b b b b b bb b bb b bb b b b b b b b b b b b b bb b b b b b b b b b bb b b b b b bb b b b b b b b b b b b b b bb b b b bb b b bb b bb b b b b b b b b b b 500 bb b b b b b b b b b b b b b b b bb b b b b b b b b bb b b bb b b bb b b b bb b b b b b bb b b bb b b b b b bb b b b b b b b b b b b b b bb b b b b bb b b b b bb b b bb b b b b b b b b b b b b b b b b b b bb bb b 600 b b bb b b b b b b b b b b b b b bb b b b b b b bb b b b b bb b b b b b b b b b b b b b b b b b bb bb b b b b b b b bb b b bb b bb b b b b b b bb b b b b b b b b bb b b b b b b b bb b b b bb b b b b b b b b b b b b 700 b b bb b b b b b b b bb b b b b b b b b b b bb b b b b b b b b bb b b bb b b b bb b b bb b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b bb b b b bb b b b b b b b b b b b b b bb b b b b b bb b b 800 b bb b b b b b b b bb b b b b b b b b b b b b b b b b b b bb b b bb b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b bb b b b bb b b b b b b bb bb b b b b b b b b b b b b bb b b bb b b b bb b b b b 900 b b b b b b b b b b b b b b b b b b b b bb b b b b b bb b b b b b b bb b b b b b bb b b b b b b b b b b b b b b b bb b b b b bb b b b b b b b b b b b b b b b b b b b bb b b b b b b bb b b b b b b b b b bb b b bb b 1000 b b bb b b b b b b b b b b b bb b b b b b bb b bb b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b bb b b b b b b b b b b b b b b b b b bb b b b bb b b b bb b b b b b b b b bb b b b b b b 1100 b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b bb b b bb b bb b b b b b b b b b b bb b b b bb b b b b b b bb b b b b 1200 bb b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b bb b bb b b b bb b b b b b b b b b b b b b b b b bb b b b b b b b bb b b b b b bb b b bb b b b bb b b b b 1300 b b b b b b b b bb b b bb b b b b b b b b b b bb b b b b b b b b b bb b b b b b b b b b b b b b b b b b b bb b b b b b bb b b b bb b b b b b b bb b b b b b b bb b b bb b b b b b b b b b b b bb b b 1400 b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b bb b b b b b b b bb b b b b b b b bb b b b b b b b b b b b b b bb b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b 1500 b b b bb b b b b bb b b b b b b bb b bb b b bb bb b bb b b b b b b b b b b b bb b b b b b b b b b b b b b b b bb b b b b b b b b bb b b b bb b b b b b b b b b b bb b bb b b b b b b b b b b b b bb b b b b b b 1600 b b b b b b b b b bb b b b b b b b b b b b bb b b b b bb b b b b b bb b b b b b bb b b b b b b bb b b b bb b b b b b b b b b bb b b b b b b b b b b bb b b bb b b b bb b b bb b b b b 1700 b b b b b b bb b b b b b b b bb b b bb b b b b bb b b b b b b b b b b bb b b b b b b b b b bb b b b b b b bb b b b b b b bb b b bb b b bb b b b b b bb b b b b b b b b b bb b b bb b b b b b b b 1800 bb b b b b b b b b b bb b b b b b b b b b bb b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b bb b b 1900 b b b b b b b b bb b b b b b b b b b b b b bb b b b b b bb b b b b b bb b b b b b b b bb b b b bb b b b b b b bb b b b b b bb b b b b b b b bb b b b b b b b b b b bb b b b b b 12.4 Perfect numbers 415

12.4 Perfect numbers

A number is perfect is the sum of its proper divisors (including 1) is equal to the number itself.

2 k 1 k Theorem 12.1 (Euclid). If 1+2+2 + +2 − =2 1 is a prime k 1 k ··· − number, then 2 − (2 1) is a . − Note: 2k 1 is usually called the k-th Mersenne number and denoted − by Mk. If Mk is prime, then k must be prime. Theorem 12.2 (Euler). Every even perfect number is of the form given by Euclid.

Open problem Does there exist an odd perfect number? Theorem-joke 12.1 (Hendrik Lenstra). Perfect squares do not exist. 3 Proof. Suppose n is a perfect square. Look at the odd divisors of n. They all divide the largest of them, which is itself a square, say d2. This shows that the odd divisors of n come in pairs a, b where a b = d2. Only d is paired to itself. Therefore the number of odd divisors· of n is also odd. In particular, it is not 2n. Hence n is not perfect, a contradiction: perfect squares don’t exist.

3Math. Intelligencer, 13 (1991) 40. 416 Prime and perfect numbers

12.5 Mersenne primes

p Primes of the form Mp = 2 1 are called . The only known Mersenne primes are listed− below.

k Year Discoverer k Year Discoverer 2 Ancient 3 Ancient 5 Ancient 7 Ancient 13 Ancient 17 1588 P. A. Cataldi 19 1588 P. A. Cataldi 31 1750 L. Euler 61 1883 I. M. Pervushin 89 1911 R. E. Powers 107 1913 E. Fauquembergue 127 1876 E. Lucas 521 1952 R. M. Robinson 607 1952 R. M. Robinson 1279 1952 R. M. Robinson 2203 1952 R. M. Robinson 2281 1952 R. M. Robinson 3217 1957 H. Riesel 4253 1961 A. Hurwitz 4423 1961 A. Hurwitz 9689 1963 D. B. Gillies 9941 1963 D. B. Gillies 11213 1963 D. B. Gillies 19937 1971 B. Tuckerman 21701 1978 C. Noll, L. Nickel 23209 1979 C. Noll 44497 1979 H. Nelson, D. Slowinski 86243 1982 D. Slowinski 110503 1988 W. N. Colquitt, L. Welsch 132049 1983 D. Slowinski 216091 1985 D. Slowinski 756839 1992 D. Slowinski, P. Gage 859433 1993 D.Slowinski 1257787 1996 Slowinski and Gage 1398269 1996 Armengaud, Woltman et al. 2976221 1997 Spence, Woltman, et.al. 3021377 1998 Clarkson et. al 6972593 1999 Hajratwala et. al 13466917 2001 Cameron, Woltman, 20996011 2003 Michael Shafer 24036583 2004 Findlay 25964951 2005 Nowak 30402457 2005 Cooper, Boone et al 32582657 2006 Cooper, Boone et al 37156667 9/8/2008 Elvenich 42643801 2009 Strindmo 43112609 8/8/2008 Smith

According to the Prime Pages 4, the most recently (in 2008 and 2009) discovered Mersenne primes Mp for p = 42643801 and 43112609 have 12837064 and 12978189 digits respectively, and are the largest known primes to date (May 2012).

4http://primes.utm.edu. 12.6CharlesTwiggonthefirst10perfectnumbers 417

12.6 Charles Twigg on the first 10 perfect numbers

Let Pn be the n-th perfect number.

k 1 n k Mk Pn =2 − Mk 123 6 237 28 3531 496 47127 8128 5 138191 33550336 6 17 131071 8589869056 7 19 524287 137438691328 8 31 2147483647 2305843008139952128 9 61 2305843009213693951 26584559915698317446 54692615953842176 10 89 61897001964269013744 19156194260823610729 9562111 47933780843036381309 97321548169216

P1 is the difference of the digits of P2. In P2, the units digit is the • cube of the of tens digit. P and P are the first two perfect numbers prefaced by squares. • 3 4 The first two digits of P3 are consecutive squares. The first and last digits of P4 are like cubes. The sums of the digits of P3 and P4 are the same, namely, the prime 19. P terminates both P and P . 5 • 4 11 14 Three repdigits are imbedded in P . • 5 P contains each of the ten decimal digits except 0 and 5. • 7 P9 is the smallest perfect number to contain each of the nine nonzero • digits at least once. It is zerofree.

P10 is the smallest perfect number to contain each of the ten decimal • digits at least once.

5These contain respectively 65 and 366 digits. 418 Prime and perfect numbers

Exercise 1. Let p , p ,..., p be the first k primes, and q := p p p +1. 1 2 k k 1 2 ··· k (a) Knowing qk and pk+1, how can one find qk+1? (b) Complete the following table for k =7, 8, 9, 10, and verify that qk is divisible the prime rk given below by computing the quotient qk : rk

qk k pk qk rk rk 1 2 3 2 3 7 3 5 31 4 7 211 5 11 2311 6 13 30031 59 509 7 17 19 8 19 347 9 23 317 10 29 331 11 31 200560490131

2. Let pn denote the n-th prime number.

Find the smallest value of n for which p1p2 pn 1 is not a • prime number. ··· − Find the smallest value of n > 3 for which n!+1 is a prime • number. Find the smallest value of n > 7 for which n! 1 is a prime • number. −

1 1 p 3. Find all positive integers m and n such that m + n = q , where p < q are consecutive prime numbers. Answer. (m, n, p, q)=(3, 3, 2, 3), (2, 6, 2, 3), (2, 10, 3, 5). Solution. Notethat m = n = p =2, q = m, and q = m =3. (m, n, p, q)=(3, 3, 2, 3). ⇒ m+n p We may assume m < n. Rewrite the equation as mn = q , or mn q q m+n = p . Since p < q are consecutive prime numbers, p < 2. This means mn < 2(m + n); (m 2)(n 2) < 4. − − 12.6CharlesTwiggonthefirst10perfectnumbers 419

Here are the only possibilities: 1 p 1 2p q 2q (a) m 2=0: m = 2. In this case n = q 2 = 2−q ; n = 2p q . Since 2−q and 2p q are relatively prime, we− must have 2p q =1− , q =2p 1. The− only possibilities for p and 2p 1 to be consecutive− primes− are (p, q)=(2, 3) or (3, 5). Correspondingly,− n =2p. 1 1 7 (b) (m 2, n 2) = (1, 2): (m, n)=(3, 4). In this case m + n = 12 is not a− ratio− of two consecutive primes. 1 1 8 (c) (m 2, n 2) = (1, 3): (m, n)=(3, 5). Again m + n = 15 is not a ratio− of two− consecutive primes.

4. Let (an) be a sequence of numbers defined recursively by a = a2 a +1, a =2. n+1 n − n 1

Show that for distinct indices i and j, gcd(ai, aj)=1. Hence, deduce that there are infinitely many prime numbers. Solution. a 1 = a (a 1). If j > i, then a 1=(a n+1 − n n − j − i − 1)ai aj 1; aj aj 1 (ai 1)ai = 1. This shows that ai and ··· − − − ··· − aj are relatively prime. Note that an is always positive. It is equal to 1 if and only if an 1 =1. Since a1 =2, an > 1 for every n. The − prime divisors of ai and aj are all distinct. This shows that there are infinitely many prime numbers. 5. Prove that a power of a prime number cannot be a perfect number. 6. For a positive integer n, show that if σ(n) is prime, then so is d(n). Solution. Since σ is a , if σ(n) is prime, then n must be a . Write n = pk, so that σ(n) = σ(pk)=1+ p + pk, and τ(n)=1+ k. If 1+ k = ab, then 1+ p + + pk is··· divisible by 1+ pa and is not a prime. ··· 7. A minimum security prison contains 100 cells with one prisoner in each. The athletic young warden was ordered to free a certain number of these prisoners at his discretion, and this is how he did it. First he walked along the row of cells opening every door. Starting at the beginning again, he shuts every second door. During his third walk, starting at the beginning, he stopped at every third door: if it was open he shut it, if it was shut he opened it. On his fourth walk he did the same, opening closed doors and closing open doors, 420 Prime and perfect numbers

except he did it for every fourth door. On his fifth walk he stopped at every fifth door, closing it if it was open and opening it if it was shut. And so on, until at last he had completed the full hundred walks. The prisoners in cells whose doors were still open were freed. Which were the lucky cells? 8. Two numbers m and n are called amicable if σ(m) = σ(n) = m + n. (a) Verify that 220 and 284 are amicable.

(b) Define two sequences (pn) and (qn) by

n pn =3 2 1, · 2n−1 q =9 2 − 1, n =1, 2,.... n · −

Show that if pn 1, pn, and qn are prime numbers, then − n n a =2 pn 1pn, b =2 qn − are amicable. (c) Make use of (b) to find three pairs of . 12.7 Primes in arithmetic progression 421

12.7 Primes in arithmetic progression

B. Green and T. Tao (2004) have proved that there are arbitrarily long arithmetic progressions of prime numbers. For k = 0, 1, 2,..., 21, the numbers 376859931192959 + 18549279769020k are all primes.

12.8 The prime number spirals

The first 1000 prime numbers arranged in a spiral. = prime of the form 4n +1; = prime of the form 4n +3.

b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b 2 b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b 422 Prime and perfect numbers

12.8.1 The prime number spiral beginning with 17

b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b 17 b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b

The numbers on the 45 degree line are n2 + n + 17. Let f(n) = n2 + n + 17. The numbers f(0), f(1),... f(15) are all prime.

n f(n) n f(n) n f(n) n f(n) 0 17 1 19 2 23 3 29 4 37 5 47 6 59 7 73 8 89 9 107 10 127 11 149 12 173 13 199 14 227 15 257 12.8 The prime number spirals 423

12.8.2 The prime number spiral beginning with 41

b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b 41 b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b

The numbers on the 45 degree line are f(n)= n2 + n + 41. f(n)= n2 + n + 41 is prime for 0 n 39. ≤ ≤ n f(n) n f(n) n f(n) n f(n) n f(n) 0 41 1 43 2 47 3 53 4 61 5 71 6 83 7 97 8 113 9 131 10 151 11 173 12 197 13 223 14 251 15 281 16 313 17 347 18 383 19 421 20 461 21 503 22 547 23 593 24 641 25 691 26 743 27 797 28 853 29 911 30 971 31 1033 32 1097 33 1163 34 1231 35 1301 36 1373 37 1447 38 1523 39 1601 424 Prime and perfect numbers

Prime number spiral beginning with 41: A closer look

b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b 41b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b bb b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b bb b b b b b b b b b bb b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b bb b b b b b b b b b b b bb b b b b b b b b b b b b b b b bb b bb b b b b b b b b b bb b b b b b b b b b b bb b b b b b b b b b bb b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b b b b b bb b b b b b b b bb b b b b b b b b bb b b b b b bb b b b b b bb b b b b bb b b b b b b b b b b b b b b b b b b b b b b bb b b b b bb b b b b b b bb bb b b b b b b b b b b b bb b b b b bb b b b bb b b b b b b b b b b b bb b b b b b b b b b b b b b b b b b b b b b b b b b b bb b b b b Chapter 13

Cheney’s card trick

You are the magician’s assistant. What he will do is to ask a spectator to give you any 5 cards from a deck of 52. You show him 4 of the cards, and in no time, he will tell everybodywhat the 5th card is. This of course depends on you, and you have to do things properly by making use of the following three basic principles.

13.1 Three basic principles

13.1.1 The pigeonhole principle

Among 5 cards at least 2 must be of the same suit. So you and the magician agree that the secret card has the same suit as the first card.

13.1.2 Arithmetic modulo 13

The distance of two points on a 13-hour clock is no more than 6. We decide which of the two cards to be shown as the first, and which to be kept secret. For calculations, we treat A, J, Q, and K are respec- tively 1, 11, 12, and 13 respectively. Now you can determine the distance between these two cards. From one of these, going clockwise, you get to the other by traveling this dis- tance on the 13-hour clock. Keep the latter as the secret card. 502 Cheney’s card trick

hours distance clockwise 2 and 7 5 2 to 7 3 and 10 6 10 to 3 2 and J 4 J to 2 A and 8 6 8 to A The following diagram shows that the distance between 3 and 10 is 6, not 7. ♣ ♥ Q K ♣ ♠ A ♦ J ♥ 6 2 ♣ 10 ♥ 3 ♣ 9 ♦ 4 ♦ 8 ♣ 5 7 6 ♥ ♦ ♣ 13.1.3 Permutations of three objects There are 6 arrangements of three objects The remaining three cards can be ordered as small, medium, and large. 1 Now rearrange them properly to tell the magician what number he should add (clockwise) to the first card to get the number on the secret card. Let’s agree on this:

arrangement distance sml 1 slm 2 msl 3 mls 4 lsm 5 lms 6

If you, the assistant, want to tell the magician that he shouldadd4to the number (clockwise) on the first card, deal the medium as the second card, the large as the third, and the small as the fourth card.

1First by numerical order; for cards with the same number, order by suits: < < < . ♣ ♦ ♥ ♠ 13.2 Examples 503

13.2 Examples

Example 13.1. Suppose you have 5, 7, J, 4, and Q, and you decide to use the cards for the first♠ and♣ the♦ secret♣ ones.♠ The distance between 7 and♣ 4 is of course 3, clockwise from 4 to 7. You therefore show♣ 4♣as the first card, and arrange the other♣ three♣ cards, 5, J, and Q♣, in the order medium, small, large. The second card ♠is J♦, the third♠ 5, and the fourth Q. The secret card is 7. ♦ ♠ ♠ ♣

4 J ♣ 5 ♦ Q ♠ ? ♠ ?

Example 13.2. Now to the magician. Suppose your assistant show you these four cards in order:

Q J ♠ 7 ♦ 4 ♣ ? ♣ ?

Then you know that the secret card is a , and you get the number by adding to Q the number determined by the♠ order large, medium, small, which is 6. Going clockwise, this is 5. The secret card is 5. ♠ Exercise 1. For the assistant: (a) 5, 7, 6, 5, Q. ♠ ♠ ♦ ♣ ♣ (b) 2, J, K, 2, 8. ♥ ♠ ♥ ♣ ♠ 504 Cheney’s card trick

2. For the magician: what is the secret card?

5 2 7 J ♠ 6 ♥ 2 ♠ 5 ♠ 8 ♦ ? ♣ ? ♣ ? ♠ ? Chapter 14

Variations of Cheney’s card trick

14.1 Cheney card trick with spectator choosing secret card

Now the spectators say they choose the secret card. What should you, the assistant, do? 1. Arrange the four open cards in ascending order, and put the n-th card in the first position, with n =1, 2, 3, 4, according as the secret card is for , , , or . For example, if you are given 2, 6, K, 10,♣ and♦ ♥4 as secret♠ card, then since ♠ ♥ ♦ ♠ ♣ 2 < 6 < 10 < K, ♠ ♥ ♠ ♦ you put 2 in the first position. ♠ 2. Note the rank of the secret card. If it is the same as the first card, put the secret card in the third position, and arrange the remaining three in any order. 3. If the ranks of secret card and the first card are different, deter- mine the 13 point clock difference, and arrange the remaining three open cards− to indicate this difference. (a) If the rank of the secret card is higher than that of the first card, put the secret card in the second position, followed by the remaining three open cards in the positions indicating the difference. 506 Variations of Cheney’s card trick

(b) If the rank of the secret card is lower than that of the first card, put the three open cards in the positions indicating the differ- ence, followed by the secret card.

2 ? ♠ 6 ? K ♥ 10 ♦ ♠

Now, for the magician,

1. Determine the order of the first card among the four open cards. The secret card is , , , according as this is the least, second, third, or largest. ♣ ♦ ♥ ♠ 2. If the secret card appears in the third position, its rank is the same as the rank of the first card. 3. If the secret card separates the first card from the remaining three, add the number determined by the remaining three cards to the first card to get the rank of the secret card. 4. If the secret card appears at the end, subtract the number deter- mined by the remaining three cards from the first card to get the rank of the secret card.

Exercise 1. For the assistant: (a) 5, 7, 6 (secret card), 5, Q. ♠ ♠ ♦ ♣ ♣ (b) 2, J, K, 2, 8 (secret card). ♥ ♠ ♥ ♣ ♠ 2. For the magician: what is the secret card? 14.2 A 3-card trick 507

5 2 ? J ♠ ? 6 ♥ 2 5 ♠ 8 ♦ 7 ♣ ? ♣ ♠ ? ♠

14.2 A 3-card trick

Here is a card trick with only three cards. The spectators choose 3 cards and specify one of them to be a secret card. You, the assistant, is to arrange the three cards (with the secret card face down) in such a way that your master, the magician, by selling how you display them, can tell what the secret card is. You are going to put the three cards in left, middle, right positions, and in succession: first, second, or third. When the secret card is not revealed, it is treated as the largest compared with other cards.

1. The secret card is not a king: Determine the 13 point clock differ- ence between king and the rank of the secret card.− Arrange them in left-middle-right position to indicate this difference from king, and show in succession according to the following table.

Order in succession First Second Third lower than king secret small medium ♣ higher than king secret medium small ♣ lower than king small secret medium ♦ higher than king medium secret small ♦ lower than king small medium secret ♥ higher than king medium small secret ♥ lower than king secret, small medium ♠ higher than king secret, medium small ♠

2. The secret card is a king: 508 Variations of Cheney’s card trick

Order in succession First Second Third king secret, ***, *** ♣ king ***, secret, *** ♦ king ***, ***, secret ♥ king small, medium secret ♠ Here is an example. Suppose the spectators give you, the assistant, the cards 4, A (secret card), and 7. Then the 13-point clock difference (from♦ ♠king) is 1. From left to♥ right you should arrange 4, 7, secret. To indicate that this is higher than king, you show the secret♦ card♥ with 7 first, then 4. ♥ ♦ Order in succession Left Middle Right First 7 secret Second 4 ♥ Third ♦ For the magician, 1. If all three cards are shown simultaneously, the secret card is a king. It is , , or according as the secret card is in the left, middle, or right♣ ♦position.♥ 2. If the open cards are shown simultaneously (before the secret card), the secret card is K. ♠ 3. If the secret card is shown simultaneously and one open card, the secret hard is . It is above or below king according as the secret card is shown♠ simultaneously with the medium or smaller open card. 4. No two cards are shown simultaneously. The positions of the cards gives the 13 point clock difference from king. The secret card is , , or according− as the secret card is shown first, second, or third♣ ♦. It is♥ above or below king according as the medium is shown before or after the smaller of the open cards.

Exercise (1) For the assistant: 1. A, 3 (secret card), and 10. ♥ ♦ ♠ 14.2 A 3-card trick 509

2. 4, 5, 6 (secret card). ♣ ♣ ♣ (2) For the magician: Left Middle Right First secret 1. Second 8 Third A ♦ ♠ Left Middle Right First 7 2. Second ♥ 4 Third secret ♦ 510 Variations of Cheney’s card trick Chapter 15

The Catalan numbers

15.1 Number of nonassociative products

Given a nonassociative binary operation, there are two ways of multiply- ing three elements a, b, c in different orders: (ab)c and a(bc). With four elements, there are 5 ways:

((ab)c)d, (a(bc))d, (ab)(cd), a((bc)d), a(b(cd)).

Let Cn be the numbers of ways of multiplying n +1 elements a0, a1, ... an 1, an. Clearly, C0 =1, C1 =1, C2 =2, and C3 =5. − More generally, suppose in forming a product of n +2 elements a0, ..., an+1, the last operation combines a product of a0, ..., ak with a product of ak+1, ... an+1. There are CkC(n+1) (k+1) = CkCn k such products. Therefore, − −

Cn+1 = C0Cn + C1Cn 1 + + CnC0. − ···

These numbers are called the Catalan numbers. Here are some of the beginning values:

n 0 1 2 3 4 5 C 1 1 2 5 14 42 ··· n ···

1 2n Theorem 15.1. Cn = n+1 n .  512 The Catalan numbers

Proof. Let f(x) be the generating function of the Catalan numbers:

f(x)= C + C x + C x2 + + C xn + . 0 1 2 ··· n ···

Note that the number C0Cn + C1Cn 1 + + CnC0 is the coefficient of xn in the expansion − ···

(C + C x + C x2 + + C xn + )(C + C x + C x2 + + C xn + ) 0 1 2 ··· n ··· 0 1 2 ··· n ··· = f(x)2.

From the recurrence relations we have

∞ n f(x)= Cnx n=0 X ∞ n+1 = C0 + Cn+1x n=0 X ∞ n = 1+ x (C0Cn + C1Cn 1 + + CnC0)x − ··· n=0 X = 1+ xf(x)2.

Therefore, xf(x)2 f(x)+1=0, and −

1 √1 4x f(x)= ± − . 2x

Since f(x) is a power series of x, we must choose the minus sign so that the constant terms in the numerator cancel one another. By Newton’s binomial theorem, 15.1 Number of nonassociative products 513

∞ 1 √1 4x = 1+ 2 ( 4x)n+1 − n +1 − n=0   X 1 1 3 2n 1 ∞ − = 1+ ( 1)n+1 22(n+1) 2 − 2 − 2 ··· − 2 xn+1 − · · (n + 1)! n=0    X ∞ ( 1)n 1 3 (2n 1) = 1+ ( 1)n+1 22(n+1) − · · ··· − xn+1 − · · 2n+1(n + 1)! n=0 X ∞ 1 3 (2n 1) = 1 2n+1 · ··· − xn+1 − · (n + 1)! n=0 X ∞ 2 1 3 (2n 1) = 1 2n · ··· − xn+1 − n +1 · · n! n=0 X ∞ 2 1 3 (2n 1) 2nn! = 1 · ··· − · xn+1 − n +1 · (n!)(n!) n=0 X ∞ 2 (2n)! = 1 xn+1 − n +1 · (n!)(n!) n=0 X ∞ 1 2n = 1 2x xn. − · n +1 n n=0 X   Hence,

1 √1 4x ∞ 1 2n f(x)= − − = xn. 2x n +1 n n=0 X   From this, we have 1 2n C = . n n +1 n  

The number of sequences of n +1’s and 1’s with all partial sums nonnegative is the − 1 2n C = . n n +1 n   514 The Catalan numbers

Exercise 1. Solve the recurrence relation n n an+1 = akan k, a0 =1. k − k X=0  

Answer. an = n!. Solution. Consider the beginning values:

0 a = a a =1, 1 0 0 0   1 1 a = a a + a a =2, 2 0 0 1 1 1 0     2 2 2 a = a a + a a + a a =2+2+2=6, 3 0 0 2 1 1 1 2 2 0       3 3 3 3 a = a a + a a + a a + a a 4 0 0 3 1 1 2 2 2 1 3 3 0         = 6+3 2+3 2+6=24, · · . .

It is reasonable to conjecture that ak = k!. Assuming this for all k n. ≤

n n an+1 = akan k k − k=0   Xn n! = k! (n k)! k!(n k)! · · − k=0 − Xn = n! k X=0 = (n + 1)n! = (n + 1)!.

Therefore, a = n! for every integer n 0. n ≥ 15.1 Number of nonassociative products 515

Exercise 2(2n 1) 1. Prove that Cn = − Cn 1. n+1 −

2. Calculate the Catalan numbers C6,..., C10.

n 0 1 2 3 4 5 6 7 8 9 10 C 1 1 2 5 14 42 132 429 1430 4862 16796 ··· n ··· Chapter 16

The golden ratio

16.1 Division of a segment in the golden ratio

Given a segment AB, a point P in the segment is said to divide it in 2 AP √5+1 the golden ratio if AP = P B AB. Equivalently, P B = 2 . We shall denote this golden ratio by ϕ· . It is the positive root of the quadratic equation x2 = x +1.

M

Q

A P B A P B

Construction 16.1 (Division of a segment in the golden ratio). Given a segment AB, (1) draw a right triangle ABM with BM perpendicular to AB and half in length, (2) mark a point Q on the hypotenuse AM such that MQ = MB, (3) mark a point P on the segment AB such that AP = AQ. Then P divides AB into the golden ratio. 602 The golden ratio

Suppose P B has unit length. The length ϕ of AP satisfies

ϕ2 = ϕ +1. This equation can be rearranged as

1 2 5 ϕ = . − 2 4   Since ϕ> 1, we have 1 ϕ = √5+1 . 2   Note that AP ϕ 1 2 √5 1 = = = = − . AB ϕ +1 ϕ √5+1 2 This explains the construction above. 16.2 The regular pentagon 603

16.2 The regular pentagon

Consider a regular pentagon ACBDE. It is clear that the five diagonals all have equal lengths. Note that (1) ∠ACB = 108◦, (2) triangle CAB is isosceles, and (3) ∠CAB = ∠CBA = (180◦ 108◦) 2=36◦. − ÷ In fact, each diagonal makes a 36◦ angle with one side, and a 72◦ angle with another. C

A B P

E D

It follows that (4) triangle PBC is isosceles with ∠PBC = ∠P CB = 36◦, (5) ∠BPC = 180◦ 2 36◦ = 108◦, and (6) triangles CAB and− PBC× are similar. Note that triangle ACP is also isosceles since (7) ∠ACP = ∠AP C = 72◦. This means that AP = AC. Now, from the similarity of CAB and PBC, we have AB : AC = BC : P B. In other words AB AP = AP P B, or AP 2 = AB P B. This means that P divides AB in· the golden· ratio. · 604 The golden ratio

16.3 Construction of 36◦, 54◦, and 72◦ angles

Angles of sizes 36◦, 54◦, and 72◦ can be easily constructed from a seg- ment divided in the golden ratio.

C

1

36 36 36◦ ◦ B A P ϕ

ϕ cos36◦ = 2 .

C

C

54◦ 72◦

36◦ B A P 1

54◦ 72◦ B A P ϕ D

1 cos72◦ = 2ϕ . 16.3 Construction of 36◦, 54◦, and 72◦ angles 605

Exercise

1. Three equal segments A1B1, A2B2, A3B3 are positioned in such a way that the endpoints B2, B3 are the midpoints of A1B1, A2B2 respectively, while the endpoints A1, A2, A3 are on a line perpen- dicular to A1B1. Show that A2 divides A1A3 in the golden ratio.

B1

B2 B3

A1 A2 A3

2. Given an equilateral triangle ABC, erect a square BCDE exter- nally on the side BC. Construct the circle, center C, passing through E, to intersect the line AB at F . Show that B divides AF in the golden ratio.

D

C

E

A B F 3. Given a segment AB, erect a square on it, and an adjacent one with base BC. If D is the vertex above A, construct the bisector of angle ADC to intersect AB at P . Calculate the ratio AP : P B.

D

A P B C 606 The golden ratio

4. Let D and E be the midpoints of the sides AB and AC of an equi- lateral triangle ABC. If the line DE intersects the circumcircle of ABC at F , calculate the ratio DE : EF . A

D E F

O

B C

5. Given a segment AB with midpoint M, let C be an intersection of the circles A(M) and B(A), and D the intersection of C(A) and A(C) inside B(A). Prove that the line CD divides AB in the golden ratio.

C

D A B M P

6. The three small circles are congruent. Show that each of the ratios OA T X ZT AB , XY , TO . is equal to the golden ratio.

Z X Y

T B O A 16.3 Construction of 36◦, 54◦, and 72◦ angles 607

7. Which of the two equilateral triangles inscribed in a regular pen- tagon has larger area?

8. Which of the two squares inscribed in a regular pentagon has larger area? 608 The golden ratio

16.4 The most non-isosceles triangle

Given a triangle with sides a, b, c, there are six ratios obtained by com- paring the lengths of a pair of sides: a b b c a c , , , , , . b a c b c a The one which is closest to 1 is called the ratio of nonisoscelity of the triangle. The following theorem shows that there is no most non-isosceles tri- angle. Theorem 16.1. A number η is the ratio of nonisoscelity of a triangle if and only if ϕ 1 < η 1. − ≤ a 1 b 1 1 Proof. First note that if b = r < 1, then r = a > 1. Since 2 (r + r ) > 1, 1 it follows that r is closer to 1 than r . If a b c are the lengths of the three sides of a triangle, the ratio of nonisoscelity≤ ≤ is a b η = max , . b c   Since a + b>c, we have a a + b c 1 η +1 +1= > . ≥ b b b ≥ η Therefore, η2 + η > 1. Since the roots of x2 + x 1 are ϕ 1 > 0 and ϕ< 0, we must have η>ϕ 1. Therefore, η −(ϕ 1, −1]. − Conversely, for each number−t (ϕ 1, 1], we∈ have− t2 + t> 1 and 1 1∈ − t +1 > t . The numbers t 1 t form the sides of a triangle with ratio of nonisoscelity equal to t≤. ≤ Chapter 17

Medians and angle Bisectors

17.1 Apollonius’ Theorem

Theorem 17.1. Given triangle ABC, let D be the midpoint of BC. The length of the median AD is given by AB2 + AC2 = 2(AD2 + BD2).

A

B D C Proof. Applying the law of cosines to triangles ABD and ACD, and noting that cos ADB = cos ADC, we have − AB2 = AD2 + BD2 2AD BD cos ADB; − · · AC2 = AD2 + CD2 2AD CD cos ADC, − · · = AD2 + BD2 +2AD BD cos ADB. · · The result follows by adding the first and the third lines.

If ma denotes the length of the median on the side BC, 1 m2 = (2b2 +2c2 a2). a 4 − 610 Medians and angle Bisectors

Example 17.1. Suppose the medians BE and CF of triangle ABC are perpendicular. This means that BG2 + CG2 = BC2, where G is the 4 2 4 2 centroid of the triangle. In terms of the lengths, we have 9 mb + 9 mc = 2 2 2 2 2 2 2 2 2 2 2 a ; 4(mb + mc)=9a ; (2c +2a b )+(2a +2b c )=9a ; b2 + c2 =5a2. − − This relation is enough to describe, given points B and C, the locus of A for which the medians BE and CF of triangle ABC are perpen- dicular. Here, however, is a very easy construction: From b2 + c2 =5a2, we have m2 = 1 (2b2 +2c2 a2) = 9 a2; m = 3 a. The locus of A is a 4 − 4 a 2 the circle with center at the midpoint of BC, and radius 3 BC. 2 · Exercise 1. The triangle with sides 7, 8, 9 has one median equal to a side. Which median and which side are these? 2. The lengths of the sides of a triangle are 136, 170, and 174. Calcu- late the lengths of its medians. 3. Triangle ABC has sidelengths a = 17, b = 13, c = 7. Show that the medians are in the proportions of the sides.

A

7 13

B 17 C 17.2 Angle bisector theorem 611

17.2 Angle bisector theorem

Theorem 17.2 (Angle bisector theorem). The bisectors of an angle of a triangle divide its opposite side in the ratio of the remaining sides. If AX and AX′ respectively the internal and external bisectors of angle BAC, then BX : XC = c : b and BX′ : X′C = c : b. − Z

A

Z′ b c

B X C X′

Proof. Construct lines through C parallel to the bisectors AX and AX′ to intersect the line AB at Z and Z′. (1) Note that ∠AZC = ∠BAX = ∠XAC = ∠ACZ. This means AZ = AC. Clearly, BX : XC = BA : AZ = BA : AC = c : b. (2) Similarly, AZ′ = AC, and BX′ : X′C = BA : AZ′ = BA : AC = c : b. − − 612 Medians and angle Bisectors

17.3 The angle bisectors

The length of the internal bisector of angle A is 2bc A t = cos , a b + c 2

A

ta′ ta

Q B P C and that of the external bisector of angle A is 2bc A t′ = sin . a b c 2 | − | Example 17.2. The triangle (a, b, c) = (125, 154, 169) is a Heron tri- angle with rational angle bisectors. Its area is 9240. The lengths of the bisectors are , , and .

Exercise 1. The triangle with sides 6, 7, 8 has one angle bisector equal to a side. Which angle bisector and which side are these? 1 2. The triangle with sides 17, 24, 27 has one angle bisector equal to a side. Which angle bisector and which side are these? 2 3. The triangle with sides 84, 125, 169 has three rational angle bisec- tors. Calculate the lengths of these bisectors. 3 4. Prove that the bisector of the right angle of a Pythagorean triangle cannot have rational length. 5. Give an example of a Pythagorean triangle with a rational bisector. 6. Prove that the bisectors of the acute angles of a Pythagorean trian- gle cannot be both rational.

1 tb = a = 6. 2 ta = b = 24. 3 975 26208 12600 ta = 7 , tb = 253 , tc = 209 . 17.4 Steiner-Lehmus Theorem 613

17.4 Steiner-Lehmus Theorem

Theorem 17.3. A triangle is isosceles if it has two equal angle bisectors.

A

F Y Z E

B C

Proof. Suppose the bisectors BE = CF , but triangle ABC not isosce- les. We may assume ∠B < ∠C. Construct parallels to BC through E and F to intersect AB and AC at Z and Y respectively. (1) In the isosceles triangles ZBE and Y CF with equal bases BE and CF , ∠ZBE < ∠Y CF = EZ EC. This clearly implies YF

Y

A

tb′ C

B a

tc′

Z 614 Medians and angle Bisectors

1 (1) From tb′ = a, we have 2 (π β)=2γ; β +4γ = π. 1 − (2) From tc′ = a, we have 2 (π γ)= π 2(π β)=2β π; 4β+γ =3π. 11π π − −π − − From these, β = 15 , γ = 15 , and α = 5 .

Exercise

1. The bisector ta and the external bisector tb′ of triangle ABC satisfy 4 ta = tb′ = c. Calculate the angles of the triangle.

Y

C

tb′ ta X

A c B 2. AD and BE are angle bisectors of triangle ABC, with D on BC and E on AC. Suppose that AD = AB and BE = BC. Determine the angles of the triangle. Show that if CF is the external bisector of angle C, then CF = CA. 5 A

E

B D C

4 2π 7π 2π Answer: α = 15 , β = 15 , γ = 5 . 5 2π 6π 5π Answer: α = 13 ,β = 13 , γ = 13 . Chapter 18

Dissections

18.1 Dissection of the 6 6 square × Since 1+2+3+4+5+6+7+8=62, it is reasonable to look for a dissection of a 6 6 square into eight pieces with areas 1, 2, ..., 8 square units. ×

1. 5 cuts: Construct a line through A which completes the dissection.

A

2. 4 straight cuts: Construct a line through B which completes the dissection.

B 616 Dissections

3. 5 straight cuts: Construct two lines through C to complete the dis- section.

C 18.2 Dissection of a 7 7 square into rectangles 617 × 18.2 Dissection of a 7 7 square into rectangles × Dissect a square into seven rectangles of different shapes but all having the same area. 1

R4

R5

R7 R2 R3

R6

R1

Suppose each side of the square has length 7, and for i = 1, 2 ..., 7, the rectangle Ri has (horizontal) length ai and (vertical) height bi. Set- ting a1 = r, we compute easily in succession, b1, b2, a2, a3, b3, b4, a4, a5, b5, using aibi =7. Now, a =7 a a , 6 − 2 − 3 b =7 b b , 6 − 1 − 5 a =7 a a a , 7 − 2 − 3 − 5 b =7 b b b . 7 − 1 − 4 − 6

rectangle ai bi R 7 1 r r r 7(r 1) R − 2 r 1 r R − 7 3 7 r 7 r 7−r 7(6− r) R − 4 6−r 7 r 5(7r −7 r2) 7(6 r)(−r 1)3 R − − − − 5 (6 r)(r 1) 5(7r 7 r2 −r(r 2)− 7(r 1)(29−r −35 4r2 ) R − − − − 6 r 1 5r(7r 7 r2) (7 r)(6 r)(28− 27r+4r2 ) 7(6− r−) R − − − − 7 5 r 5(7 r)(7r 7 r2) − − − −

1Problem 2567, Journal of Recreational Math., . A dissection into seven rectangles was given by Hess and Ibstedt. Markus G¨otz showed that no solution with n rectangles exists for 2 n 6. ≤ ≤ 618 Dissections

The relations a6b6 =7 and a7b7 =7 both reduce to (2r 7)(2r2 14r +15)= 0. − − 7 7 √19 Since r = 2 or −2 would make a7, b7 negative, we must have r = 7+√19 2 . The dimensions of the rectangles are as follows.

rectangle ai bi R 7+√19 77 √19 1 2 −15 R 7(8+√19) 8 √19 2 15 −3 R 7(7+√19) 7 √19 3 15 −2 8+√19 7(8 √19) R − 4 3 15 R 5 21 5 3 5 5(1+√19) 7( 1+√19) R − 6 6 15 5( 1+√19) 7(1+√19) R − 7 6 15 18.3Dissectarectangletoformasquare 619

18.3 Dissect a rectangle to form a square

Dissect a given rectangle by two straight cuts into three pieces that can be reassembled into a square.

If this is possible, the lengths of the cuts must be as follows, and it is enough to verify that x = √ab b. − a √ab √ab −

b

x

√ab a √ab This is clear since − b √b x =(a √ab) = √a(√a √b) = √ab b. − · √ab − · √a −

a √ab −

b

√ab 620 Dissections

18.4 Dissection of a square into three similar parts

Dissect a square into three similar parts, no two congruent.

2 D 1 x C

x

x2 x +1 −

A B x2 +1 Solution. x2 +1= x(x2 x + 1); x3 2x2 + x 1=0. − − − Exercise 1. Show that the area of the largest rectangle is x4. Solution. Thisareais

(x2 + 1)(x2 x + 1) − = x4 x3 + x2 + x2 x +1 − − = x4 x3 +2x2 x +1 − − = x4. 18.4 Dissection of a square into three similar parts 621

Exercise 1. Show how the square should be dissected so that it can be reassem- bled into a rectangle.

D C

x

Q P Y

A x X B

2. Let P and Q be points on the sides AB and BC of rectangle ABCD. D C

T3

Q

T1 T2

A P B (a) Show that if the areas of triangles AP D, BP Q and CDQ are equal, then P and Q divide the sides in the golden ratio. (b) If, in addition, DP = P Q, show that the rectangle is golden, AB ∠ i.e., BC = ϕ, and DP Q is a right angle. Chapter 19

Pythagorean triangles

19.1 Primitive Pythagorean triples

A Pythagorean triangle is one whose sidelengths are integers. An easy way to construct Pythagorean triangles is to take two distinct positive integers m > n and form

(a, b, c)=(2mn, m2 n2, m2 + n2). − Then, a2 + b2 = c2. We call such a triple (a, b, c) a Pythagorean triple. The Pythagorean triangle has perimeter p = 2m(m + n) and area A = mn(m2 n2). −

B

2 n + 2 2mn m

A C m2 n2 − A Pythagorean triple (a, b, c) is primitive if a, b, c do not have a common divisor (greater than 1). Every primitive Pythagorean triple is constructed by choosing m, n to be relatively prime and of opposite parity. 702 Pythagorean triangles

19.1.1 Rational angles The (acute) angles of a primitive Pythagorean triangle are called rational angles, since their trigonometric ratios are all rational.

sin cos tan 2mn m2 n2 2mn A m2+n2 m2+−n2 m2 n2 m2 n2 2mn m2−n2 B m2+−n2 m2+n2 2mn−

A B More basic than these is the fact that tan 2 and tan 2 are rational: A n B m n tan = , tan = − . 2 m 2 m + n

This is easily seen from the following diagram showning the incircle of the right triangle, which has r =(m n)n.

− B

n ) n + m ( (m + n)n

) n I r − m ( m r (m − n)n

A C m(m − n) (m − n)n

19.1.2 Some basic properties of primitive Pythagorean triples 1. Exactly one leg is even. 2. Exactly one leg is divisible by 3. 3. Exactly one side is divisible by 5. 4. The area is divisible by 6. 19.1 Primitive Pythagorean triples 703

Appendix: Primitive Pythagorean triples < 1000

m, n a, b, c m, n a, b, c m, n a, b, c m, n a, b, c 2, 1 3, 4, 5 3, 2 5, 12, 13 4, 1 15, 8, 17 4, 3 7, 24, 25 5, 2 21, 20, 29 5, 4 9, 40, 41 6, 1 35, 12, 37 6, 5 11, 60, 61 7, 2 45, 28, 53 7, 4 33, 56, 65 7, 6 13, 84, 85 8, 1 63, 16, 65 8, 3 55, 48, 73 8, 5 39, 80, 89 8, 7 15, 112, 113 9, 2 77, 36, 85 9, 4 65, 72, 97 9, 8 17, 144, 145 10, 1 99, 20, 101 10, 3 91, 60, 109 10, 7 51, 140, 149 10, 9 19, 180, 181 11, 2 117, 44, 125 11, 4 105, 88, 137 11, 6 85, 132, 157 11, 8 57, 176, 185 11, 10 21, 220, 221 12, 1 143, 24, 145 12, 5 119, 120, 169 12, 7 95, 168, 193 12, 11 23, 264, 265 13, 2 165, 52, 173 13, 4 153, 104, 185 13, 6 133, 156, 205 13, 8 105, 208, 233 13, 10 69, 260, 269 13, 12 25, 312, 313 14, 1 195, 28, 197 14, 3 187, 84, 205 14, 5 171, 140, 221 14, 9 115, 252, 277 14, 11 75, 308, 317 14, 13 27, 364, 365 15, 2 221, 60, 229 15, 4 209, 120, 241 15, 8 161, 240, 289 15, 14 29, 420, 421 16, 1 255, 32, 257 16, 3 247, 96, 265 16, 5 231, 160, 281 16, 7 207, 224, 305 16, 9 175, 288, 337 16, 11 135, 352, 377 16, 13 87, 416, 425 16, 15 31, 480, 481 17, 2 285, 68, 293 17, 4 273, 136, 305 17, 6 253, 204, 325 17, 8 225, 272, 353 17, 10 189, 340, 389 17, 12 145, 408, 433 17, 14 93, 476, 485 17, 16 33, 544, 545 18, 1 323, 36, 325 18, 5 299, 180, 349 18, 7 275, 252, 373 18, 11 203, 396, 445 18, 13 155, 468, 493 18, 17 35, 612, 613 19, 2 357, 76, 365 19, 4 345, 152, 377 19, 6 325, 228, 397 19, 8 297, 304, 425 19, 10 261, 380, 461 19, 12 217, 456, 505 19, 14 165, 532, 557 19, 16 105, 608, 617 19, 18 37, 684, 685 20, 1 399, 40, 401 20, 3 391, 120, 409 20, 7 351, 280, 449 20, 9 319, 360, 481 20, 11 279, 440, 521 20, 13 231, 520, 569 20, 17 111, 680, 689 20, 19 39, 760, 761 21, 2 437, 84, 445 21, 4 425, 168, 457 21, 8 377, 336, 505 21, 10 341, 420, 541 21, 16 185, 672, 697 21, 20 41, 840, 841 22, 1 483, 44, 485 22, 3 475, 132, 493 22, 5 459, 220, 509 22, 7 435, 308, 533 22, 9 403, 396, 565 22, 13 315, 572, 653 22, 15 259, 660, 709 22, 17 195, 748, 773 22, 19 123, 836, 845 22, 21 43, 924, 925 23, 2 525, 92, 533 23, 4 513, 184, 545 23, 6 493, 276, 565 23, 8 465, 368, 593 23, 10 429, 460, 629 23, 12 385, 552, 673 23, 14 333, 644, 725 23, 16 273, 736, 785 23, 18 205, 828, 853 23, 20 129, 920, 929 24, 1 575, 48, 577 24, 5 551, 240, 601 24, 7 527, 336, 625 24, 11 455, 528, 697 24, 13 407, 624, 745 24, 17 287, 816, 865 24, 19 215, 912, 937 25, 2 621, 100, 629 25, 4 609, 200, 641 25, 6 589, 300, 661 25, 8 561, 400, 689 25, 12 481, 600, 769 25, 14 429, 700, 821 25, 16 369, 800, 881 25, 18 301, 900, 949 26, 1 675, 52, 677 26, 3 667, 156, 685 26, 5 651, 260, 701 26, 7 627, 364, 725 26, 9 595, 468, 757 26, 11 555, 572, 797 26, 15 451, 780, 901 26, 17 387, 884, 965 27, 2 725, 108, 733 27, 4 713, 216, 745 27, 8 665, 432, 793 27, 10 629, 540, 829 27, 14 533, 756, 925 27, 16 473, 864, 985 28, 1 783, 56, 785 28, 3 775, 168, 793 28, 5 759, 280, 809 28, 9 703, 504, 865 28, 11 663, 616, 905 28, 13 615, 728, 953 29, 2 837, 116, 845 29, 4 825, 232, 857 29, 6 805, 348, 877 29, 8 777, 464, 905 29, 10 741, 580, 941 29, 12 697, 696, 985 30, 1 899, 60, 901 30, 7 851, 420, 949 31, 2 957, 124, 965 31, 4 945, 248, 977 31, 6 925, 372, 997 704 Pythagorean triangles

19.2 A Pythagorean triangle with an inscribed square

How many matches of equal lengths are required to make up the follow- ing configuration?

Suppose the shapeof the right triangleis givenby a primitive Pythagorean triple (a, b, c). The lengthof a side of the square must be a commonmul- tiple of a and b. The least possible value is the product ab. There is one such configuration consisting of (i) two Pythagorean triangles obtained by magnifying (a, b, c) a and b times, (ii) a square of side ab. The total number of matches is

(a + b)(a + b + c)+2ab =(a + b + c)c +4ab.

The smallest one is realized by taking (a, b, c)=(3, 4, 5). It requires 108 matches. How many matches are required in the next smallest configuration? 19.3 When are x2 px q bothfactorable? 705 − ± 19.3 When are x2 px q both factorable? − ± For integers p and q, the quadratic polynomials x2 px+q and x2 px q both factorable (over integers) if and only if p2 4−q and p2 +4q are− both− squares. Thus, p and q are respectively the hypotenuse− and area of a Pythagorean triangle.

p2 +4q =(a + b)2, p2 4q =(b c)2. − −

b a

p p b b − a

b − a q

a

q

a b c = p q x2 − px + q x2 + px − q 3 4 5 6 (x − 2)(x − 3) (x − 1)(x + 6) 5 12 13 30 (x − 3)(x − 10) (x − 2)(x + 15) 8 15 17 60 (x − 5)(x − 12) (x − 3)(x + 20) The roots of x2 px+q are s a and s b, while thoseof x2+px q are s c and s. Here,− s is the semiperimeter− − of the Pythagorean triangle.− − − 19.4 Dissection of a square into Pythagorean triangles

Here is the smallest square which can be dissected into three Pythagorean triangles and one with integer sides and integer area. 255 105

136 289

375 360 424 224

360 706 Pythagorean triangles

Exercise 1. A man has a square field, 60 feet by 60 feet, with other property adjoining the highway. He put up a straight fence in the line of 3 trees, at A, P , Q. If the distance between P and Q is 91 feet, and that from P to C is an exact number of feet, what is this distance?

A 60 B

P 60 91 ? Q

D C 2. Give an example of a primitive Pythagorean triangle in which the hypotenuse is a square. 3. Give an example of a primitive Pythagorean triangle in which the even leg is a square. 4. Find the smallest Pythagorean triangle whose perimeter is a square (number). 5. Find the shortest perimeter common to two different primitive Pythagorean triangles. 6. Show that there are an infinite number of Pythagorean triangles whose hypotenuse is an integer of the form 3333 3. ··· 7. For each natural number n, how many Pythagorean triangles are there such that the area is n times the perimeter? How many of these are primitive? 8. Find the least number of toothpicks (of equal size) needed to form Chapter 20

Integer triangles with a 60◦ or 120◦ angle

20.1 Integer triangles with a 60◦ angle

If triangle ABC has C = 60◦, then

c2 = a2 ab + b2. (20.1) −

Integer triangles with a 60◦ angle therefore correspond to rational points in the first quadrant on the curve

x2 xy + y2 =1. (20.2) − Note that the curve contains the point P = ( 1, 1). By passing a line of rational slope t through P to intersect the− curve− again, we obtain a parametrization of the rational points. Now, such a line has equation y = 1+ t(x + 1). Solving this simultaneously with (20.2) we obtain (x, y)=(− 1, 1) = P , and − − 2t 1 t(2 t) (x, y)= − , − , t2 t +1 t2 t +1  − −  1 which is in the first quadrant if 2 < t 2. By symmetry, we may 1 ≤ simply take 2 < t 1 to avoid repetition. q ≤ Putting t = p for relatively prime integers p, q, and clearing denomi- 708 Integertriangleswitha 60◦ or 120◦ angle

t

P nators, we obtain

a =p(2q p), − b =q(2p q), − c =p2 pq + q2, − with p < q p. Dividing by gcd(a, b) = gcd(p + q, 3), we obtain the 2 ≤ primitive integer triangles with a 60◦ angle:

p q (a,b,c) 1 1 (1, 1, 1) 3 2 (3, 8, 7) 4 3 (8, 15, 13) 5 3 (5, 21, 19) 5 4 (5, 8, 7) 6 5 (24, 35, 31) 7 4 (7, 40, 37) 7 5 (7, 15, 13) 7 6 (35, 48, 43) 8 5 (16, 55, 49) 8 7 (16, 21, 19) 9 5 (9, 65, 61) 9 7 (45, 77, 67) 9 8 (63, 80, 73) 10 7 (40, 91, 79) 10 9 (80, 99, 91) 20.1 Integer triangles with a 60◦ angle 709

Exercise 1. A standard calculus exercise asks to cut equal squares of dimension x from the four corners of a rectangle of length a and breadth b so that the box obtained by folding along the creases has a greatest capacity.

a

x

b The answer to this problem is given by

a + b √a2 ab + b2 x = − − . 6 How should one choose relatively prime integers a and b so that the resulting x is an integer? 1 For example, when a = 5, b = 8, x =1. Another example is a = 16, b = 21 with x =3.

2. Prove that there is no integer triangle with a 60◦ angle whose adja- cent sides are consecutive integers.

Proof. The 60◦ angle being strictly between the other two angles, its opposite side has length strictly between two consecutive inte- gers. It cannot be an integer.

3. Find all integer triangles with a 60◦ angle and two sides consecutive integers.

1Answer: a, b, c, with gcd(p + q, 6) = 3. 710 Integertriangleswitha 60◦ or 120◦ angle

20.2 Integer triangles with a 120◦ angle

If triangle ABC has C = 120◦, then

c2 = a2 + ab + b2. (20.3)

Integer triangles with a 120◦ angle therefore correspond to rational points in the first quadrant on the curve

x2 + xy + y2 =1. (20.4)

t

Q

Note that the curve contains the point Q = ( 1, 0). By passing a line of rational slope t through P to intersect the curve− again, we obtain a parametrization of the rational points. Now, such a line has equation y = t(x+1). Solving this simultaneously with (20.2) we obtain (x, y)= ( 1, 0) = Q, and − 1 t2 t(2 + t) Q(t)= − , , t2 + t +1 t2 + t +1   which is in the first quadrant if 0

a =p2 q2, − b =q(2p + q), c =p2 + pq + q2, with 0

p q (a,b,c) 3 1 (8, 7, 13) 4 1 (5, 3, 7) 5 1 (24, 11, 31) 6 1 (35, 13, 43) 7 1 (16, 5, 19) 7 2 (45, 32, 67) 8 1 (63, 17, 73) 9 1 (80, 19, 91) 9 2 (77, 40, 103) 10 1 (33, 7, 37) 10 3 (91, 69, 139) 712 Integertriangleswitha 60◦ or 120◦ angle

Exercise

1. An integer triangle has a 120◦ angle. Show that the two longer sides cannot differ by 1. Solution. If the sides are a, b, b +1, then (b +1)2 = a2 + ab + b2. a2 1 From this, b = 2 −a . For no positive integer a is b positive. There is no such triangle.−

2. Give an example of an integer triangle with 120◦ whose adjacent sides are consecutive integers.

3. In triangle ABC, α = 120◦. AX is the bisector of angle A. Show 1 1 1 that t = b + c .

A

c b t

B X C

4. In the diagram below, ABX, BCY , and CDZ are equilateral tri- ∠ 1 1 1 2 angles. Suppose XYZ = 120◦. Show that b = a + c .

Z

X

Y

A a B b C c D

2Hint: Extend ZY to intersect AB at T . Show that T C = a. Chapter 21

Triangles with centroid on incircle

A

Y

G′

I G

B X D C

Suppose the centroid G of triangle ABC lies on the incircle. The median AD intersects the incircle at another point G′. If AG′ = k AD, then by the intersecting chords theorem, we have · 2 (i) AY = AG′ AG, and 2 · (ii) DX = DG DG′. 2 · 1 Clearly, AG = 3 ma, DG = 3 ma. If AG′ = k ma, then DG′ = (1 k)ma. · 1 − a a 1 1 Since AY = 2 (b+c a) and DX = 2 XB = 2 2 (c+a b)= 2 (b c), these lead to − − − − −

1 2 (b + c a)2 = m k m , 4 − 3 a · · a 1 1 (b c)2 = m (1 k)m . 4 − 3 a · − a 714 Triangles with centroid on incircle

Eliminating k, we have

2 4m2 = 3((b + c a)2 + 2(b c)2). · a − − 2 2 2 2 From Apollonius’ theorem, 4ma = 2b +2c a . Simplifying, we obtain − 5(a2 + b2 + c2) 6(bc + ca + ab)=0. −

Theorem 21.1. The centroid of triangle (a, b, c) lies on its incircle if and only if 5(a2 + b2 + c2) 6(bc + ca + ab)=0. − 21.1 Construction

Let A0B0C0 be an equilateral triangle with center I0, and C the image 1 of the incircle under the homothety h I0, 2 . For every point P on the circle C, let X, Y , Z be the pedals on the sides of A0B0C0. The triangle with sides PX, PY , PZ has its centroid on its incircle. 21.2Integertriangleswithcentroidontheincircle 715

21.2 Integer triangles with centroid on the incircle

a b By putting x = c and y = c , we have

5x2 6xy +5y2 6x 6y +5=0. − − − 3 3 √ 1 √ This is an ellipse with center 2 , 2 and semiaxes 2 and 2 2. It contains the rational point Q(1, 2). The line through (1, 2) with slope 2+t 2+t  2 t has equation y 2= 2 t (x 1), or (t+2)x+(t 2)y (3t 2)=0. − − − − − − −

Q

t

It intersects the conic at

1 2t +2t2 2 2t + t2 − , − . 1+ t2 1+ t2  

q Writing t = p for relatively prime integers p and q, we have

a = p2 2pq +2q2, − b = 2p2 2pq + q2, − c = p2 + q2.

Here are some examples, with relatively prime integers p and q satis- fying q

p q a b c 2 1 2 5 5 3 2 5 10 13 4 3 10 17 25 5 3 13 29 34 5 4 17 26 41 6 5 26 37 61 7 4 25 58 65 7 5 29 53 74 7 6 37 50 85 8 5 34 73 89 8 7 50 65 113 9 5 41 97 106 9 7 53 85 130 9 8 65 82 145 10 7 58 109 149 10 9 82 101 181

Exercise 1. Find the (shape of the) triangle which has a median trisected by the incircle. Chapter 22

The area of a triangle

22.1 Heron’s formula for the area of a triangle

Theorem 22.1. The area of a triangle of sidelengths a, b, c is given by

= s(s a)(s b)(s c), △ − − − 1 p where s = 2 (a + b + c).

B

Ia

I ra

r

A C Y Y ′ s − b s − c s − a Proof. Consider the incircle and the excircle on the opposite side of A. From the similarity of triangles AIZ and AI′Z′, r s a = − . ra s

From the similarity of triangles CIY and I′CY ′, r r =(s b)(s c). · a − − 802 The area of a triangle

From these, (s a)(s b)(s c) r = − − − , r s and the area of the triangle is

= rs = s(s a)(s b)(s c). △ − − − p

Exercise 1. Prove that 1 2 = (2a2b2 +2b2c2 +2c2a2 a4 b4 c4). △ 16 − − − 22.2 Heron triangles 803

22.2 Heron triangles

A Heron triangle is an integer triangle whose area is also an integer.

22.2.1 The perimeter of a Heron triangle is even Proposition 22.2. The semiperimeter of a Heron triangle is an integer. Proof. It is enough to consider primitive Heron triangles, those whose sides are relatively prime. Note that modulo 16, each of a4, b4, c4 is congruent to 0 or 1, according as the number is even or odd. To render in (??) the sum 2a2b2 +2b2c2 +2c2a2 a4 b4 c4 0 modulo 16, exactly two of a, b, c must be odd. It− follows− that− the≡ perimeter of a Heron triangle must be an even number.

22.2.2 The area of a Heron triangle is divisible by 6 Proposition 22.3. The area of a Heron triangle is a multiple of 6. Proof. Since a, b, c are not all odd nor all even, and s is an integer, at least one of s a, s b, s c is even. This means that is even. We claim that− at least− one of −s, s a, s b, s c must be△ a multiple of 3. If not, then modulo 3, these− numbers− are−+1 or 1. Since s = (s a)+(s b)+(s c), modulo 3, this must be either 1 −1+1+( 1) or 1− 1+(− 1)+( −1). In each case the product s(s a≡)(s b)(s −c) −1≡ (mod 3)− cannot− be a square. This justifies the− claim that− one− of ≡s, s− a, s b, s c, hence , must be a multiple of 3. − − − △ Exercise 1. Prove that if a triangle with integer sides has its centroid on the incircle, the area cannot be an integer. 804 The area of a triangle

22.2.3 Heron triangles with sides < 100

(a, b, c, ) (a, b, c, ) (a, b, c, ) (a, b, c, ) (a, b, c, ) △ △ △ △ △ (3, 4, 5, 6) (5, 5, 6, 12) (5, 5, 8, 12) (5, 12, 13, 30) (10, 13, 13, 60) (4, 13, 15, 24) (13, 14, 15, 84) (9, 10, 17, 36) (8, 15, 17, 60) (16, 17, 17, 120) (11, 13, 20, 66) (7, 15, 20, 42) (10, 17, 21, 84) (13, 20, 21, 126) (13, 13, 24, 60) (12, 17, 25, 90) (7, 24, 25, 84) (14, 25, 25, 168) (3, 25, 26, 36) (17, 25, 26, 204) (17, 25, 28, 210) (20, 21, 29, 210) (6, 25, 29, 60) (17, 17, 30, 120) (11, 25, 30, 132) (5, 29, 30, 72) (8, 29, 35, 84) (15, 34, 35, 252) (25, 29, 36, 360) (19, 20, 37, 114) (15, 26, 37, 156) (13, 30, 37, 180) (12, 35, 37, 210) (24, 37, 37, 420) (16, 25, 39, 120) (17, 28, 39, 210) (25, 34, 39, 420) (10, 35, 39, 168) (29, 29, 40, 420) (13, 37, 40, 240) (25, 39, 40, 468) (15, 28, 41, 126) (9, 40, 41, 180) (17, 40, 41, 336) (18, 41, 41, 360) (29, 29, 42, 420) (15, 37, 44, 264) (17, 39, 44, 330) (13, 40, 45, 252) (25, 25, 48, 168) (29, 35, 48, 504) (21, 41, 50, 420) (39, 41, 50, 780) (26, 35, 51, 420) (20, 37, 51, 306) (25, 38, 51, 456) (13, 40, 51, 156) (27, 29, 52, 270) (25, 33, 52, 330) (37, 39, 52, 720) (15, 41, 52, 234) (5, 51, 52, 126) (25, 51, 52, 624) (24, 35, 53, 336) (28, 45, 53, 630) (4, 51, 53, 90) (51, 52, 53, 1170) (26, 51, 55, 660) (20, 53, 55, 528) (25, 39, 56, 420) (53, 53, 56, 1260) (33, 41, 58, 660) (41, 51, 58, 1020) (17, 55, 60, 462) (15, 52, 61, 336) (11, 60, 61, 330) (22, 61, 61, 660) (25, 52, 63, 630) (33, 34, 65, 264) (20, 51, 65, 408) (12, 55, 65, 198) (33, 56, 65, 924) (14, 61, 65, 420) (36, 61, 65, 1080) (16, 63, 65, 504) (32, 65, 65, 1008) (35, 53, 66, 924) (65, 65, 66, 1848) (21, 61, 68, 630) (43, 61, 68, 1290) (7, 65, 68, 210) (29, 65, 68, 936) (57, 65, 68, 1710) (29, 52, 69, 690) (37, 37, 70, 420) (9, 65, 70, 252) (41, 50, 73, 984) (26, 51, 73, 420) (35, 52, 73, 840) (48, 55, 73, 1320) (19, 60, 73, 456) (50, 69, 73, 1656) (25, 51, 74, 300) (25, 63, 74, 756) (35, 44, 75, 462) (29, 52, 75, 546) (32, 53, 75, 720) (34, 61, 75, 1020) (56, 61, 75, 1680) (13, 68, 75, 390) (52, 73, 75, 1800) (40, 51, 77, 924) (25, 74, 77, 924) (68, 75, 77, 2310) (41, 41, 80, 360) (17, 65, 80, 288) (9, 73, 80, 216) (39, 55, 82, 924) (35, 65, 82, 1092) (33, 58, 85, 660) (29, 60, 85, 522) (39, 62, 85, 1116) (41, 66, 85, 1320) (36, 77, 85, 1386) (13, 84, 85, 546) (41, 84, 85, 1680) (26, 85, 85, 1092) (72, 85, 85, 2772) (34, 55, 87, 396) (52, 61, 87, 1560) (38, 65, 87, 1140) (44, 65, 87, 1386) (31, 68, 87, 930) (61, 74, 87, 2220) (65, 76, 87, 2394) (53, 75, 88, 1980) (65, 87, 88, 2640) (41, 50, 89, 420) (28, 65, 89, 546) (39, 80, 89, 1560) (21, 82, 89, 840) (57, 82, 89, 2280) (78, 89, 89, 3120) (53, 53, 90, 1260) (17, 89, 90, 756) (37, 72, 91, 1260) (60, 73, 91, 2184) (26, 75, 91, 840) (22, 85, 91, 924) (48, 85, 91, 2016) (29, 75, 92, 966) (39, 85, 92, 1656) (34, 65, 93, 744) (39, 58, 95, 456) (41, 60, 95, 798) (68, 87, 95, 2850) (73, 73, 96, 2640) (37, 91, 96, 1680) (51, 52, 97, 840) (65, 72, 97, 2340) (26, 73, 97, 420) (44, 75, 97, 1584) (35, 78, 97, 1260) (75, 86, 97, 3096) (11, 90, 97, 396) (78, 95, 97, 3420) 22.3 Heron triangles with sides in arithmetic progression 805

22.3 Heron triangles with sides in arithmetic progres- sion

We write s a = u, s b = v, and s c = w. − − − a, b, c are in A.P. if and only if u, v, w are in A.P. Let u = v d and w = v + d. Then we require 3v2(v d)(v + d) to be a square.− This means v2 d2 =3t2 for some integer−t. − Proposition 22.4. Let d be a squarefree integer. If gcd(x, y, z)=1 and x2+dy2 = z2, then there are integers m and n satisfying gcd(dm, n)=1 such that (i)

x = m2 dn2, y =2mn, z = m2 + dn2 − if m and dn are of different parity, or (ii) m2 dn2 m2 + n2 x = − , y = mn, z = , 2 2 if m and dn are both odd.

For the equation v2 = d2 +3t2, we take v = m2 +3n2, d = m2 3n2, and obtain u =6n2, v = m2 +3n2, w =2m2, leading to −

a = 3(m2 + n2), b = 2(m2 +3n2), c = m2 +9n2,

for m, n of different parity and gcd(m, 3n)=1.

m n a d a a + d area − 12 15 14 13 84 1 4 51 38 25 456 2 1 15 26 37 156 2 5 87 74 61 2220 3 2 39 62 85 1116 3 4 75 86 97 3096 4 1 51 98 145 1176 4 5 123 146 169 8760 5 2 87 158 229 4740 5 4 123 182 241 10920

If m and n are both odd, we obtain 806 The area of a triangle

m n a d a a + d area − 113 4 5 6 1 5 39 28 17 210 3 1 15 28 41 126 3 5 51 52 53 1170 5 1 39 76 113 570 22.4 Indecomposable Heron triangles 807

22.4 Indecomposable Heron triangles

A Heron triangle can be constructed by joining two integer right trian- gles along a common leg. Beginning with two primitive Pythagorean triangles, by suitably magnifying by integer factors, we make two inte- ger right triangles with a common leg. Joining them along the common leg, we obtain a Heron triangle. For example,

(13, 14, 15;84) = (12, 5, 13; 30) (12, 9, 15; 54). ∪

13 15 15 12 12 13

5 5 9 4

We may also excise (5, 12, 13) from (9, 12, 15), yielding

(13, 4, 15;24) = (12, 9, 15; 54) (12, 5, 13; 30). \

Does every Heron triangle arise in this way? We say that a Heron tri- angle is decomposable if it can be obtained by joining two Pythagorean triangles along a common side, or by excising a Pythagorean triangle from a larger one. Clearly, a Heron triangle is decomposable if and only if it has an integer height (which is not a side of the triangle). The first example of an indecomposable Heron triangle was obtained by Fitch Cheney. The Heron triangle (25, 34, 39; 420) is not decomposable because it does not have an integer height. Its heights are 840 168 840 420 840 280 = , = , = , 25 5 34 17 39 13 none an integer. 808 The area of a triangle

Exercise 1. Find all shapes of Heron triangles that can be obtained by joining integer multiples of (3, 4, 5) and (5, 12, 13). 2. Find two indecomposable Heron triangles each having its longest sides two consecutive integers, and the shortest side not more than 10. 3. It is knownthat the smallest acute Heron triangle also has its longest sides two consecutive integers. Identify this triangle. 22.5 Heron triangle as lattice triangle 809

22.5 Heron triangle as lattice triangle

A Heron triangle is decomposable if it can be decomposable into (the union or difference of) two Pythagorean triangles. It is decomposable if one or more heights are integers. A decomposable Heron triangle can clearly be realized as a lattice triangle. It turns out that this is also true of the indecomposable one. Theorem 22.5. Every Heron triangle can be realized as a lattice trian- gle. Example 22.1. The indecomposable Heron triangle (25, 34, 39; 420) as a lattice triangle

(15, 36)

25

39 (30, 16)

34

(0, 0)

Exercise 1. The triangle (5, 29, 30; 72) is the smallest Heron triangle indecom- posable into two Pythagorean triangles. Realize it as a lattice trian- gle, with one vertex at the origin. 2. The triangle (15, 34, 35; 252) is the smallest acute Heron triangle indecomposable into two Pythagorean triangles. Realize it as a lat- tice triangle, with one vertex at the origin. 810 The area of a triangle Chapter 23

Heron triangles

23.1 Heron triangles with area equal to perimeter

Suppose the area of an integer triangle (a, b, c) is numerically equal to its perimeter. Write w = s a, v = s b, u = s c. Note that s = u + v + w. We require s(−s a)(s b)(−s c)=4s−2. Equivalently, uvw = 4(u + v + w). There are− at least− two ways− of rewriting this. 1 1 1 1 (i) uv + uw + vw = 4 ; 4(v+w) (ii) u = vw 4 . We may− assume w v u. From (i) w2 vw 12≤and≤ we must have w 3. If w =3, then≤ v =3≤ or 4. In neither case can≤u be an integer according to (ii). If w =2, then uv = 2(2+ u + v), (u 2)(v 2)=8, (v 2)2 8; v =3 or 4. Therefore, (u,v,w) = (10, 3,−2) or (6−, 4, 2). − ≤ If w = 1, then v 5 by (ii). Also, uv = 4(1+ u + v), (u 4)(v 4) = 20, (v 4)2 ≥ 20; v 8. Therefore, v = 5, 6, 7 or−8. Since− (v,w)=(7, 1)−does≤ not give an≤ integer u, we only have (u,v,w) = (24, 5, 1), (14, 6, 1), (9, 8, 1).

Summary There are only five integer triangles with area equal to perimeter:

(u,v,w) (1, 5, 24) (1, 6, 14) (1, 8, 9) (2, 3, 10) (2, 4, 6) (a, b, c) (6, 25, 29) (7, 15, 20) (9, 10, 17) (5, 12, 13) (6, 8, 10) 812 Heron triangles

23.2 Heron triangles with integer inradii

Suppose an integer triangle (a, b, c) has inradius n, an integer. Let w = s a, v = s b, u = s c. We have − − − uvw = n2. u + v + w

n2(u+v) If we assume u v w, then (i) w = uv n2 , ≤ ≤ − (ii) n u √3n, and ≤ ≤ √ 2 2 (iii) v n(n+ n +u ) . ≤ u Therefore, the number T (n) of integer triangles with inradius n is finite. Here are the beginning values of T (n):

n 123 4 5 6 7 8 910 T (n) 1 5 13 18 15 45 24 45 51 52 ··· ···

Exercise 1. Find all Heron triangles with inradius 1. 2. Given an integer n, how many Pythagorean triangles are there with inradius n? 1 2 Answer. 2 d(2n ). 3 3. Find all Heron triangles with inradius 2 . 23.3 Division of a triangle into two subtriangles with equal incircles 813

23.3 Division of a triangle into two subtriangles with equal incircles

Given a triangle ABC, to locate a point P on the side BC so that the incircles of triangles ABP and ACP have equal radii.

A

b

b b

b b

b

b b B P C

Suppose BP : PC = k : 1 k, and denote the length of AP by x. By Stewart’s Theorem, −

x2 = kb2 + (1 k)c2 k(1 k)a2. − − − Equating the inradii of the triangles ABP and ACP , we have 2k 2(1 k) △ = − △ . c + x + ka b + x + (1 k)a − This latter equation can be rewritten as c + x + ka b + x + (1 k)a = − , (23.1) k 1 k − or c + x b + x = , (23.2) k 1 k − from which x + c k = . 2x + b + c

Now substitution into (1) gives x2(2x + b + c)2 = (2x + b + c)[(x + c)b2 +(x + b)c2] (x + b)(x + c)a2. − 814 Heron triangles

Rearranging, we have (x + b)(x + c)a2 = (2x + b + c)[(x + c)b2 +(x + b)c2 x2[(x + b)+(x + c)]] = (2x + b + c)[(x + b)(c2 x2)+(x−+ c)(b2 x2)] = (2x + b + c)(x + b)(x +−c)[(c x)+(b x−)] = (2x + b + c)(x + b)(x + c)[(b +− c) 2x]− = (x + b)(x + c)[(b + c)2 4x2]. − − From this, 1 1 x2 = ((b + c)2 a2)= (b + c + a)(b + c a)= s(s a). 4 − 4 − −

Let the excircle on the side BC touch AC at Y . Construct a semicir- cle on AY as diameter, and the perpendicular from the incenter I to AC to intersect this semicircle at Q. P is the point on BC such that AP has the same length as AQ. Z

b Q

A b

b

b I b b

b b b b b C B P

b Y

b

K. W. Lau (Solution to Problem 1097, b Crux Math., 13 (1987) 135– 136) has proved an interesting formula which leads to a simple construc- tion of the point P . If the angle between the median AD and the angle bisector AX is θ, then −−→AD −−→AX = m w cos θ = s(s a). · a · a · − 23.3 Division of a triangle into two subtriangles with equal incircles 815

Proof. 1 −−→AD = −→AB + −−→BC, 2 c −−→AX = −→AB + −−→BC; b + c 1 c c −−→AD −−→AX = AB 2 + + −→AB −−→BC + BC 2 · | | 2 b + c · 2(b + c)| |   1 c b2 a2 c2 ca2 = c2 + + − − + 2 b + c · 2 2(b + c)   4c2(b + c)+(b +3c)(b2 a2 c2)+2ca2 = − − 4(b + c) (a + b + c)(b + c a) = − 4 = s(s a). −

b A

b

b Y

b

b b b b b B X P D C

This means if the perpendicular from X to AD is extended to inter- sect the circle with diameter AD at a point Y , then AY = s(s a). Now, the circle A(Y ) intersects the side BC at two points, one of which− is the required point P . p Here are two examples of Heron triangles with subdivision into two Heron triangles with equal inradii. (1) (a, b, c) = (15, 8, 17); CP = 6, P B = 9. AP = 10. The two small triangles have the same inradius 2. 816 Heron triangles

A

C P B (2) (a, b, c) = (51, 20, 65); BP = 33, CP = 18. AP = 34. The two small triangles have the same inradius 4.

A

B P C 23.4 Inradii in arithmetic progression 817

23.4 Inradii in arithmetic progression

(1) Triangle ABC below has sides 13, 14, 15. The three inradii are 2, 3, 4. C

4 3 2 B A D (2) The following four inradii are in arithmetic progression. What is the shape of the large triangle? 818 Heron triangles

23.5 Heron triangles with integer medians

It is an unsolved problem to find Heron triangles with integer medians. The triangle (a, b, c) = (136, 170, 174) has three integer medians. But it is not a Heron triangle. It has an area . Buchholz and Rathbun have found an infinite set of Heron triangles with two integer medians. Here is the first one. Let a = 52, b = 102, c = 146. This is a Heron triangle with area and two integer medians mb = and mc = . The third one, however, has irrational length: ma = . 23.6 Heron triangles with square areas 819

23.6 Heron triangles with square areas

Fermat has shown that there does not exist a Pythagorean triangle whose area is a perfect square. However, the triangle with sides 9, 10, 17 has area 36. In fact, there infinitely many primitive Heron triangles whose ar- eas are perfect squares. Here is one family constructed by C. R. Maderer. 1 For each positive integer k, define

4 2 ak = 20k +4k +1, 6 4 2 bk = 8k 4k 2k +1, 6 − 4 − 2 ck = 8k +8k + 10k .

Here, ak, bk

A4 + B4 + C4 = D4, with gcd(A, B, C, D)=1. The triangle with a = B4 + C4, b = C4 + A4, c = A4 + B4

is a Heron triangle with area (ABCD)2. The first example which Elkies constructed is

A =2682440, B =15365639, C =18796760, D =20615673.

1American Mathematical Monthly, 98 (1991). 2On A4 + B4 + C4 = D4, Math. Comp., 51 (1988) 825 – 835. 820 Heron triangles Chapter 24

Triangles with sides and one altitude in A.P.

24.1 Newton’s solution

Problem 29 of Isaac Newton’s Lectures on Algebra ([Whiteside, pp.234 – 237]) studies triangles whose sides and one altitude are in arithmetic progression. Newton considered a triangle ABC with an altitude DC. Clearly, DC is shorter than AC and BC. Setting AC = a, BC = x, DC = 2x a, and AB =2a x, he obtained − − 16x4 80ax3 + 144a2x2 10a3x + 25a4 =0. ( ) − − † “Divide this equation by 2x a and there will result 8x3 36ax2 + 54a2x 25a3 =0”. Newton did− not solve this equation nor− did he give any numerical− example. Actually, ( ) can be rewritten as † (2x 3a)3 +2a3 =0, − a √3 so that x = 2 (3 2), the other two roots being complex. By taking a =2, we may assume− the sides of the triangles to be , , , and the altitude on the longest side to be . The angles of the triangles are , , . 822 Triangles with sides and one altitude in A.P.

24.2 The general case

Recalling the Heron triangle with sides 13, 14, 15 with altitude 12 on the side 14, we realize that these lengths can be in A.P. in some other order. Note that the altitude in question is either the first or the second terms of the A.P. (in increasing order). Assuming unit length for this altitude, and x> 0 for the common difference, we have either 1. the three sides of the triangles are 1+ x, 1+2x, and 1+3x, or 2. the sides of the triangles are 1 x, 1+x, and 1+2x, and the altitude on the shortest side is 1. − In (1), the area of the triangle, by the Heron formula, is given by 3 2 = (1+2x)2(1+4x). △ 16 1 On the other hand, = 2 1 (1 + kx) for k = 1, 2, 3. These lead to the equations △ · ·

for k =1: 48x3 + 56x2 + 16x 1=0, • − for k =2: 48x3 + 44x2 +8x 1=0, • − for k =3: 48x3 + 24x 1=0. • − The case k =3 has been dealt with in Newton’s solution. For k = 2, the polynomial factors as so that we have x = . This leads to the Heron triangle with sides 13, 14, 15, and altitude 12 on the side 14the triangles are , , . For k = 1, it is easy to see, using elementary calculus, that the poly- nomial 48x3 +56x2 +16x 1 has exactly one real root, which is positive. This gives a similarity− class of triangle with the three sides and the altitude on the shortest side in A.P. More detailed calculation shows that the angles of such triangles are , , . Now we consider (2), when the altitude in question is the second term of the A.P. Instead of constructing an equation in x, we seek one such triangle with sides 15, 17+2z, 18+3z, and the altitude 16 + z on the 24.2 The general case 823 shortest side. By considering the area of the triangle in two different ways, we obtain the cubic equation

z3 120z +16=0. ( ) − ∗ This can be solved by writing z = 4√10 sin θ for an angle θ. Using the trigonometric identity sin 3θ = 3 sin θ 4 sin3 θ, we reduce this to − sin 3θ = so that the positive roots of ( ) are the two numbers ∗ z = , . We obtain two similarity classes of triangles, respectively with angles , , , and , , . There are altogether five similarity classes of triangles whose three sides and one altitude, in some order, are in arithmetic progression. Chapter 25

The Pell Equation

25.1 The equation x2 dy2 =1 − Let d be a fixed integer. We consider the Pell equation x2 dy2 = 1. Clearly, if d is negative or is a (positive) square integer, then the− equation has only finitely many solutions. Theorem 25.1. Let d be a nonsquare, positive integer. The totality of positive solutions of the Pell equation x2 dy2 = 1 form an infinite − sequence (xn,yn) defined recursively by

xn+1 = axn + dbyn, yn+1 = bxn + ayn; x1 = a, y1 = b, where (x1,y1)=(a, b) is the fundamental solution, with a, b positive and b smallest possible.

Examples 1. The fundamental solution of the Pell equation x2 2y2 = 1 is (3,2). This generates an infinite sequence of nonnegative− solutions (xn,yn) defined by

xn+1 =3xn +4yn, yn+1 =2xn +3yn; x0 =1, y0 =0. The beginning terms are

n 12345 6 7 8 9 10 ... xn 3 17 99 577 3363 19601 114243 665857 3880899 22619537 ... yn 2 12 70 408 2378 13860 80782 470832 2744210 15994428 ... 902 The Pell Equation

2. Fundamental solution (a, b) of x2 dy2 =1 for d< 100: −

dab dab da b 232 321 59 4 652 783 83 1 10 19 6 11 10 3 12 7 2 13 649 180 14 15 4 15 4 1 17 33 8 18 17 4 19 170 39 20 9 2 21 55 12 22 197 42 23 24 5 24 5 1 26 51 10 27 26 5 28 127 24 29 9801 1820 30 11 2 31 1520 273 32 17 3 33 23 4 34 35 6 35 6 1 37 73 12 38 37 6 39 25 4 40 19 3 41 2049 320 42 13 2 43 3482 531 44 199 30 45 161 24 46 24335 3588 47 48 7 48 7 1 50 99 14 51 50 7 52 649 90 53 66249 9100 54 485 66 55 89 12 56 15 2 57 151 20 58 19603 2574 59 530 69 60 31 4 61 1766319049 226153980 62 63 8 63 8 1 65 129 16 66 65 8 67 48842 5967 68 33 4 69 7775 936 70 251 30 71 3480 413 72 17 2 73 2281249 267000 74 3699 430 75 26 3 76 57799 6630 77 351 40 78 53 6 79 80 9 80 9 1 82 163 18 83 82 9 84 55 6 85 285769 30996 86 10405 1122 87 28 3 88 197 21 89 500001 53000 90 19 2 91 1574 165 92 1151 120 93 12151 1260 94 2143295 221064 95 39 4 96 49 5 97 62809633 6377352 98 99 10 99 10 1

3. Pell’s equations whose fundamental solutions are very large:

d a b 421 3879474045914926879468217167061449 189073995951839020880499780706260 541 3707453360023867028800645599667005001 159395869721270110077187138775196900 601 38902815462492318420311478049 1586878942101888360258625080 613 464018873584078278910994299849 18741545784831997880308784340 661 16421658242965910275055840472270471049 638728478116949861246791167518480580 673 4765506835465395993032041249 183696788896587421699032600 769 535781868388881310859702308423201 19320788325040337217824455505160 919 4481603010937119451551263720 147834442396536759781499589 937 480644425002415999597113107233 15701968936415353889062192632 949 609622436806639069525576201 19789181711517243032971740 991 379516400906811930638014896080 12055735790331359447442538767

4. The equation x2 4729494y2 = 1 arises from the famous Cattle problem of Archimedes,− and has smallest positive solution

x = 109931986732829734979866232821433543901088049, y = 50549485234315033074477819735540408986340. 25.2 The equation x2 dy2 = 1 903 − −

Exercise 1. Solve the Pell equations (a) x2 +3y2 = 1; (b) x2 4y2 = 1 for integer solutions. 1 −

2. Find the 10 smallest nonnegative solutions of the Pell equation x2 3y2 =1. 2 −

3. If (a, b) is the fundamental solution of the Pell equation x2 dy2 = − 1, generating the infinite sequence of nonnegative solutions (x0,y0)= (1, 0), (x1,y1)=(a, b), (x2,y2),..., (xn,yn), ...,then

xn+1 =2axn xn 1; yn+1 =2ayn yn 1. − − − −

25.2 The equation x2 dy2 = 1 − − The negative Pell’s equation

x2 dy2 = 1, − − may or may not have solutions. 3 Here are the smallest positive solution (a, b) of x2 dy2 = 1 for the first 24 values of d: − −

dab dab dab 211 521 1031 13 18 5 17 4 1 26 5 1 29 70 13 37 6 1 41 32 5 50 7 1 53 182 25 58 99 13 61 29718 3805 65 8 1 73 1068 125 74 43 5 82 9 1 85 378 41 89 500 53 97 5604 569 101 10 1

25.3 The equation x2 dy2 = c − Theorem 25.2. Let c> 1 be a positive integer.

1(a). (x,y) = ( 1, 0); (b). (x,y) = ( 1, 0). 2 ± ±

n 12345 6 7 8 9 10 11 ... xn 2 7 26 97 362 1351 5042 18817 70226 262087 978122 ... yn 1 4 15 56 209 780 2911 10864 40545 151316 564719 ...

3This depends on the parity of the length of the period of expansion of √d. 904 The Pell Equation

(a) If the equation x2 dy2 = c is solvable, it must have a fundamen- tal solution (u, v) in the− range

1 b 0 < u (a + 1)c, 0 v √c. | | ≤ r2 ≤ ≤ 2(a + 1) ·

Every solution appears in a doubly infinite sequencep (xn,yn)

un+1 = aun + dbvn, vn+1 = bun + avn, u1 = u, v1 = v, for some (u, v) in the range above. (b) Same conclusion for the equation x2 dy2 = c, except that it must have a solution (u, v) in the range − −

1 b 0 u (a 1)c, 0 < v √c. ≤| | ≤ 2 − ≤ 2(a 1) · r − Example 25.1. The fundamental solution of xp2 8y2 = 1 is (a, b) = (3, 1). − Consider the equation x2 8y2 = 9. We need only search for solu- tions (u, v) satisfying 0 v − 1 3= 3 . With v =0, we have ≤ ≤ √2(3+1) · 2√2 u = 3. x2± 8y2 = 7. There are two infinite sequences of positive solutions: − −

(x, y)=( 1, 1), (5, 2), (31, 11), (181, 64), (1055, 373), (6149, 2174), (35839, 12671),... − and (x, y)=(1, 1), (11, 4), (65, 23), (379, 134), (2209, 781), (12875, 4552),....

Example 25.2. Consider the equation x2 23y2 =4 11 23. It is easy to see that x and y must be both even, and− 23 divides ·x. With· x = 46h, y =2k, we have 23h2 k2 = 11, or k2 23h2 = 11. The fundamental solution of x2 23y2−= 1 being (a, b)− = (24, 5)−, we need only find y in the range 1− h 2 It is now easy to see that only h = 2 gives ≤ ≤ k = 9. From this we obtain (x1,y1) = (92, 18). The other solutions are generated recursively by

xn+1 = 24xn + 115yn, yn+1 =5xn + 24yn, x1 = 92, y1 = 18. 25.3 The equation x2 dy2 = c 905 −

Here are the first 5 solutions. n 123 4 5 ... xn 92 4278 205252 9847818 472490012 ... yn 18 892 42798 2053412 98520978 ··· 906 The Pell Equation Chapter 26

Figurate numbers

26.1 Which triangular numbers are squares ?

The triangular numbers are the 1 T =1+2+3+ + m = m(m + 1). m ··· 2 The first few of these are 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... .

2 Suppose the Tm is also a square, i.e., Tm = n for 1 2 2 2 some integer n. 2 m(m +1) = n , (2m + 1) =8n +1. We make use of the fundamental solution of the Pell equation x2 8y2 = 1, namely, (3, 1) to generate the solutions: −

2m +1 3 8 2m +1 k+1 = k , nk 1 3 nk  +1      or m 3m +4n +1 k+1 = k k . nk 2mk +3nk +1  +1    908 Figurate numbers

Here are some beginning values: k 0123 4 5 . . . mk 1 8 49 288 1681 9800 . . . nk 1 6 35 204 1189 6930 . . .

These yield the square triangular numbers

2 2 2 2 T1 =1 , T8 =6 , T49 = 35 , T288 = 204 , ...

Exercise 1. Find all positive integers m > n satisfying 1+2+ +(n 1)=(n +1)+(n +2)+ + m. ··· − ···

2 Solution. Tn 1 = Tm Tn = Tm = Tn 1 + Tn = n . − − ⇒ − 26.2 Pentagonal numbers 909

26.2 Pentagonal numbers

The pentagonal numbers are the sums 1 P :=1+4+7+ + (3m 2) = m(3m 1). m ··· − 2 −

Exercise 1. Which pentagonal numbers are squares? 2 2 2 2 2 Solution. If Pm = n , 3m m =2n , (6m 1) = 24n +1. We make use of the fundamental− solution of x2 − 24y2 = 1, namely, (a, b)=(5, 1) to generate the solutions −

6m 1 5 24 6m 1 k+1 − = k − . nk 1 5 nk  +1      This, however, does not always yield integer values for mk+1. The solutions of the Pell equation x2 24y2 = 1, when arranged in − ascending order, have xk 1 (mod 6) only for odd values of k. Therefore, we modify the≡ recursion − as follows:

6m 1 5 24 2 6m 1 49 240 6m 1 k+1 − = k − = k − . nk 1 5 nk 10 49 nk  +1          This gives

m 49m + 40n 8 k+1 = k k − . nk+1 60mk + 49nk 10    −  910 Figurate numbers

Here are some beginning values: k 01 2 3 . . . mk 1 81 7921 776161 . . . nk 1 99 9701 950599 . . .

2. Which pentagonal numbers are triangular numbers? 2 2 Solution. If Pm = Tn, 3m m = n + n. Completing squares leads to , − (6m 1)2 = 3(2n + 1)2 2. (26.1) − − Now, the Pell equation x2 3y2 = 2 has smallest solution (1, 1). We make use the fundamental− solution− of x2 3y2 = 1, namely, (a, b)=(2, 1) to generate solutions of (26.1): −

2 6m 1 2 3 6m 1 7 12 6m 1 k+1 − = k − = k − . 2nk +1 1 2 2nk +1 4 7 2nk +1  +1          This gives m 7m +4n +1 k+1 = k k . nk 12mk +7nk +1  +1    Here are some beginning values: k 012 3 4 . . . mk 1 12 165 2296 31977 . . . nk 1 20 285 3976 55385 . . . 26.3 Almost square triangular numbers 911

26.3 Almost square triangular numbers

There are two types of almost square triangular numbers, deficient and excessive.

26.3.1 Excessive square triangular numbers

2 If the triangular number Tm = n +1 for some integer n, we call it an excessive . This is equivalent to

(2m + 1)2 8n2 =9. − Its solutions can be found from those of x2 8y2 =9: −

mk+1 = 3mk +4nk +1,

nk+1 = 2mk +3nk +1, with initial entries given by (2m0 + 1, n0) = (3, 0), i.e., (m0, n0) = (1, 0). The beginning values are k 012 3 4 . . . mk 1 4 25 148 865 . . . nk 0 3 18 105 612 . . . This gives the excessive triangular numbers

2 T1 = 0 +1, 2 T4 = 3 +1, 2 T25 = 18 +1, 2 T148 = 105 +1, . . 912 Figurate numbers

26.3.2 Deficient square triangular numbers

2 If the triangular number Tm = n 1 for some integer n, we call it a deficient square triangular number.− This is equivalent to

(2m + 1)2 8n2 = 7. − − Its solutions can be found from the same recurrence relations, but with initial entries given by (2m0 +1, n0)=(1, 1) or ( 1, 1), i.e., (m0, n0)= (0, 1) or ( 1, 1). These yield two distinct sequences− of deficient trian- gular numbers:−

T = 12 1, 0 − T = 42 1, 5 − T = 232 1, 32 − T = 1342 1, 189 − . . and

T = 22 1, 2 − T = 112 1, 15 − T = 642 1, 90 − T = 3732 1, 527 − . . 26.3 Almost square triangular numbers 913

Exercise 1. A developer wants to build a community in which the n (approxi- mately 100) homes are arranged along a circle, numbered consecu- tively from 1, 2,... n, and are separated by the club house, which is not numbered. He wants the house numbers on one side of club house adding up to the same sum as the house numbers on the other sides. Between which two houses should he build the club house? How many houses are there altogether? Solution. Suppose houses 1, 2,..., m are on one side of the club house. 1+2 + n = 2(1+2+ + m); n(n +1)=2m(m +1); 4n2 +4n = 2(4···m2 +4m); (2n+1)···2 = 2(2m+1)2 1; (2n+1)2 2(2m + 1)2 = 1. From the solutions of x2 2y2−= 1, we have− (2n +1, 2m +1)− = (239, 169). This gives (n,− m) = (119− , 84). 2. Later the developer finds out that government law requires the club house also to be numbered. If he wants to maintain equal house number sums on both sides, he finds that he has to build signifi- cantly fewer homes. How many homes should he build, and what is the number of the club house? 3. Find five positive integers n for which both 2n +1 and 3n +1 are squares. 4. The voting population of your county is about one million. Each voter is assigned a registration number from 1, 2, 3,..., N, the exact number of voters. When a county official typed in her own name, her registration number M appeared on the computer screen. Her assistant, being an excellent student from your mathematics class, remarked that the probability that the registration numbers of two more names she would randomly enter are both less than M 1 is exactly 2 . And she was correct. The assistant’s father was very proud. He copied the numbers, and related the story to you. Now, give him more reason to be proud by telling the exact popula- tion N of the county, and the registration number M of his daugh- ter’s superior, (which he can easily verify). Answer. : Voting population 803762, first number 568346. 914 Figurate numbers Chapter 27

Special integer triangles

27.1 Almost isosceles Pythagorean triangles

An almost isosceles right triangle is one whose shorter sides differ by 1. Let a and a + 1 be these two sides and y the hypotenuse. Then y2 = a2 +(a + 1)2 = 2a2 +2a +1. From this, 2y2 = (2a + 1)2 + 1. The equation With x = 2a + 1, this reduces to the Pell equation x2 2y2 = 1, which we know has solutions, with the of this equations − − are (xk,yk) given recursively by smallest positive one (1, 1), and the equation x2 2y2 = 1 has fundamental solution (3, 2). It follows that the solutions− are given recursively by

xk+1 = 3xk +4yk, yk+1 = 2xk +3yk, x0 =1, y0 =1.

If we write xk =2ak +1, these become

ak+1 = 3ak +2yk +1, yk+1 = 4ak +3yk +2, a0 =0, y0 =1.

The beginning values of ak and yk are as follows.

k 1234 5 6 . . . ak 3 20 119 696 4059 23660 . . . yk 5 29 169 985 5741 33461 . . . 916 Special integer triangles

32 +42 = 52, 202 + 212 = 292, 1192 + 1202 = 1692, 6962 + 6972 = 9852, . .

27.1.1 The generators of the almost isosceles Pythagorean trian- gles Consider the almost isosceles Pythagorean triangles along with their generators:

k 1 2 3 4 5 6 . . .

ak 3 20 119 696 4059 23660 . . . yk 5 29 169 985 5741 33461 . . . mk 1 2 5 12 29 70 . . . nk 2 5 12 29 70 169 . . .

The generators form a sequence

1, 2, 5, 12, 29, 70, 169,... which satisfies the second order recurrence

mk+2 =2mk+1 + mk, m1 =1, m2 =2. Note that the hypotenuses of the triangles are among the generators. 27.2 Integer triangles (a,a +1,b) with a 120◦ angle 917

27.2 Integer triangles (a, a +1,b) with a 120◦ angle

If (a, a +1, b) is an integer triangle with a 120◦ angle, the consecutive sides must be the shorter ones. This means that b2 = a2 + a(a +1)+(a + 1)2 =3a2 +3a +1. Completing squares leads to the Pell equation (2b)2 3(2a + 1)2 =1. (27.1) − Since the solutions of x2 3y2 =1, when arranged in ascending order, have x even and y odd only− in alternate terms, the solutions of (27.1) are given recursively by

2b 2 3 2 2b 7 12 2b k+1 = k = k , 2ak +1 1 2 2ak +1 4 7 2ak +1  +1          or a 7a +4b +3 k+1 = k k . bk 12ak +7bk +6  +1    The beginning values are k 012 3 4 . . . ak 0 7 104 1455 20272 . . . bk 1 13 181 2521 35113 . . .

Note that the values of bk are all sums of two consecutive squares: 1= 02 +12, 13= 22 +32, 181= 92 + 102, 2521 = 352 + 362, 35113 = 1322 + 1332, . . This observation can be justified by rewriting (27.1) in the form (2b 1)(2b +1) = 3(2a + 1)2. − Since 2b 1 and 2b +1 are consecutive odd numbers, they are relatively prime. Therefore,− either 918 Special integer triangles

(i) 2b +1= m2, 2b 1=3n2, or (ii) 2b +1=3m2, 2−b 1= n2. In (i), m2 3n2 =2−, an impossibility. We must have (ii), and − n2 +1 n 1 2 n +1 2 b = = − + , 2 2 2     n 1 n+1 the sum of the squares of the consecutive numbers −2 and 2 .

Exercise

2 2 1. If we write bk = ck +(ck +1) , the numbers ck are given recursively by c =4c c +1, c =0, c =2. k+2 k+1 − k 0 1

2. Prove that there is no integer triangle with two sides which are con- secutive integers and have a 60◦ angle between them.

3. Find all integer triangles with a 60◦ and two sides which are con- secutive integers. Answer. (3, 7, 8) and (5, 7, 8). Chapter 28

Heron triangles

28.1 Heron triangles with consecutive sides

If (b 1, b, b +1, ) is a Heron triangle, then b must be an even integer. We write− b =2m.△ Then s =3m, and 2 =3m2(m 1)(m + 1). This requires m2 1=3k2 for an integer n△, and =3mn−. The solutions of m2 3n2 =1− can be arranged in a sequence△ − m 2 3 m m 2 k+1 = k , 1 = . nk 1 2 nk n 1  +1       1    From these, we obtain the side lengths and the area. The middle sides form a sequence (bk) given by b =4b b , b =2, b =4. k+2 k+1 − k 0 1 The areas of the triangles form a sequence = 14 , =0, =6. △k+2 △k+1 −△k △0 △1

k b Heron triangle k △k 0 2 0 (1, 2, 3, 0) 1 4 6 (3, 4, 5, 6) 2 14 84 (13, 14, 15, 84) 3 4 5 1002 Heron triangles

28.2 Heron triangles with two consecutive square sides

Construct an infinite family of Heron triangles each with two sides the squares of consecutive integers. Here is one example: the triangle (25, 36, 29) has area 360. Solution. Let a = v2 and b =(v +1)2. Since the perimeter of a Heron triangle must be an even number, the third side must be odd. Write c =2u 1. With these, −

s = u + v + v2, s a = u + v, − s b = u v 1, − − − s c = v2 u + v +1. − −

To obtain a Heron triangle, we find a relation between u and v which makes one or more of these expressions squares. By putting u =3v, we have c =6v 1 and −

s = v(v + 4), s a = 4v, − s b = 2v 1, − − s c = (v 1)2. − −

This is a Heron triangle if and only if 4v2(v 1)2(v + 4)(2v 1) is a square. Equivalently, (v + 4)(2v 1) is a square.− We take 2v −1= x2 and v +4= y2 for integers x and−y. These must satisfy x2 2−y2 = 9. − − Beginning with the smallest solution (x1,y1) = (3, 3), we obtain an infinite sequence of solutions

x 3 4 x n+1 = = n . yn 2 3 yn  +1     28.2 Heron triangles with two consecutive square sides 1003

nxyv a b c ∆ 133 5 25 36 29 360 2 21 15 221 48841 49284 1325 30630600 3 123 87 7565 57229225 57244356 45389 1224657967320 . .

The parameter v can be generated recursively by v = 34v v + 56, v =5, v = 221. n+2 n+1 − n 1 2 This gives a Heron triangle (v2, (v + 1)2, 6v 1) with area 2v(v 1)xy. − − Exercise Make use of this recurrence to find one more such triangle. Answer. v = 257045;(a, b, c) = (66072132025, 66072646116, 1542269), ∆ = 48036763841709240. 1004 Heron triangles Chapter 29

Squares as sums of consecutive squares

29.1 Sum of squares of natural numbers

Theorem 29.1. 1 12 +22 +32 + + n2 = n(n + 1)(2n + 1). ··· 6 Proof. Let T =1+2+3 + n = 1 n(n + 1) and n ··· 2 S =12 +22 +32 + + n2. n ···

23 = 13 + 3 12 + 3 1 +1 33 = 23 + 3 · 22 + 3 · 2 +1 43 = 33 + 3 · 32 + 3 · 3 +1 . · · . n3 = (n 1)3 + 3(n 1)2 + 3(n 1) + 1 (n + 1)3 = −n3 + 3 −n2 + 3 −n + 1 · · Combining these equations, we have 3 3 (n + 1) =1 +3Sn +3Tn + n.

Since Tn is known, we have 1 3 1 S = (n + 1)3 n 1 n(n + 1) = n(n + 1)(2n + 1). n 3 − − − 2 6   1006 Squares as sums of consecutive squares

Exercise 1. Find 12 +32 +52 + + (2n 1)2. ··· − 2. Find n so that n2 +(n + 1)2 is a square. 3. Show that

32 +42 =52, 102 + 112 + 122 =132 + 142, 212 + 222 + 232 + 242 =252 + 262 + 272, 362 + 372 + 382 + 392 + 402 =412 + 422 + 432 + 442, . .

4. Find all integers n so that the mean and the standard deviation of n consecutive integers are both integers. Solution. If the mean of n consecutive integers is an integer, n must be odd. We may therefore assume the numbers to be m, (m 1), ..., 1, 0, 1, ..., m 1, m. The standard deviation− − − − − 1 of these number is 3 m(m + 1). For this to be an integer, we 1 2 2 2 must have 3 m(m +1)q = k for some integer k. m + m = 3k ; n2 = (2m + 1)2 = 12k2 +1. The smallest positive solution of the Pell equation n2 12k2 = 1 being (7, 2), the solutions of this − equation are given by (ni,ki), where

ni+1 = 7ni + 24ki, ki+1 = 2ni +7ki, n0 =1, k0 =0. The beginning values of n and k are i 123 4 5 . . . ni 7 97 1351 18817 262087 . . . ki 2 28 390 5432 75658 . . .

5. Find the first two instances when the average of the squares of n consecutive squares is equal to n2. Describe how to generate all such identities. 29.1 Sum of squares of natural numbers 1007

6. Find all sequences of 11 consecutive positive integers, the sum of whose squares is the square of an integer. Answer.

182 + 192 + + 282 = 772, 382 + 392 + ··· + 482 = 1432, 4562 + 4572 +··· + 4662 = 15292, 8542 + 8552 + ··· + 8642 = 28492, 91922 + 91932 +··· + 92022 = 305032, 171322 + 171332 +··· + 171422 = 568372, . ··· .

7. Find all natural numbers n> 1 such that (12 +22 + + n2)((n + 1)2 +(n + 2)2 + +(n + n)2) ··· ··· is a perfect square. 1008 Squares as sums of consecutive squares

29.2 Sums of consecutive squares: odd number case

Suppose the sum of the squares of 2k +1 consecutive positive integers is a square. If the integers are b, b 1,...,b k. We require ± ± 1 (2k + 1)b2 + k(k + 1)(2k +1) = a2 3 for an integer a. From this we obtain the equation 1 a2 (2k + 1)b2 = k(k + 1)(2k + 1). (E ) − 3 k

1. Suppose 2k +1 is a square. Show that (Ek) has solution only when k = 6m(m + ǫ) for some integers m > 1, and ǫ = 1. In each case, the number of solutions is finite. ±

Number of solutions of (Ek) when 2k +1 is a square

2k +1 25 49 121 169 289 361 529 625 841 961 . . . 011 2 7 3 5 3 310 . . . 2. Find the unique sequence of 49 (respectively 121) consecutive pos- itive integers whose squares sum to a square.

3. Find the two sequences of 169 consecutive squares whose sums are squares.

4. Suppose 2k +1 is not a square. If k +1 is divisible 9=32 or by any prime of the form 4k +3 7, then the equation (Ek) has no solution. Verify that for the following≥ values of k < 50, the equation (Ek) has no solution: 29.2 Sums of consecutive squares: odd number case 1009

k = 6, 8, 10, 13, 17, 18, 20, 21, 22, 26, 27, 30, 32, 34, 35, 37, 40, 41, 42, 44, 45, 46, 48,...

1 k(k+1) − 3 5. Suppose p =2k+1 is a prime. If the p = 1, then the equation (Ek) has no solution. Verify that for the fol- − lowing values of k < 50, the equation (Ek) has no solution: 1, 2, 3, 8, 9, 14, 15, 20, 21, 26, 33, 39, 44.

6. For k 50, it remains to consider (Ek) for the following values of k: ≤ 5, 7, 11, 16, 19, 23, 25, 28, 29, 31, 36, 38, 43, 47, 49.

Among these, only for k = 5, 11, 16, 23, 29 are the equations (Ek) solvable. 7. Work out 5 sequences of 23 consecutive integers whose squares add up to a square in each case. Answer: 72 +82 + + 292 = 922; 8812 + 8822 + ···+ 9032 = 42782; 427872 + 427882 + ···+ 428092 = 2052522; 20534012 + 20534022 + ···+ 20534232 = 98478182; ··· ········· 2 2 8. Consider the equation (E36) : u 73v = 12 37 73. This equation does in fact have solutions (u, v−) = (4088,· 478)· , (23360, 2734). The fundamental solution of the Pell equation x2 73y2 =1 being (a, b) = (2281249, 267000), we obtain two sequences− of solutions of (E73): Answer:

(4088, 478), (18642443912, 2181933022), (85056113063608088, 9955065049008478),... (23360, 2734), (106578370640, 12474054766), (486263602888235360, 56912849921762734),...

This means, for example, the sum of the squares of the 73 numbers with center 478 (respectively 2734) is equal to the square of 4088 (respectively 23360). 1010 Squares as sums of consecutive squares

29.3 Sums of consecutive squares: even number case

Suppose the sum of the squares of the 2k consecutive numbers

b k +1, b k +2,...,b,...,b + k 1, b + k, − − − is equal to a2. This means

2 2 2k 2 (2a) 2k(2b + 1) = (4k 1). (E′ ) − 3 − k Note that the numbers 2k, 4k2 1 are relatively prime. −

1. Show that the equation (Ek′ ) has no solution if 2k is a square.

2. Suppose 2k is not a square. Show that if 2k +1 is divisible by 9, or by any prime of the form 4k +1, then the equation (Ek′ ) has no solution.

3. For k 50, the equation (Ek′ ) has no solution for the following values≤ of k:

k = 3, 4, 5, 9, 11, 13, 15, 17, 21, 23, 24, 27, 29, 31, 33, 35, 38, 39, 40, 41, 45, 47, 49.

4. Let k be a prime. The equation (Ek′ ) can be written as 4k2 1 (2b + 1)2 2ky2 = − . − − 3

By considering Legendre symbols, the equation (Ek′ ) has no solu- tion for the following values of k 50: ≤ k =5, 7, 17, 19, 29, 31, 41, 43.

5. Excluding square values of 2k < 100, the equation (Ek′ ) has solu- tions only for k =1, 12, 37, 44.

6. Show that (34, 0), (38, 3), (50, 7) are solutionsof (E”12). Construct from them three infinite sequences of expressions of the sum of 24 consecutive squares as a square. 29.3 Sums of consecutive squares: even number case 1011

7. The equation (E37′ ) has solutions (185, 2), (2257,261), and (2849, 330). From these we construct three infinite sequences of expres- sions of the sum of 74 consecutive squares as a square. Answer:

2252 + 2262 + + 2982 = 22572; 2942 + 2952 + ··· + 3672 = 28492; 130962 + 130972 + ···+ 131792 = 7638652. ···

8. The equation (E44′ ) has solutions (242, 4) and (2222,235). From these we obtain two infinite sequences of expressions of the sum of 88 consecutive squares as a square.

1922 + 1932 + + 2792 = 22222; 59252 + 59262 +··· 60122 = 559902. ··· 1012 Squares as sums of consecutive squares

29.4 Sums of powers of consecutive integers

Consider the sum of the k-powers of the first natural numbers: S (n):=1k +2k + + nk. k ···

Theorem 29.2 (Bernoulli). Sk(n) is a polynomial in n of degree k +1 without constant term. It can be obtained recursively as

Sk+1(n)= (k + 1)Sk(n)dn + cn, Z where c is determined by the condition that the sum of the coefficients is 1.

Examples

1 (1) S2(n)= 6 n(n + 1)(2n + 1). (2) S (n)=13 +23 + + n3 = 1 n2(n + 1)2. 3 ··· 4 (3) S (n)= 1 n5 + 1 n4 + 1 n3 1 n. 4 5 2 3 − 30 Exercise Show that 1k +2k + + nk =(1+2+ + n)p ··· ··· for all integers n if and only if (k,p)=(1, 1) or (3, 2). 1

1Math. Mag. 82:1 (2009) 64, 67. Chapter 30

Lucas’ problem

A square pyramid of cannon balls contains a square number of cannon balls only when it has 24 cannon balls along its base. 1 Theorem 30.1 (Lucas).

12 +22 + + n2 = m2 = (n, m)=(1, 1) or (24, 70). ··· ⇒ Equivalently, these are the only positive integer solutions of

n(n + 1)(2n +1)=6m2.

The elementary solution of Lucas’ problem presented here is based on Anglin [7].

30.1 Solution of n(n + 1)(2n +1)=6m2 for even n

We make use of three nontrivial results.

(A) (Fermat) The area of a Pythagorean triangle cannot be a square.

(B) There are no positive integers x such that 2x4 +1 is a square.

(C) The only positive integer x for which 8x4 +1 is a square is x =1.

Note that the numbers n, n +1 and 2n +1 are mutually relatively prime.

1E. Lucas, Question 1180, Nouvelles Annales de Math´ematiques, ser. 2, 14 (1875) 336. 1014 Lucas’ problem

If n is even, then n +1 and 2n +1 are both odd. Each of them is of the form k2 or 3k2. In any case, n +1 2 and 2n +1 2 (mod 3). This means that n 0 (mod 3), and there6≡ are integers p,6≡q, r such that ≡ n =6p2, n +1= q2, 2n +1= r2. From these, 6p2 = r2 q2 =(r q)(r + q). Since q and r are both odd, r p and r + q are both− even. It− follows that p is even, and − r q r + q p 2 − =6 . 2 · 2 2   There are two possibilities. r q r+q 2 2 (a) One of −2 and 2 is of the form 3x and the other 2y for some integers x and y. In this case, q = (3x2 2y2) and p =2xy. Since ± − (3x2 2y2)2 = q2 =6p2 +1=24x2y2 +1 − = (3x2 6y2)2 = 32y4 +1 =2(2y)4 +1, ⇒ − we must have y = 0 by (B). Correspondingly, x = 0, p = 0, and n cannot be a positive integer. r q r+q 2 2 (b) One of −2 and 2 is of the form 6x and the other y for some integers x and y. Then q = (6x2 y2) and p =2xy. Since ± − (6x2 y2)2 = q2 =6p2 +1=24x2y2 +1 − = (6x2 3y2)2 =8y4 +1, ⇒ − we must have y =0 or y =1 by (C). Correspondingly, x =0 or x =1. Hence, the only positive even integer value of n =6p2 = 6(2xy)2 = 24.

30.2 The Pell equation x2 3y2 =1 revisited − The positive solutions of the Pell equation x2 3y2 =1 form a sequence − (xk,yk).

1. xh+k = xhxk +3yhyk, yh+k = xhyk + xkyh.

2. For h k, xh k = xhxk 3yhyk, yh k = xhyk + xkyh. ≥ − − − − 3. x =4x x , y =4y y . k+2 k+1 − k k+2 k+1 − k 4. x =2x2 1=6y2 +1, y =2x y . 2k k − k 2k k k 30.3 Solution of n(n + 1)(2n +1)=6m2 for odd n 1015

5. Let h,k,r be nonnegative integers such that 2hr k is nonnegative. Then − r x2hr k ( 1) xk (mod xh). ± ≡ −

6. If k is even, then xk is odd, not divisible by 5, and 5 is a quadratic residue of xk if and only if k is divisible by 3.

7. If k is even, then xk is odd, and 2 is a quadratic residue of xk if and only if k is divisible by 4. −

2 8. xk =4z +3 for an integer z only if xk =7.

30.3 Solution of n(n + 1)(2n +1)=6m2 for odd n

Suppose n is odd. Then each of n and 2n +1 is of the form k2 or 3k2. This means that n 2 (mod 3). Since n +1 is even, it is of the form 2k2 or 6k2. This means6≡ that n +1 1. Therefore, n 1 (mod 3), and 2n +1 is divisible by 3. There are6≡ nonnegative integers≡ p, q, r such that n = p2, n +1=2q2, 2n +1=3r2. From these, we have 6r2 +1=4n+3=4p2 +3. Note that 3r2 4q2 = 1. It follows that − − (6r2 + 1)2 3(4qr)2 = 12r2(3r2 +1 4q2)+1=1. − − Therefore, (6r2 +1, 4qr) is a solution of the Pell equation x2 3y2 =1, 2 2 − and 6r +1= xk for some k. By (8), we must have 6r +1=7, r =1. Hence, the only positive odd integer value of n is given by 2n +1=3, i.e., n =1. Chapter 31

Some geometry problems

1. AX and BY are angle bisectors of triangle ABC, with X on BC and Y on AC. Suppose AX = AC and BY = AB. (a) Determine the angles of triangle ABC.

(b) If CZ′ is the external bisector of angle C, with Z′ on the exten- sion of BA, show that CZ′ = AC.

Z′

A

Y

B X C A B Solution. (a) 2 +B = C, 2 +C = A. Together with A+B+C = π, we have 6π 2π 5π A = , B = , C = . 13 13 13

(b) Half of the external angle of C = 1 π 5π = 4π = 2B. 2 − 13 13 Therefore, CZ′ = BC.  1102 Some geometry problems

A

3 3

6

Y

1 1 5 5 B C X 1103

2.

1 ◦ tan7 = √6 √3+ √2 2=(√2 1)(√3 √2), 2 − − − − 1 ◦ tan37 = √6+ √3 √2 2=(√2+1)(√3 √2), 2 − − − 1 ◦ tan52 = √6 √3 √2+2=(√2 1)(√3+ √2), 2 − − − 1 ◦ tan82 = √6+ √3+ √2+2=(√2+1)(√3+ √2). 2

Solution. Consider a square ABCD with sidelength 2 and an equilateral triangle XCD with X in the interior of the square. Let M be the midpoint of AB.

D C

30◦

Y 45◦

X T

A M B

Since triangle DAX is isosceles with ∠ADX = 30◦, ∠DAX = 75◦, and ∠XAM = 15◦. In the right triangle XAM,

AM = 1, MX = 2 √3, − AX = 12 + (2 √3)2 = 8 4√3= 8 2√12 = √6 √2. − − − − q q q 1104 Some geometry problems

If AT bisects angle XAM, by the angle bisector theorem AM T M = XM · AM + AX 1 = (2 √3) − · 1+ √6 √2 1 − = (2 + √3)(1 + √6 √2) − 1 = 2+ √2+ √3+ √6 1 = (√2+1)(√3+ √2) = (√2 1)(√3 √2). − − From the right triangle XAM, we have

1 ◦ T M tan7 = =(√2 1)(√3 √2). 2 AM − −

(2) Applying the law of tangents to triangle XCY in which ∠X = 45◦ and ∠C = 30◦, we have

X+C tan 2 CY + XY X C = . tan − CY XY 2 − Now, XY = AX = √2(√3 1), CY = 2 2(2 √3) = 2(√3 1). This means − − − − tan37 1 ◦ √2+1 2 = , tan7 1 ◦ √2 1 2 − and 1 ◦ tan37 =(√2+1)(√3 1). 2 − 1105

3. Let D be the midpoint of BC of triangle ABC. Suppose that ∠BAM = ∠C and ∠DAC = 15◦. Calculate angle C.

A

15◦

B D C

Answer.: 30◦.

O

A

P

Q

B D C

Solution. Since ∠DAB = ∠ACD, the line AB is tangent to the circle ACD. Let O be the center of the circle, and P , Q the projections of A, D on OC. Since ∠DOQ = 2∠DAC = 30◦, DQ = 1 OD = 1 OA. Therefore, BP = AO. Since OB is 2 · 2 · a diameter of the circle through O, A, B, P , ∠AOC = 90◦. It follows that ∠ACB = ∠OCD ∠OCA = 75◦ 45◦ = 30◦. − − 1106 Some geometry problems

4. Calculate the length of AC.

A

x

C 1 1

30◦ D B

Answer. x = √3 2. Solution. Let AB = x. If AE is the bisector of angle A, then 1 AE = 1+x . AD is the bisector angle BAE.

A

x

C 1 1

30◦ D B

√3 x

1 x

E

2 1 2 √3 (x + 2)(x3 2) (1 + x)2 = 1+ + = − =0. x x ⇒ x2   ! 1107

5. In a right - angled triangle, establish the existence of a unique inte- rior point with the property that the line through the point perpen- dicular to any side cuts off a triangle of the same area.

A A A

Z1

Z

P P Y Z2 P

C B C B C B X X1

Solution. (1) Since the three triangles Z1BX, AZ2Y and X1BZ are similar, they are congruent if their areas are equal. Therefore, BX = BZ and triangles BPX and BPZ are congruent. It follows that P lies on the bisector of angle B.

A A A

Z1

M M Z

P P Y Z2 P

C B C B C B X X1

(2) Note that Z1B = AZ2. From this, AZ1 = Z2B. Extend CP to intersect AB at M. We have

AZ1 : AM = CP : CM = BZ2 : BM = Z2B : MB. Therefore, AM = MB and CM is the median on the hypotenuse. (3) The point P is the intersection of the bisector of angle B (smaller acute angle) and the median on the hypotenuse.

Exercise

(a) Calculate the coordinates of P in terms of a, b, c. Here, c2 = a2 + b2. a2 ab Answer. 2a+c , 2a+c .   a+c 2 (b) Show that the common area of the triangles is 2a+c of the given right triangle.  1108 Some geometry problems Chapter 32

Basic geometric constructions

32.1 Some basic construction principles

Theorem 32.1 (Perpendicular bisector locus). Given two distinct A and B on a plane, a point P is equidistant from A and B if and only if P lies on the perpendicular bisector of the segment AB. Theorem 32.2 (Angle bisector locus). A point P is equidistant from two given intersecting lines if and only if it lies on the bisector of an angle between the two lines. Note that two intersecting lines have two angle bisectors. Theorem 32.3. If two circles are tangent to each other, the line joining their centers passes through the point of tangency. The distance between their centers is the sum (respectively difference) of their radii if the tangency is external (respectively internal). 1110 Basic geometric constructions

32.2 Geometric mean

We present two ruler-and-compass constructions of the geometric means of two quantities given as lengths of segments. These are based on Eu- clid’s proof of the Pythagorean theorem. Construction 32.1. Given two segments of length a < b, mark three points P , A, B on a line such that P A = a, P B = b, and A, B are on the same side of P . Describe a semicircle with P B as diameter, and let the perpendicular through A intersect the semicircle at Q. Then P Q2 = P A P B, so that the length of P Q is the geometric mean of a and b. ·

Q

A P B

Construction 32.2. Given two segments of length a, b, mark three points A, P , B on a line (P between A and B) such that P A = a, P B = b. Describe a semicircle with AB as diameter, and let the perpendicular through P intersect the semicircle at Q. Then P Q2 = P A P B, so that the length of P Q is the geometric mean of a and b. ·

Q

P A B 32.3 Harmonic mean 1111

32.3 Harmonic mean

Let ABCD be a trapezoid with AB//CD. If the diagonals AC and BD intersect at K, and the line through K parallel to AB intersect AD and BC at P and Q respectively, then P Q is the harmonic mean of AB and CD: 2 1 1 = + . P Q AB CD

A b B

K P Q harmonic mean

D a C

Another construction

b

harmonic mean

a 1112 Basic geometric constructions

32.4 A.M G.M. H.M. ≥ ≥ A trapezoid with parallel sides a and b is given. Here is a construction of the geometric mean √ab as a parallel to the bases, making use of the arithmetic and harmonic means. As is well known, the parallel through 2ab the intersection of the diagonals gives the harmonic mean a+b . Let H be the endpoint of this parallel on the side AB of the trapezoid. Construct the perpendicular to AB at H to intersect the circle with diameter AB at P . Bisect the right angle AP B and let the bisector intersect AB at G.

B b

P

H

G M

A a

Then the parallel through G to the bases has length √ab. Proof. Note that AP B is a right angle, and AP 2 : BP 2 = AH : BH = a : b. Since PG bisects angle AP B, AG : BG = AP : P B = √a : √b. It follows that the parallel through G has length

a √b + b √a √ab(√a + √b) · · = = √ab. √b + √a √a + √b 32.4 A.M G.M. H.M. 1113 ≥ ≥

Exercise 1. Given triangle ABC, construct the equilateral triangles BCX, CAY and ABZ externally on the sides of the triangle. Join AX, BY , CZ. What can you say about the intersections, lengths, and direc- tions of these lines (segments)?

2. Show that the 90◦ angle of a right triangle is bisected by the line joining it to the center of the square on the hypotenuse. 3. Make a sketch to show that for two given positive quantities a and b, a + b 2ab √ab . 2 ≥ ≥ a + b

4. Construct the following diagram.

B A

C D

5. Construct the following diagram. B A

C D 1114 Basic geometric constructions

6. Two congruent circles of radii a have their centers on each other. Consider the circle tangent to one of them internally, the other ex- ternally, and the line joining their centers. It is known that this √3 circle has radius 4 a. Construct the circle.

7. An equilateral triangle of side 2a is partitioned symmetrically into a quadrilateral, an isosceles triangle, and two other congruent trian- gles. If the inradii of the quadrilateral and the isosceles triangle are equal, the common inradius is (√3 √2)a. Construct the partition. − Chapter 33

Construction of a triangle from three given points

33.1 Some examples

A A A

Hb Tb Mc M b Tc O

G I Hc H

B Ma C B Ta C B Ha C

Solve the construction problems of a triangle ABC from the given data in each case.

A1 : B,C,H B1 : B,C,I C1 : A, I, Mb A2 : A, B, Ma B2 : A, Ma, Mb C2 : A, H, Mb A3 : A, H, Ma B3 : A,O,H C3 : A, B, Ta A4 : A,O,G B4 : A, I, Tb C4 : A, G, Mb A5 : O, Mb, Mc B5 : A, Mb, Mc C5 : A,G,Hb

A1 A is the orthocenter of triangle BCH.

A2 Extend BMa to C such that BMa = MaC. 1116 Construction of a triangle from three given points

A3 Construct the parallel to AH through Ma, and the point O on this 1 MaO HA line such that the vector = 2 . Construct the circle O(A). This is the circumcircle of the· triangle. Construct the per- pendicular to OMa at Ma to intersect the circumcircle at B and C.

A4 Construct the circumcircle O(A). Extend AG to Ma such that AG : GMa =2:1. Join OMa. Construct the perpendicular to OMa at Ma to intersect the circumcircle at B and C.

A5 O is the orthocenter of MaMbMc. Therefore, Ma can be constructed as the orthocenter of triangle OMbMc. Now, construct lines through Ma, Mb, Mc parallel respectively to MbMc, McMa, MaMb. These lines bound the required triangle ABC. B1 Let X be the perpendicular foot of I on BC. Construct the circle I(X), then the tangents from B and C to the circle. These tangents intersect at A. 1

B2 Trisect the segment AMa at G. Join Mb to G and extend it to B such that MbG : GB =1:2. Extend BMa to C such that BMa = MaC. B3 Construct the circumcircle O(A). Construct a line through O paral- lel to AH, and on this line mark a point Ma such that the vector 1 OMa AH = 2 . The perpendicular to OMa at Ma intersects the circumcircle· at B and C.

B4 Construct the perpendicular foot Y of I on the line ATb and the circle I(Y ). This is the incircle of the triangle. Construct A(Y ) to intersect the incircle again at Z. The lines AZ and ITb intersect at B. Construct the circle B(Y ) to intersect the incircle again at X. The lines BX and ATb intersect at C.

B5 Extend AMc to B such that AMc = McB and AMb to C such that AMb = MbC.

C2 Extend AMb to C such that AMb = MbC. B is the orthocenter of triangle HAC.

C4 Extend AMb to C such that AMb = MbC. Extend MbG to B such that GB =2 M G. · b 1These tangents can be constructed easily as follows. Let the circles B(X) and C(X) intersect the circle I(X) again at Z and Y respectively. The lines BZ and CY are the tangents, and their intersection is A. 33.2 Wernick’s construction problems 1117

33.2 Wernick’s construction problems

1. A,B,O L 36. A,Mb,Tc S 71.O,G,H R 106. Ma,Hb,Tc U 2. A,B,Ma S 37. A,Mb,I S 72. O,G,Ta U 107. Ma,Hb,I U 3. A,B,Mc R 38. A,G,Ha L 73.O,G,I U 108. Ma,H,Ta U 4. A,B,G S 39. A,G,Hb S 74.O,Ha,Hb U 109. Ma,H,Tb 5.A,B,Ha L 40. A,G,H S 75.O,Ha,H S 110. Ma,H,I 6.A,B,Hc L 41. A,G,Ta S 76.O,Ha,Ta S 111. Ma,Ta,Tb 7.A,B,H S 42. A,G,Tb U 77.O,Ha,Tb 112. Ma,Ta,I S 8. A,B,Ta S 43. A,G,I S 78.O,Ha,I 113. Ma,Tb,Tc 9. A,B,Tc L 44.A,Ha,Hb S 79.O,H,Ta U 114. Ma,Tb,I U 10.A,B,I S 45.A,Ha,H L 80.O,H,I U 115. G,Ha,Hb U 11. A,O,Ma S 46.A,Ha,Ta L 81.O,Ta,Tb 116. G,Ha,H S 12. A,O,Mb L 47.A,Ha,Tb S 82.O,Ta,I S 117. G,Ha,Ta S 13. A,O,G S 48.A,Ha,I S 83. Ma, Mb, Mc S 118. G,Ha,Tb 14.A,O,Ha S 49.A,Hb,Hc S 84. Ma, Mb, G S 119. G,Ha,I 15.A,O,Hb S 50.A,Hb,H L 85. Ma, Mb,Ha S 120. G,H,Ta U 16.A,O,H S 51.A,Hb,Ta S 86. Ma, Mb,Hc S 121. G,H,I U 17. A,O,Ta S 52.A,Hb,Tb L 87. Ma, Mb,H S 122. G,Ta,Tb 18. A,O,Tb S 53.A,Hb,Tc S 88. Ma, Mb,Ta U 123. G,TA,I 19.A,O,I S 54.A,Hb,I S 89. Ma, Mb,Tc U 124.Ha,Hb,Hc S 20. A,MA, Mb S 55. A,H,Ta S 90. Ma, Mb,I S 125.Ha,Hb,H S 21. A,Ma, G R 56. A,H,Tb U 91. Ma,G,Ha L 126.Ha,Hb,Ta S 22. A,Ma,Ha L 57.A,H,I S 92. Ma,G,Hb S 127.Ha,Hb,Tc 23. A,Ma,Hb S 58. A,Ta,Tb S 93. Ma,G,H S 128.Ha,Hb,I 24. A,Ma,H S 59. A,Ta,I L 94. Ma,G,Ta S 129.Ha,H,I L 25. A,Ma,Ta S 60. A,Tb,Tc S 95. Ma,G,Tb U 130.Ha,H,Tb U 26. A,Ma,Tb U 61. A,Tb,I S 96. Ma,G,I S 131.Ha,H,I S 27. A,Ma,I S 62.O,Ma, Mb S 97. Ma,Ha,Hb S 132.Ha,Ta,Tb 28. A,Mb, Mc S 63.O,Ma, G S 98. Ma,Ha,H L 133.Ha,Ta,I S 29. A,Mb, G S 64.O,Ma,Ha L 99. Ma,Ha,Ta L 134.Ha,Tb,Tc 30. A,Mb,Ha L 65.O,Ma,Hb S 100. Ma,Ha,Tb U 135.Ha,Tb,I 31. A,Mb,Hb L 66.O,Ma,H S 101. Ma,Ha,I 136. H,Ta,Tb 32. A,Mb,Hc L 67.O,Ma,Ta L 102. Ma,Hb,Hc L 137. H,Ta,I 33. A,Mb,H S 68.O,Ma,Tb U 103. Ma,Hb,H S 138.Ta,Tb,Tc U 34. A,Mb,Ta S 69.O,Ma,I S 104. Ma,Hb,Ta S 139.Ta,Tb,I S 35. A,Mb,Tb L 70. O,G,Ha S 105. Ma,Hb,Tb S

R Redundant. Given the location of two of the points of the triple, the location of the third point is determined. L Locus Restricted. Given the location of two points, the third must lie on a certain locus. S Solvable. Known ruler and compass solutions exist for these triples. U Unsolvable with ruler and compass. Chapter 34

The classical triangle centers

The following triangle centers have been known since ancient times. We shall adopt the following notations. Let ABC be a given triangle. The lengths of the sides BC, CA, AB opposite to A, B, C are denoted by a, b, c.

34.1 The centroid

The centroid G is the intersection of the three medians. It divides each median in the ratio 2:1. A

F E G

B C D The triangle DEF is called the medial triangle of ABC. It is the image of ABC under the homothety h(G, 1 ). − 2 The lengths of the medians are given by Apollonius’ theorem:

1 m2 = (2b2 +2c2 a2), a 4 − etc. 1202 The classical triangle centers

Exercise Calculate the lengths of the medians of a triangle whose sidelengths are 136, 170, and 174.

34.2 The circumcircle and the circumcenter

The perpendicular bisectors of the three sides of a triangle are concurrent at the circumcenter of the triangle. This is the center of the circumcircle, the circle passing through the three vertices of the triangle.

A A

F O E O

B C B C D D

Theorem 34.1 (The law of sines). Let R denote the circumradius of a triangle ABC with sides a, b, c opposite to the angles A, B, C respec- tively. a b c = = =2R. sin A sin B sin C 1 Since the area of a triangle is given by = 2 bc sin A, the circumra- dius can be written as △ abc R = . 4 △ 34.3 The incenter and the incircle 1203

34.3 The incenter and the incircle

The internal angle bisectors of a triangle are concurrent at the incenter of the triangle. This is the center of the incircle, the circle tangent to the three sides of the triangle. If the incircle touches the sides BC, CA and AB respectively at X, Y , and Z, AY = AZ = s a, BX = BZ = s b, CX = CY = s c. − − −

A

s − a

s − a

Y

Z I s − c

s − b

B C s − b X s − c

Denote by r the inradius of the triangle ABC. 2 r = △ = △. a + b + c s 1204 The classical triangle centers

34.4 The orthocenter and the Euler line

The orthocenter H is the intersection of the three altitudes of triangle ABC. These altitudes can be seen as the perpendicular bisectors of the antimedial triangle XYZ of ABC, which is bounded by the three lines each passing through A, B, C parallel to their respective opposite sides.

A Y Z

O

H G

B C

X

XYZ is the image of triangle ABC under the homothety h(G, 2). It follows that H is the image of O under the same homothety.− We conclude that O, G, and H are collinear, and OG : GH =1:2. The line containing O, G, H is the famous Euler line of triangle ABC. 34.5 The excenters and the excircles 1205

34.5 The excenters and the excircles

The internal bisector of each angle and the external bisectors of the re- maining two angles are concurrent at an excenter of the triangle. An excircle can be constructed with this as center, tangent to the lines con- taining the three sides of the triangle.

Ib

A

Ic

X

B C Y

Z

Ia

The exradii of a triangle with sides a, b, c are given by

r = △ , r = △ , r = △ . a s a b s b c s c − − −

Exercise 1. Given a triangle ABC, construct a triangle whose sides have the same lengths as the medians of ABC. 2. Construct the incircle of triangle ABC, and mark the points of con- tact X on BC, Y on CA, and Z on AB. Are the lines AX, BY , CZ concurrent? If so, is their intersection the incenter of triangle ABC? 3. Given three non-collinear points as centers, construct three circles mutually tangent to each other externally. 4. Let D, E, F be the midpoints of BC, CA, AB of triangle ABC. Construct the circumcircle of DEF . This is called the nine-point 1206 The classical triangle centers

circle of triangle ABC. Construct also the incircle of triangle ABC. What do you observe about the two circles? How would you justify your observation? 5. Construct the circle through the excenters of triangle ABC. Howis its center related to the circumcenter and incenter of triangle ABC? Chapter 35

The nine-point circle

35.1 The nine-point circle

The followingnine points associated with a triangle are on a circle whose center is the midpoint between the circumcenter and the orthocenter: (i) the midpoints of the three sides, (ii) the pedals (orthogonal projections) of the three vertices on their op- posite sides, (iii) the midpoints between the orthocenter and the three vertices.

A

Ea Y

F E

G N O

Z H

Eb Ec

B X D C

Proof. (1) Let N be the circumcenter of the inferior triangle DEF . Since DEF and ABC are homothetic at G in the ratio 1:2, N, G, O are collinear, and NG : GO =1:2. Since HG : GO =2:1, the four are collinear, and HN : NG : GO =3:1:2, 1208 The nine-point circle

and N is the midpoint of OH. (2) Let X be the pedal of H on BC. Since N is the midpoint of OH, the pedal of N is the midpoint of DX. Therefore, N lies on the perpendicular bisector of DX, and NX = ND. Similarly, NE = NY , and NF = NZ for the pedals of H on CA and AB respectively. This means that the circumcircle of DEF also contains X, Y , Z. (3) Let Ea, Eb, Ec be the midpoints of AH, BH, CH respectively. The triangle EaEbEc is homothetic to ABC at H in the ratio 1:2. Denote by N ′ its circumcenter. The points N ′, G, O are collinear, and N ′G : GO =1:2. It follows that N ′ = N, and the circumcircle of DEF also contains Ea, Eb, Ec. This circle is called the nine-point circle of triangle ABC. Its center N is called the nine-point center. Its radius is half of the circumradius of ABC.

35.2 Feuerbach’s theorem

The nine-point circle of a triangle is tangent internally to the incircle, and externally to each of the excircles.

Cb

Ib

Bc

A

Ic

C F c Fb

Fc Bb

I N

B C Ac Aa Ab Fa

Ba

Ca

Ia 35.3 Lewis Carroll’s unused geometry pillow problem 1209

35.3 Lewis Carroll’s unused geometry pillow problem

According to [Rowe], one of the pillow problems Lewis Carroll had at- tempted but did not include in his collection of pillow problems was the following.

Given a triangle ABC, to find, by paper folding, aline ℓ which intersects AC and AB at Y and Z respectively) such that if A′ is the reflection of A in ℓ , then the reflections of B in A′Z and of C in A′Y coincide.

A

Z

W

Y

B C

A′

The point W is both the reflection of B in A′Y , and that of C in A′Z. It follows that A′B = A′W = A′C, and A′ is on the perpendicular bisector of BC. 1210 The nine-point circle

Consider the directed angle ∠BA′C. This is

∠BA′C =∠BA′W + ∠W A′C

=2∠Y A′W +2∠W A′Z

=2∠Y A′Z = 2∠Y AZ − since A′Y AZ is a kite. This means that ∠BA′C = 2∠BAC. The − reflection of A′ in the side BC is therefore the point Q on the perpen- dicular bisector such that ∠BQC = 2∠BAC, which is necessarily the circumcenter O of triangle ABC. We therefore conclude that A′ is the reflection of the circumcenter O in the side BC, and the reflection line ℓ is the perpendicular bisector of the line AA′.

A

O H N

D

B C

A′

Let D be the midpoint BC and H the orthocenter of triangle ABC. In a standard proof of the Euler line theorem, it is established that AH = 2OD, 1 and that the midpoint of OH is the nine-point center of triangle ABC. This means that AH = OA′, and AOA′H is a parallelogram. It follows that the midpoint of AA′ is the same as that of OH, the nine- point center N of triangle ABC. The Lewis Carroll paper-folding line is the perpendicular to AN at N.

1AH = 2 OD = 2R cos A, where R is the circumradius of triangle ABC. · 35.4 Johnson’s theorem 1211

35.4 Johnson’s theorem

Theorem 35.1. Three congruent circles with centers A, B, C have a common point O. The three pairwise intersections (apart from O) lie on a circle congruent to the given ones.

A

C′ B′ O

N

H

B C

A′

Proof. Let A′ =(B) (C), B′ =(C) (A), and C′ =(A) (B), apart from the common point∩ O. ∩ ∩ A′ is the reflection of O in BC. As such, it is the reflection of A in the nine-point center N; similarly for B′ and C′. Therefore, A′B′C′ and ABC are oppositely congruent at N, and their circumcircles are congruent, which are congruent to the given circles. 1212 The nine-point circle

35.5 Triangles with nine-point center on the circumcir- cle

Begin with a circle, center O and a point N on it, and construct a family of triangles with (O) as circumcircle and N as nine-point center. (1) Construct the nine-point circle, which has center N, and passes through the midpoint M of ON. (2) Animate a point D on the minor arc of the nine-point circle inside the circumcircle. (3) Construct the chord BC of the circumcircle with D as midpoint. (This is simply the perpendicular to OD at D). (4) Let X be the point on the nine-point circle antipodal to D. Com- plete the parallelogram ODXA (by translating the vector DO to X). The point A lies on the circumcircle and the triangle ABC has nine- point center N on the circumcircle. Here is a curious property of triangles constructed in this way: let A′, B′, C′ be the reflections of A, B, C in their own opposite sides. The reflection triangle A′B′C′ degenerates, i.e., the three points A′, B′, C′ are collinear. 2

Exercise 1. Let H be the orthocenter of triangle ABC. Show that the Euler lines of triangles ABC, HBC, HCA and HAB are concurrent. 3 2. For what triangles is the Euler line parallel (respectively perpendic- ular) to an angle bisector? 4 3. Let P be a point on the circumcircle. What is the locus of the midpoint of HP ? Why?

2O. Bottema, Hoofdstukken uit de Elementaire Meetkunde, Chapter 16. 3Hint: find a point common to them all. 4The Euler line is parallel (respectively perpendicular) to the bisector of angle A if and only if α = 120◦ (respectively 60◦). Chapter 36

The excircles

36.1 A relation among the radii

ra + rb + rc =4R + r.

Ib

M A

Ic rb

O rc I r D

B C

M ′ ra

Ia

r r =2DM ′, a − r + r =2MD = 2(2R DM ′); b c − r + r + r r =4R. a b c − 1214 The excircles

36.2 The circumcircle of the excentral triangle

The circle through the excenters has center at the reflection of the incen- ter in the circumcenter, and radius twice the circumradius.

Ib

A

Ic

O O′ I

B C D X′

Ia

O′Ia =ra + O′X′ =r +2OD r a − =r + 2(R DM ′) r (from previous page) a − − =r +2R (r r) r a − a − − =2R.

Similarly, O′Ib = O′Ic =2R. 36.3 The radical circle of the excircles 1215

36.3 The radical circle of the excircles

The circle orthogonal to each of the excircles has center at the Spieker 1 √ 2 2 point, the incenter of the medial triangle. Its radius is 2 r + s .

A

I I′

B C 1216 The excircles

36.4 Apollonius circle: the circular hull of the excircles

Fc′

A

Fa′

F c Fb

I′ N

B C Fa

fb′ 36.5 Three mutually orthogonal circles with given centers 1217

36.5 Three mutually orthogonal circles with given cen- ters

Given three points A, B, C that form an acute-angled triangle, construct three circles with these points as centers that are mutually orthogonal to each other.

Y A

E

Z H F

B D C

X Solution. Let BC = a, CA = b, and AB = c. If these circles have radii ra, rb, rc respectively, then

2 2 2 2 2 2 2 2 2 rb + rc = a , rc + ra = b , ra + rb = c . From these, 1 1 1 r2 = (b2+c2 a2), r2 = (c2 +a2 b2), r2 = (a2+b2 c2). a 2 − b 2 − c 2 − These are all positive since ABC is an acute triangle. Consider the perpendicular foot E of B on AC. Note that AE = c cos A, so that 2 1 2 2 2 ra = 2 (b + c a ) = bc cos A = AC AE. It follows if we extend BE to intersect− at Y the semicircle constructed· externally on the side 2 2 AC as diameter, then, AY = AC AE = ra. Therefore we have the following simple construction of these· circles. (1) With each side as diameter, construct a semicircle externally of the triangle. (2) Extend the altitudes of the triangle to intersect the semicircles on the same side. Label these X, Y , Z on the semicircles on BC, CA, AB respectively. These satify AY = AZ, BZ = BX, and CX = CY . (3) The circles A(Y ), B(Z) and C(X) are mutually orthogonal to each other. Chapter 37

The Arbelos

37.1 Archimedes’ twin circle theorem

Theorem 37.1. The two circles each tangent to CP , the largest semi- circle AB and one of the smaller semicircles have equal radii t, given by ab t = . a + b

Q

A O1 O P O2 B A O1 O P O2 B

Proof. Consider the circle tangent to the semicircles O(a + b), O1(a), and the line P Q. Denote by t the radius of this circle. Calculating in two ways the height of the center of this circle above the line AB, we have (a + b t)2 (a b t)2 =(a + t)2 (a t)2. − − − − − − From this, ab t = . a + b The symmetry of this expression in a and b means that the circle tangent to O(a + b), O2(b), and P Q has the same radius t. 1302 The Arbelos

37.2 Incircle of the arbelos

Theorem 37.2 (Archimedes). The circle tangent to each of the three semicircles has radius given by ab(a + b) ρ = . a2 + ab + b2

C

X

Y

A O1 O P O2 B

Proof. Let ∠COO2 = θ. By the cosine formula, we have (a + ρ)2 = (a + b ρ)2 + b2 +2b(a + b ρ) cos θ, (b + ρ)2 = (a + b − ρ)2 + a2 2a(a + b− ρ) cos θ. − − − Eliminating θ, we have a(a + ρ)2 + b(b + ρ)2 =(a + b)(a + b ρ)2 + ab2 + ba2. − The coefficients of ρ2 on both sides are clearly the same. This is a linear equation in ρ:

a3 + b3 + 2(a2 + b2)ρ =(a + b)3 + ab(a + b) 2(a + b)2ρ, − from which

4(a2 + ab + b2)ρ =(a + b)3 + ab(a + b) (a3 + b3)=4ab(a + b), − and ρ is as above. 37.2 Incircle of the arbelos 1303

Theorem 37.3 (Leon Bankoff). If the incircle C(ρ) of the arbelos touches the smaller semicircles at X and Y , then the circle through the points P , X, Y has the same radius as the Archimedean circles.

Z

C

X

Y

A O1 O P O2 B

Proof. The circle through P , X, Y is clearly the incircle of the triangle CO1O2, since

CX = CY = ρ, O1X = O1P = a, O2Y = O2P = b.

The semiperimeter of the triangle CO1O2 is ab(a + b) (a + b)3 a + b + ρ =(a + b)+ = . a2 + ab + b2 a2 + ab + b2 The inradius of the triangle is given by

abρ ab ab(a + b) ab = · = . sa + b + ρ s (a + b)3 a + b This is the same as t, the common radius of Archimedes’ twin circles. 1304 The Arbelos

37.2.1 Construction of incircle of arbelos

Let Q1 and Q2 be the “highest” points of the semicircles O1(a) and O2(b) respectively. The intersection of O1Q2 and O2Q1 is a point C3 “above” ab P , and C3P = a+b = t. This gives a very easy construction of Bankoff’s circle in Theorem 37.3 above. From this, we obtain the points X and Y . The center of the incircle of the arbelos is the intersection C of the lines O1X and O2Y . The incircle of the arbelos is the circle C(X). It touches the largest semicircle of the shoemaker at Z, the intersection of OC with this semicircle.

Z

C Q1

X Q2

Y C3

A O1 O P O2 B

Note that C3(P ) is the Bankoff circle, which has the same radius as the Archimedean circles.

37.3 Archimedean circles in the arbelos

Let UV be the external common tangent of the semicircles O1(a) and O2(b), which extends to a chord HK of the semicircle O(a + b). Let C4 be the intersection of O1V and O2U. Since

O1U = a, O2V = b, and O1P : PO2 = a : b, ab C4P = a+b = t. This means that the circle C4(t) passes through P and touches the common tangent HK of the semicircles at N. Let M be the midpoint of the chord HK. Since O and P are sym- metric (isotomic conjugates) with respect to O1O2,

OM + P N = O1U + O2V = a + b. it follows that (a + b) QM = P N =2t. From this, the circle tangent to HK and the minor− arc HK of O(a + b) has radius t. This circle touches the minor arc at the point Q. 37.3Archimedeancirclesinthearbelos 1305

C5 H U

M N

V

K

C4

A O1 O P O2 B

Theorem 37.4 (Thomas Schoch). The incircle of the curvilinear triangle bounded by the semicircle O(a+b) and the circles A(2a) and B(2b) has ab radius t = a+b .

S

A O1 O P O2 B Proof. Denote this circle by S(x). Note that SO is a median of the triangle SO1O2. By Apollonius theorem, (2a + x)2 + (2b + x)2 = 2[(a + b)2 +(a + b x)2]. − From this, ab x = = t. a + b

Exercise

(1) The circles (C1) and (C1′ ) are each tangent to the outer semicircle of the arbelos, and to OQ1 at Q1; similarly for the circles (C2) and (C2′ ). 1306 The Arbelos

ab Show that they have equal radii t = a+b .

C1

C2 Q1

C1′ Q2

C2′

A O1 O P O2 B

(2) We call the semicircle with diameter O1O2 the midway semicircle of the arbelos. Show that the circle tangent to the line P Q and with center at the ab intersection of (O1) and the midway semicircle has radius t = a+b . Q

C

C′

A O1 O P O2 B (3) Show that the radius of the circle tangent to the midway semi- circle, the outer semicircle, and with center on the line P Q has radius ab t = a+b .

Q

C

A O1 O P O2 B 37.4 Constructions of the incircle 1307

37.4 Constructions of the incircle

L Z L Z O M 3 O M 3 N N X Y X Y S

A O1 O P O2 B A O1 O P O2 B

Z

O3

M′ X Y L Z

A B N′ O O P O 1 2 O M 3

N

X Y

A O O P O B L′ 1 2 1308 The Arbelos Chapter 38

Menelaus and Ceva theorems

38.1 Menelaus’ theorem

Theorem 38.1 (Menelaus). Given a triangle ABC with points X, Y , Z on the side lines BC, CA, AB respectively, the points X, Y , Z are collinear if and only if BX CY AZ = 1. XC · Y A · ZB −

A

Y

Z

W

X B C

Proof. (= ) Let W be the point on AC such that BW//XY . Then, ⇒ BX WY AZ AY = , and = . XC YC ZB Y W It follows that BX CY AZ WY CY AY CY AY WY = = = 1. XC · Y A · ZB YC · Y A · Y W YC · Y A · Y W − 1310 Menelaus and Ceva theorems

( =) Suppose the line joining X and Z intersects AC at Y ′. From above,⇐ BX CY AZ BX CY AZ ′ = 1= . XC · Y ′A · ZB − XC · Y A · ZB It follows that CY CY ′ = . Y ′A Y A The points Y ′ and Y divide the segment CA in the same ratio. These must be the same point, and X, Y , Z are collinear. Example 38.1. The external angle bisectors of a triangle intersect their opposite sides at three collinear points.

Y ′

A

c b

C

B X′ a

Z′

Proof. If the external bisectors are AX′, BY ′, CZ′ with X′, Y ′, Z′ on BC, CA, AB respectively, then BX c CY a AZ b ′ = , ′ = , ′ = . X′C −b Y ′A − c Z′B −a BX′ CY ′ AZ′ It follows that X′C Y ′A Z′B = 1 and the points X′, Y ′, Z′ are collinear. · · − 38.2 Ceva’s theorem 1311

38.2 Ceva’s theorem

Theorem 38.2 (Ceva). Given a triangle ABC with points X, Y , Z on the side lines BC, CA, AB respectively, the lines AX, BY , CZ are concurrent if and only if BX CY AZ = +1. XC · Y A · ZB

A

Z

Y

P

B X C Proof. (= ) Suppose the lines AX, BY , CZ intersect at a point P . Consider the⇒ line BPY cutting the sides of triangle CAX. By Menelaus’ theorem, CY AP XB CY P A BX = 1, or = +1. Y A · PX · BC − Y A · XP · BC

Also, consider the line CPZ cutting the sides of triangle ABX. By Menelaus’ theorem again, AZ BC XP AZ BC XP = 1, or = +1. ZB · CX · P A − ZB · XC · P A

Multiplying the two equations together, we have CY AZ BX = +1. Y A · ZB · XC

( =) Exercise. ⇐ 1312 Menelaus and Ceva theorems

Example 38.2. (1) The centroid. If D, E, F are the midpoints of the sides BC, CA, AB of triangle ABC, then clearly AF BD CE =1. F B · DC · EA The medians AD, BE, CF are therefore concurrent. Their intersection is the centroid G of the triangle. A

F E G

B D C Consider the line BGE intersecting the sides of triangle ADC. By the Menelaus theorem, AG DB CE AG 1 1 1= = − . − GD · BC · EA GD · 2 · 1 It follows that AG : GD =2:1. The centroid of a triangle divides each median in the ratio 2:1. (2) The incenter. Let X, Y , Z be points on BC, CA, AB such that AX, BY , CZ bisect angles BAC, CBA and ACB respectively. Then AZ b BX c CY a = , = , = . ZB a XC b Y A c

A

Y Z I

B X C It follows that AZ BX CY b c a = = +1, ZB · XC · Y A a · b · c and AX, BY , CZ are concurrent. Their intersection is the incenter of the triangle. 38.2 Ceva’s theorem 1313

5π π π (3) In triangle ABC, A = 8 , B = 4 , and C = 8 . Prove that the A-altitude, the B-bisector, and the C-median are concurrent.

A

Y

Z

B X C Solution. Suppose AX = 1. Consider the two squares AXBP and AXTY .

P A Q

Y

Z

B X T C Note that triangle AT C is isosceles since ∠T AC = ∠AT X ∠ACB = π π = π = C. Therefore, − 4 − 8 8 BX 1 = , XC 1+ √2 CY BC 2+ √2 = = =1+ √2. Y A BA √2 Since Z is the midpoint of AB, BX CY AZ =1. XC · Y A · ZB The three lines AX, BY , CZ are concurrent by Ceva’s theorem. 1314 Menelaus and Ceva theorems

Exercise 1. Given triangle ABC with a = 15, b = 14, c =9. (a) Find points X on BC, Y on CA, and Z on AB such that BX = CY = AZ and AX, BY , CZ are concurrent. (b) Find also points X′ on BC, Y ′ on CA, and Z′ on AB such that X′C = Y ′A = Z′B and AX′, BY ′, CZ′ are concurrent.

A A

Z′ Q Y ′ Y Z

P

B X C B C X′

2. ABC is a right triangle. Show that the lines AX, BY , and CQ are concurrent.

X′

Y ′

X

C

Y

A B P

Z Q Z′ 38.2 Ceva’s theorem 1315

3. ABC is a triangle with BC = 12, CA = 13, and AB = 15. Show that the median AD, angle bisector BE, and the altitude CF are concurrent. C

E D

P

B F A 4. Given three circles with centers A, B, C and distinct radii, show that the exsimilicenters of the three pairs of circles are collinear.

A

B Z

C

Y

X 1316 Menelaus and Ceva theorems Chapter 39

Routh and Ceva theorems

39.1 Barycentric coordinates

In a given triangle ABC, every point P is coordinatized by a triple of numbers (x : y : z) in such a way that the system of masses x at A, y at B, and z at C will have its balance point at P . A mass y at B and a mass z at C will balance at the point X on the line BC. A mass x at A and a mass y + z at X will balance at the point P . (y + z)X = yB + zC, (x + y + z)P = xA +(y + z)X = xA + yB + zC.

We say that with reference to triangle ABC, the point P has xA + yB + zC (i) absolute barycentric coordinate and x + y + z (ii) homogeneous barycentric coordinates (x : y : z).

A(mass x) A(mass x)

Y Z

P balance P balance

B(mass y) C(mass z) B X(mass y + z) C 1318 Routh and Ceva theorems

39.2 Cevian and traces

Let P be a point with homogeneous barycentric coordinates (x : y : z) with reference to triangle ABC. The three lines joining a point P to the vertices of the reference triangle ABC the cevians of P . The intersections X, Y , Z of these cevians with the side lines are called the traces of P . The coordinates of the traces can be very easily written down:

X =(0: y : z),Y =(x : 0 : z), Z =(x : y : 0).

A

Y

Z

P

B X C

Theorem 39.1 (Ceva theorem). Three points X, Y , Z on BC, CA, AB respectively are the traces of a point if and only if they have coordinates of the form X = 0 : y : z, Y = x : 0 : z, Z = x : y : 0, for some x, y, z. 39.2 Cevian and traces 1319

Example 39.1. The centroid. The midpoint points of the sides have coordinates

X = (0:1:1), Y = (1:0:1), Z = (1:1:0). The centroid G has coordinates (1:1:1).

A

Z Y

G

B X C

Example 39.2. The incenter

A

Y

Z I

B X C The traces of the incenter have coordinates

X = (0: b : c), Y = (a : 0 : c), Z = (a : b : 0). The incenter I has coordinates I =(a : b : c). 1320 Routh and Ceva theorems

39.3 Area and barycentric coordinates

Theorem 39.2. If in homogeneous barycentric coordinates with refer- ence to triangle ABC, P =(x : y : z), then ∆PBC : ∆AP C : ∆ABP = x : y : z.

A(mass x)

Y

Z

P balance

B X(mass y + z) C

Proof. Consider the trace X of P on BC. Since a mass x at A and a mass y + z at X balance at P , AP : PX = y + z : x, and PX : AX = x : x + y + z. It follows that

∆PBC : ∆ABC = PX : AX = x : x + y + z.

Similarly, ∆AP C : ∆ABC = y : x + y + z and ∆ABP : ∆ABC = z : x + y + z. Combining these, we have

x : y : z = ∆PBC : ∆AP C : ∆ABP.

Because of this theorem, homogeneous barycentric coordinates are also known as areal coordinates. 39.3Areaandbarycentriccoordinates 1321

A useful area formula If for i = 1, 2, 3, P = x A + y B + z C (in absolute barycentric i i · i · i · coordinates), then the area of the oriented triangle P1P2P3 is

x1 y1 z1 ∆P P P = x y z ∆ABC. 1 2 3 2 2 2 · x3 y3 z3

Example 39.3. Let X, Y , Z be points on BC, CA, AB such that BX : XC =2:1, CY : Y A =5:3, AZ : ZB =3:2. (The numbers indicated along the lines are proportions of lengths, and are not actual lengths).

A

3

3 Y

Z 5

2

B 2 X 1 C Their homogeneous barycentric coordinates are X =0:1:2, Y = 3:0:5, and Z =2:3:0. 0 1 2 1 1 1 28 7 ∆XYZ = 3 0 5 ∆ABC = ∆ABC = ∆ABC. 3 · 8 · 5 120 30 2 3 0

1322 Routh and Ceva theorems

Example 39.4. With the same points X, Y , Z in the preceding example, the lines AX, BY , CZ bound a triangle P QR. Suppose triangle ABC has area ∆. Find the area of triangle P QR.

A

3

3

Y

R

Z 5

P 2 Q

B 2 X 1 C We have already known the coordinates of X, Y , Z. From these, it is easy to find those of P , Q, R:

P = BY CZ Q = CZ AX R = AX BY ∩ ∩ ∩ Y =(5:0:3) Z =(2:3:0) X =(0:1:2) Z =(2:3:0) X =(0:1:2) Y =(5:0:3) P =(10:15:6) Q =(2:3:6) R =(10:3:6)

This means that the absolute barycentric coordinates of X, Y , Z are

1 1 1 P = (10A + 15B + 6C),Q = (2A + 3B + 6C), R = (10A + 3B + 6C). 31 11 19

The area of triangle P QR 10 15 6 1 576 = 2 3 6 ∆= ∆. 31 11 19 · 6479 10 3 6 · ·

39.3Areaandbarycentriccoordinates 1323

Exercise

1. ABC is a triangle of area 1, and A1, A2, B1, B2, C1, C2 are the points of trisection of BC, CA and AB respectively. Which of the two areas is larger, the one bounded by three lines AA1, BB1, CC1 or the one bounded by the four lines BB1, BB2, CC1, CC2?

A A

C1 C1 B2

B1 C2 B1

B C B C A1

2. Let X, Y , Z be points dividing BC, CA, AB in the golden ratio. Let P be the intersection of BY and CZ, Q that CZ and AX, and R that of AX and BY . Show that (i) P , Q, R are respectively the midpoints of BY , CZ, AX; (ii) P divides QC in the golden ratio; so do Q and R divide RA and P B. (iii) Compare the areas of triangles XYZ and P QR. 1

1Crux Math. Problem 3609. Answer: 4. Chapter 40

Elliptic curves

40.1 A problem from Diophantus

Problem IV.24 of Diophantus’ Arithmetica: To divided a given number into two parts such that the product is a cube minus its side. Solution. Given number 6. First part x; therefore second = 6 x, and 6x x2 = a cube minus its side. Form a cube from a side of− the form mx− 1, say, 2x 1, and equate 6x x2 to this cube minus its side. Therefore,− 8x3 −12x2 +4x = 6x −x2. Now, if the coefficient of x were the same− on both sides, this would− reduce to a simple equation, amd x would be rational. In order that this may be the case, we must put m for 2 in our assumption, where 3m m = 6 (the 6 being the given number in the original hypothesis). Thus,− m = 3. We therefore assume (3x 1)3 (3x 1)=6x x3, or 27x3 27x2 +6x =6x x2, and −26 − − 26 −136 − − x = 27 . The parts are 27 and 27 . Remark. This problem seeks rational solutions of the equation

y3 y =6x x2. − −

Clearly, (0, 1) is a rational Solution. The line through P (0, 1) with slope m (assumed− rational) has equation y = mx 1. This− line cuts the curve E : y3 y = x2 6x at three points, one− of which is (0, 1). − − − In general, there is no guarantee that any of the remaining two points is rational. However, if this line is tangent to E, then the point of tan- gency being counted twice, it is clear that the remaining point is rational. 1402 Elliptic curves

T Q

R

P

S

The tangent to E at P (0, 1) turns out to be y =3x 1 (exercise), and 26 17 − − we obtain Q( 27 , 9 ) for the third point.

Exercise 1. Note that R(0, 1) is also a point on the curve E : y3 y =6x x2. Find the coordinates of the intersection S of E with− the tangent− at R. Answer. 28 , 19 . − 27 − 9 2. Find the intersection of the curve E with the line PS. 378 56 Answer. 125 , 25 . 3. Use the method of Arithmetica IV.24 to find a rational point on y2 = x3 +2, starting with ( 1, 1). 17 71 − Answer. ( 4 , 8 ). 40.2Dudeney’spuzzleofthedoctorofphysic 1403

40.2 Dudeney’s puzzle of the doctor of physic

The Doctor of physic produced two spherical phials, and pointed out that one phial was exactly one foot in circumference, and the other two feet in circumference. “I do wish,” said the Doctor, “to have the exact measures of two other phials, of a like shape but different in size, that may together contain just as much liquid as is contained by these two”. This is solving the equation x3 + y3 =13 +23 in rational numbers.

B

A

D

C

Beginning with the point A(1, 2), by the method of tangents we ob- tain 17 20 B = , , − 7 7   188479 36520 C = , , 90391 −90391   1243617733990094836481 487267171714352336560 D = , . 609623835676137297449 609623835676137297449   Since the coordinates of D are both positive, they give a solution to the puzzle of the Doctor of physic. 1404 Elliptic curves

Exercise Here is Dudeney’s silver cubes puzzle: Master Herbert brought with him two cubes of solid silver that be- longed to his mother. He showed that, as they measured two inches every way, each contained eight cubic inches of silver, and therefore the two contained together sixteen cubic inches. He wanted to know: could anybody give him exact dimensions for two cubes that should together contain just seventeen cubic inches of silver? This amounts to find a positive rational solution of x3 + y3 = 17.

1. Verify that 183 13 = 17 73 and find a pointon the curve x3 +y3 = 17 with rational− coordinates.· 2. Make use of the point in (1) above to find a point on the curve x3 + y3 = 17 with positive rational coordinates.

40.3 Group law on y2 = x3 + ax2 + bx + c

Consider an elliptic curve

(E) y2 = f(x) := x3 + ax2 + bx + c.

We shall write a point P on (E) in the form P =(x[P ], y[P ]), and put the identity at a point of infinity, so that

y[ P ]= y[P ]. − −

P

Q P Q ∗

P + Q 40.3 Group law on y2 = x3 + ax2 + bx + c 1405

Consider a line of slope m passing through P . It has equation y y[P ] = m(x x[P ]). It intersects the elliptic curve (E) at points whose− x-coordinates− are the roots of the equation (mx +(y[P ] mx[P ]))2 = x3 + ax2 + bx + c, − or equivalently, x3 (m2 a)x2 (2m(y[P ] mx[P ]) b)x+c (y[P ] mx[P ])2 =0. − − − − − − −

Since the sum of the three roots of the cubic is m2 a, we make the following conclusions. − (1) If the line is the tangent at P , then f ′(x[P ]) (i) m = 2y[P ] , (ii) the third intersection has x-coordinate f (x[P ])2 m2 a 2x[P ]= ′ a 2x[P ] − − 4y[P ]2 − − x[P ]4 2bx[P ]2 8cx[P ]+(b2 4ac) = − − − 4y[P ]2 x[P ]4 2bx[P ]2 8cx[P ]+(b2 4ac) = − − − . 4(x[P ]3 + ax[P ]2 + bx[P ]+ c) The y-coordinate can be computed from the equation of the line.

x[P ]4 2bx[P ]2 8cx[P ]+(b2 4ac) x[2P ]= − − − . 4(x[P ]3 + ax[P ]2 + bx[P ]+ c)

(2) If the line joins two points P1 and P2 on (E), then y[P1] y[P2] (i) m = − ; x[P1] x[P2] (ii) the third− intersection has x-coordinate m2 a x[P ] x[P ] − − 1 − 2 y[P ] y[P ] 2 = 1 − 2 a (x[P ]+ x[P ]) x[P ] x[P ] − − 1 2  1 − 2  x[P ]x[P ](x[P ]+ x[P ]+2a)+ b(x[P ]+ x[P ])+2c 2y[P ]y[P ] = 1 2 1 2 1 2 − 1 2 . (x[P ] x[P ])2 1 − 2 The y-coordinate can be computed from the equation of the line. 1406 Elliptic curves Chapter 41

Applications of elliptic curves to geometry problems

41.1 Pairs of isosceles triangle and rectangle with equal perimeters and equal areas

The isosceles (5, 5, 6) and the rectangle 6 2 both have perimeter 16 and area 12. × More generally, we seek an isosceles triangle and a rectangle, both with integer sidelengths and have equal perimeters and equal areas. An isosceles triangle with sides (m2 + n2, m2 + n2, 2(m2 n2) has perimeter 4m2, height 2mn, and area 2mn(m2 n2). A rectangle− of integer dimensions p q has the same perimeter and− area as the triangle if and only if ×

p + q =2m2, pq =2mn(m2 n2). − Note that (p q)2 =(p + q)2 4pq =4m4 8mn(m2 n2). If weput − − − − 2n p q x = , y = − , m m2 this condition becomes

y2 = x3 4x +4. − 1408 Applications of elliptic curves to geometry problems

2n (1) Clearly, the point (1, 1) is on the curve. With 1 = m , we take m = 2, n = 1. This gives the isosceles triangle (5, 5, 6) and rectangle 6 2 as above. ×(2) There is another obvious point P = (2, 2). Indeed, on the elliptic curve 2P = (0, 2), 3P =( 2, 2), 4P = (1, 1). − − − k kP (m, n) side and base p q perimeter, area ± × 4 (1, 1) (2, 1) 5, 6 2 6 (16, 12) − × 7 10 , 26 (9, 5) 106, 112 42 120 (324, 5040) 9 27 × 10 88 , 554 (49, 44) 4337, 930 462 4340 (9604, 2005080) − 49 343 × 13 206 , 52894 (961, 103) 934130, 1825824 103664 1743378 (3694084, 180725536992) 961 29791 × 15 9362 , 1175566 (10609, 4681) 134462642, 181278240 52009232 173092530 − 10609 1092727 ×  41.2 Triangles with a median, an altitude, and an angle bisector concurrent 1409

41.2 Triangles with a median, an altitude, and an angle bisector concurrent

Given triangle ABC, the altitude on BC, the bisector of angle B and the median on AB are concurrent if and only if a cos β = . c + a

A

E F

P

B D C c2+a2 b2 By the law of cosines, cos β = 2ca− , we have a3 ab2 a2c b2c + ac2 + c3 =0. − − − By putting a =1, b = x and c = y, we have 1 x2 y x2y + y2 + y3 =0. − − − Clearly, P = (1, 1) is a point on the curve, corresponding to the equi- lateral triangle. On the other hand, with x = 1 the equation becomes y(y 1)(y +2)=0. This gives the point Q =− ( 1, 2) on the curve. − − − 1 The line P Q has equation 3x 2y = 1. Substituting y = 2 (3x 1) − 1 − into the cubic equation, we obtain 8 (x 1)(x + 1)(15x 13) = 0. The −13 4 − line P Q intersects the curve again at 15 , 5 . This yields the triangle (a, b, c) = (15, 13, 12). Further examples are (a, b, c) = (308, 277,35), (3193, 26447, 26598). 1410 Applications of elliptic curves to geometry problems Chapter 42

Integer triangles with an altitude equal to a bisector

42.1 A quartic equation

Consider triangle ABC with altitude AX equal to the bisector BY .

A

Y c

C X′ c B X a

If CB is extended to X′ such that BX′ = BA, then AX′ is parallel to Y B and B AX BY BC a sin = = = = . 2 AX′ AX′ X′C c + a

Since cos B =1 2 sin2 B , by the law of cosines, we have − 2 2a2 b2 = c2 + a2 2ca 1 − − (c + a)2   b2(c + a)2 = (c2 a2)2 +4ca3. − 1412 Integertriangleswithanaltitudeequaltoabisector

We seek integer triangles satisfying this condition. c b(c+a) If we put u = a and v = a2 , this equation becomes

v2 = (u2 1)2 +4u − = u4 2u2 +4u +1. − Note that a : b : c is determined by u and v:

a : b : c =1+ u : v : u(1 + u).

v

O′

P u

Q

Since the geometric problem has an obvious solution (a, b, c)=(1, 1, 1), we have a rational point on the quartic curve, namely, O′ = (1, 2). The tangent at O′ is the line v = u +1. It intersects the curve again at two points, P = (0, 1) and Q = ( 2, 1). None of these points corresponds to a genuine triangle. − − The tangent at P , being the line v = 2u +1, intersects the quartic curve again at two points. These, however, are not rational points. 1 Likewise, the tangent at Q, being the line v = 10u + 19, intersects the curve again at two irrational points.

1These are the points (√6, 1 + 2√6), corresponding to the triangle a : b : c =1+ √6:1+2√6 : 6+ √6. ± 42.2 Transformation of a quartic equation into an elliptic curve 1413

42.2 Transformation of a quartic equation into an el- liptic curve

A quartic equation of the form v2 = u4 +6cu2 +4du + e can be converted into a cubic equation by putting 2u(x + c)= y d, v =2x u2 c. − − − This substitution leads to y2 =4x3 (3c2 + e)x +(c3 + d2 ce). − − y v C

C′ O O′

B

A x u

R

B′

Applying this to the quartic equation v2 = u4 2u2 +4u +1, we have, with c = 1 , d = e =1, − − 3 3(y 1) 1 u = − , v = 2x u2 + , 2(3x 1) − 3 − and 4 35 y2 =4x3 x + . − 3 27 1414 Integertriangleswithanaltitudeequaltoabisector

The point O′ = (u, v) = (1, 2) arising from the equilateral triangle 4 corresponds to a rational point on the cubic curve, namely, O = 3 , 3 . The tangent to the cubic curve at O is the line 9y = 30x 13. It intersects the curve again at R = 1 , 29 . This points corresponds−  9 − 27 to (u, v) = 14 , 191 on the quartic, and does not yield a genuine 3 9  triangle. − 1  1 Now, with x = 3 , we do have a rational point A = 3 , 1 on the cubic curve. This does not correspond to a finite point on the quartic curve. The tangent at A is horizontal. It intersects the cubic  at B = 2 3 , 1 . This corresponds to B′ = (0, 1) on the quartic, which again does− not yield a genuine triangle. − The tangent at B, being the line 6x 3y +7=0, intersects the cubic 7 − 3 11 curve again at C = 3 , 7 . This corresponds to C′ = 2 , 4 on the quartic, and yields the triangle (a, b, c) = (10, 11, 15).   Exercise 1. Find the (third) intersection of the line AR with the cubic curve, and show that it yields the triangle (a, b, c) = (51, 191, 238). 2. Find the intersection of the cubic curve with its tangent at C. Show that the reflection of this intersection in the x-axis yields the trian- gle (a, b, c) = (7469, 8191, 1940). Chapter 43

The equilateral lattice L (n)

43.1 Counting triangles

Consider an equilateral lattice L (n) of order n, consisting of equi- lateral triangles of unit sidelengths, with n unit segments along the base. Let T (n) be the number of equilateral triangles of various sizes in the lattice. Clearly, T (1) = 1, T (2) = 4. Consider L (n) as resulting from L (n 1) by adding a new base line of length n. There are two new types− of triangles added: (1) Upright ones with bases along the bottom line: since there are n+1 n +1 points, there are 2 such triangles. (2) Inverted ones with exactly one vertex on the new base line: there are 1+2+ +2+1such triangles. ··· n 1 terms − n +1 | T (n{z)= T (n } 1) + +1+2+ +2+1 . − 2 ···   n 1 terms − | {z } 1502 The equilateral lattice L (n)

From this, 4 T (3) = T (2) + +1+1=5+6+2=13, 2   5 T (4) = T (3) + +1+2+1=13+10+4=27, 2   6 T (5) = T (4) + +1+2+2+1=27+15+6=48. 2   We shall interpret T (0) = 0 so that this recurrence relation holds for n 1. ≥ Exercise 1. The palindromic sum 1+2+ +2+1, first increasing steadily ··· n 1 terms − 2 n δn by 1 and then decreasing by 1, is equal to − , where | {z } 4 1, if n is odd, δn = . (0, if n is even.

2. With δn defined above, show that n n + δ δ = n . k 2 k X=1 3. Define 1, if n is even, εn = . (0, if n is odd. Show that n n 1+ ε ε = − n . k 2 k X=1 Therefore, n +1 n2 δ 3n2 +2n δ T (n) T (n 1) = + − n = − n , − − 2 4 4   and 43.1 Counting triangles 1503

n T (n)= T (0) + (T (k) T (k 1)) − − k=1 n X 3k2 +2k δ = − k 4 k X=1 1 n(n + 1)(2n +1)+ n(n + 1) n+δn = 2 − 2 4 n(n + 2)(2n + 1) δ = − n . 8 Here are some of the beginning values:

n 1 2 3 4 5 6 7 8 9 10 11 12 T (n) 1 5 13 27 48 78 118 170 235 315 411 525 ··· ··· 1504 The equilateral lattice L (n)

43.2 Counting parallelograms

Let P (n) be the number of parallelograms in the lattice L (n). Clearly, P (1) = 0, and P (2) = 3. Each parallelogram is determined uniquely by the endpoints of a long diagonal, which do not lie on a line parallel to any sides of the equilateral n+2 triangle. There are 2 points in the lattice. The three lines through each point altogether contain 2n +1 points. The number of parallelo- grams  1 n +2 n +2 P (n)= (2n + 1) 2 2 2 −      1 = (n + 2)(n + 1)n(n 1) 8 − n +2 = 3 . 4  

n 2 3 4 5 6 7 8 9 10 P (n) 3 15 45 105 210 378 630 990 1485 ··· ···

Exercise 1. Show that P (n) is the 1 (n 1)(n + 2)-th triangular number. 2 − 43.3 Counting regular hexagons 1505

43.3 Counting regular hexagons

Let H(n) be the number of regular hexagons in the lattice L (n). Clearly, H(1) = H(2) = 0, and H(3) = 1. Removing the perimeter of the outermost equilateral triangle and the unit segments connected to it, we are left with the lattice L (n 3). Each vertex in L (n 3) is the center of a unique regular hexagon− with one or more edges along− the n 1 perimeter excised. There are −2 such regular hexagon, and none of these belong to the lattice L (n 3). Therefore, −  n 1 H(n) H(n 3) = − . − − 2   Here we interpret H(0) = 0. (i) n =3k.

k H(3k)= H(0) + H(3j) H(3(j 1)) − − j=1 X k 3j 1 = − 2 j=1 X   k 1 = (3j 1)(3j 2) 2 − − j=1 X = ··· 1 = k(3k2 1). 2 − 1506 The equilateral lattice L (n)

(ii) n =3k +1:

k H(3k +1)= H(1) + H(3j + 1) H(3j 2)) − − j=1 X k 3j = 2 j=1 X   = ··· 3 = k2(k + 1). 2 (iii) n =3k +2:

k H(3k +2)= H(2) + H(3j + 2) H(3j 1)) − − j=1 X k 3j +1 = 2 j=1 X   = ··· 3 = k(k + 1)2. 2 Summary:

1 n(n2 3), if n 0 (mod3), 18 − ≡ H(n)= 1 (n 1)2(n + 2), if n 1 (mod3),  18 − ≡  1 (n + 1)2(n 2), if n 2 (mod3). 18 − ≡  n 3 4 5 6 7 8 9 10 11 H(n) 1 3 6 11 18 27 39 54 72 ··· ··· 43.3 Counting regular hexagons 1507

Exercise 1. In the following diagram, there are n small squares along each row and each column. How many squares of all sizes are there?

2. In the following diagram, there are a small squares along each col- umn and b small squares along each row. Given a b, how many squares of all sizes are there? ≤ 1508 The equilateral lattice L (n) Chapter 44

Counting triangles

44.1 Integer triangles of sidelengths n ≤ For a given integer n 1, denote by a(n) the number of triangles with sidelengths which are≥ integers n. Clearly, a(1) = 1. For n 2, the difference a(n) a(n 1)≤is the number of triangles with longest≥ sidelength n. This is− the number− of lattice points (a, b) in the region

(a, b): 1 a b n, a + b > n . { ≤ ≤ ≤ }

b

n

n a 0 1 A simple counting shows that

2 if n is even, a(n) a(n 1) = n +(n 2) + + − − − ··· (1 if n is odd 1 = ((n + 1)2 ε ), 4 − n 1510 Counting triangles where 1, if n is even, εn := (0, if n is odd. Therefore,

n a(n)= a(0) + (a(k) a(k 1)) − − k=1 n X 1 = ((k + 1)2 ε(k)) 4 − k X=1 1 1 n 1+ ε = (n + 1)(n + 2)(2n + 3) 1 − n 4 6 − − 2   1 1 ε = (n + 1)(n + 3)(2n + 1) n 4 6 − 2   1 (n + 1)(n + 3)(2n + 1) = . 4⌊ 6 ⌋ Here are some of the beginning values:

n 1 2 3 4 5 6 7 8 9 10 a(n) 1 3 7 13 22 34 50 70 95 125 ··· ···

44.2 Integer scalene triangles with sidelengths n ≤ A scalene triangle is one whose sidelengths are distinct. We determine the number b(n) of scalene triangles with sidelengths n. Clearly, b(1) = b(2) = b(3) = 0, and b(4) = 1. ≤ Consider a scalene triangle with integer sidelengths ac>b, an impossibility. If a′ = a 1, b′ = b 2, c′ = c 3, then (a, b, c) (a′, b′,c′) is a one-one correspondence− between− such− scalene triangles↔ of sidelengths n and integer triangles of sidelengths n +3. It follows that for n ≤3, ≤ ≥ b(n)= a(n + 3). 44.3 Number of integer triangles with perimeter n 1511

44.3 Number of integer triangles with perimeter n

44.3.1 The partition number p3(n) The number of ways of writing a positive integer n as a sum of two positive integers is n n δ p (n) := (a, b):1 a b, a + b = n = = − n . 2 |{ ≤ ≤ }| ⌊ 2 ⌋ 2

We shall also make use of p2′ (n), the number of ways of writing a nonnegative integer n as a sum of two nonnegative integers. This is

n +1 n +1+ εn p′ (n) := (a, b):0 a b, a + b = n = = . 2 |{ ≤ ≤ }| ⌈ 2 ⌉ 2

Making use of this, we compute the number of partitions of n into a sum of three positive integer. Note that the smallest summand must be n 3 . ≤ ⌊ ⌋ n ⌊ 3 ⌋ p (n)= p′ (n 3a). 3 2 − a=1 X We distinguish between the following cases. (1) n =3k: k ′ p3(3k)= p2(3(k − a)) a=1 X k−1 ′ = p2(3j) j=0 X k−1 1 = (3j +1+ ε3j ) 2 j=0 X k−1 1 1 1 = · k(1+3(k − 1) + 1) + εj 2 2 2 j=0 X 1 k + 1 − ε = k(3k − 1) + k 4 4 1 2 = 3k + 1 − εk 4 1 n2  = + 1 − εn 4 3   n2 δ = + n . 12 4 1512 Counting triangles

(2) n =3k +1:

k ′ p3(3k +1) = p2(3(k − a)+1) a=1 X k−1 ′ = p2(3j + 1) j=0 X k−1 1 = (3j +2+ ε3j+1) 2 j=0 X k−1 1 = (3j +2+ δj ) 2 j=0 X k−1 1 1 1 = · k(2+3(k − 1) + 2) + δj 2 2 2 j=0 X 1 k − δ = k(3k +1)+ k 4 4 1 = 3k2 + 2k − δ 4 k 1 1 2  = (n − 1) − εn 4 3   2 n 3+ εn = − . 12 12 44.3 Number of integer triangles with perimeter n 1513

(3) n =3k +2:

k ′ p3(3k +2) = p2(3(k − a)+2) a=1 X k−1 ′ = p2(3j + 2) j=0 X k−1 1 = (3j +3+ ε3j+2) 2 j=0 X k−1 1 = (3j +3+ εj ) 2 j=0 X k−1 1 3 1 = · k(k +1)+ εj 2 2 2 j=0 X 1 k + 1 − ε = · 3k(k +1)+ k 4 4 1 = 3k2 + 4k + 1 − ε 4 k 1 1 2  = (n − 1) − εn 4 3   2 n 3+ εn = − . 12 12

n2 In all three cases, the difference between p3(n) and 12 is no more 1 n2 than 3 . Therefore, p3(n) is the integer nearest to 12 . For a real number x (which is not a half-integer, i.e., 2x is not an integer, let x denote the integer nearest to x. Thus, √2 = 1 and √3 =2. { } { } { } n2 Summary: p3(n)= 12 . n o 1514 Counting triangles

Theorem 44.1. The number of integer triangles with perimeter n is

n2 48 , if n is even, c(n)= n o  (n+3)2  48 , if n is odd. n o Proof. The number of triangles of perimeter n is p3(n), subtracting the number of those partitions a b c with c a+b = n c, i.e., c n : ≤ ≤ ≤ − ≤ 2 n ⌊ 2 ⌋ c(n)= p (n) p (c). 3 − 2 c=1 X Note that

h h 1 p (c)= (c δ ) 2 2 − c c=1 c=1 X X 1 1 h δ = h(h + 1) − h 2 2 − 2   1 = h2 + δ . 4 h  n ⌊ 2 ⌋ n p3(n) c=1 p2(c) c(n) n2 n2 n2 12k 12 16 48 P 2 2 n2 1 (n 1) n2+6n 7 (n+3) 16 − − 12k +1 12− 16 48 − 48 n2 4 n2 4 n2 4 12k +2 12− 16− 48− 2 n2+3 n2 2n 3 n2+6n+21 (n+3) +12 12k +3 12 −16 − 48 48 n2 4 n2 n2 16 12k +4 12− 16 48− 2 2 n2 1 (n 1) n2+6n 7 (n+3) 16 − − 12k +5 12− 16 48 − 48 n2 n2 4 n2+12 12k +6 12 16− 48 2 n2 1 n2 2n 3 n2+6n+5 (n+3) 4 − 12k +7 12− −16 − 48 48 n2 4 n2 n2 16 12k +8 12− 16 48− n2+3 (n 1)2 (n+3)2 − 12k +9 12 16 48 n2 4 n2 4 n2 4 12k + 10 12− 16− 48− n2 1 n2 2n 3 n2+6n+5 (n+3)2 4 − 12k + 11 12− −16 − 48 48 44.3 Number of integer triangles with perimeter n 1515

From the alternatives to c(n) given in the rightmost column, it is clear n2 (n+3)2 that the difference between c(n) and 48 for even n (and 48 for odd n) 2 1 n2 (n+3) is no more than 3 . Therefore c(n) is the integer nearest to 48 or 48 according as n is even or odd.

n 1 2 3 4 5 6 7 8 9 10 11 12 c(n) 0 0 1 0 1 1 2 1 3 2 4 3 n 13 14 15 16 17 18 19 20 21 22 23 24 c(n) 5 4 7 5 8 7 10 8 12 10 14 12 1516 Counting triangles Bibliography

[1] I. Adler, Make up your own card tricks, Journal of Recreational Math., 6 (1973) 87–91. [2] I. Affleck and H. L. Abbott, Problem 1884, Crux Math., 19 (1993) 264; solution, 20 (1994) 231–233. [3] M. Aigner and G. M. Ziegler, Proofs from the BOOK, Springer, 1998. [4] U. Alfred, On square Lucas numbers, Fibonacci Quarterly, 2 (1964) 11–12. [5] P. R. Allaire and A. Cupillari, Artemis Martin: An amateur math- ematician of the nineteenth century and his contribution to math- ematics, College Math. Journal, 31 (2000) 22–34. [6] G. E. Andrews, A note on partitions and triangles with integer sides, American Math. Monthly, 86 (1979) 477–478. [7] W. S. Anglin, The square pyramid puzzle, American Math. Monthly, 97 (1990) 120–124. [8] T. M. Apostol, A property of triangles inscribed in rectangles, Crux Math., 3 (1977) 242–244. [9] Y. Arzoumanian and W. O. J. Moser, Enumerating 3-, 4-, 6-gons with vertices at lattice points, Crux Math., 19 (1993) 249–254; 279–284. [10] D. F. Bailey, Counting arrangements of 1’s and 1’s, Math. Mag., 69 (1996) 128–131. − [11] W. W. R. Ball and H. S. M. Coxter, Mathematical Recreations and Essays, 13th edition, Dover, 1987. 1518 BIBLIOGRAPHY

[12] S. Beatty et al., Problem 3177, Amer. Math. Monthly, 33 (1926) 159; solution, 34 (1927) 159–160. [13] A. Beiler, Recreations in the Theory of Numbers, Dover, 1963. [14] A. T. Benjamin and J. J. Quinn, Recounting Fibonacci and Lucas identities, College Math. Journal, 30 (1999) 359–366. [15] A. T. Benjamin and J. J. Quinn, Proofs that Really Count: The Art of Combinatorial Proof, Math. Assoc. Math., forthcoming. [16] A. T. Benjamin and J. J. Quinn, The Fibonacci numbers – e [17] A. Bliss et al., Four constants in four 4s, Math. Mag., 74 (2001) 272. [18] A. Bourbeau, H. L. Nelson, et al., Problem 142, Crux Math., 2 (1976) 93; solution, 175–178, 3 (1977) 106–108. [19] A. L. Bouton, Annals of Math., ser. 2, 3 (1902) 33–59. [20] W. G. Brady and C. W. Twigg, Problem 232, Pi Mu Epsilon Jour- nal, 5.2 (1969) 24; solution 5.3 (1970) 139. [21] A. Bremner, Positively prodigious powers or how Dedeney done it? Math. Mag., 84 (2011) 120–125. [22] I. Bruce, Another instance of the golden right triangle, Fibonacci Quarterly, 32 (1994) 232–233. [23] M. Buckheimer and A. Arcavi, Farey series and Pick’s area for- mula, Math. Intelligencer, 17:4 (1993) 64–67. [24] R. H. Buchholz and R. L. Rathbun, An infinite set of Heron tri- angles with two rational medians, American Math. Monthly, 104 (1997) 107–115. [25] P. R. Buckland, The mathematical background of teachers in train- ing, Math. Gazette, 53 (1969) 357–362. [26] S. Bulman-Fleming and E. T. H. Wang, Problem 1143, Crux Math., 12 (1986) 107; solution, 13 (1987) 237–238. [27] D. Burger, Wednesday dinner parties, Scripta Math., 15 (1949) 26–32. BIBLIOGRAPHY 1519

[28] F. Burk, Natural logarithms via long division, College Math. Jour- nal, 30 (1999) 309–310. [29] C. K. Caldwell, Truncatable primes, Journal of Recreational Math., 19 (1987) 30–33. [30] C. K. Caldwell, Near repdigit primes, Journal of Recreational Math., 21 (1988) 299–304; (1989) 101–109. [31], C. K. Caldwell, The PRIME Pages, http://http://primes.utm.edu. [32] C. K. Caldwell and H. Dubner, The near-repunit primes 1n k 1011k, Journal of Recreational Math., 27 (1995) 35–41. − − [33] C. K. Caldwell and H. Dubner, Unique-period primes, Journal of Recreational Math., 29 (1998) 43–48. [34] L. Carroll, Pillow Problems and A Tangled Tale, 1895 and 1885, Dover reprint, 1958. [35] D. Cass and G. Wildenberg, A novel proof of the infinitude of primes, revisited, Math. Mag., 76 (2003) 203. [36] G. Chaves and J. C. Santos, Why some elementary functions are not rational?, Math. Mag., 77 (2004) 225–226. [37] P. L. Chessin and W. B. Carver, Problem E 1111, American Math. Monthly, 61 (1954) 258; solution 712. [38] A. J. Cole and A. J. T. Davie, A game based on the euclidean algorithm and a winning strategy for it, Math. Gazette, 53 (1969) 354–357. [39] D. B. Coleman, Sketch, a geoboard game, Math. Mag., 51 (1978) 49–54. [40] J. H. Conway and R. K. Guy, The Book of Numbers, Springer, 1996. [41] R. J. Covill and T. O’Keeffe, Problem 679, Journal of Recre- ational Math., 10 (1977–1978) 285; solution, 11 (1978–1979) 312. [42] H. S. M. Coxeter, The golden section, phyllotaxis, and Wythoff’s game, Scripta Mathematica, 19 (1953) 135–143. 1520 BIBLIOGRAPHY

[43] K. David, Rencontres reencountered, College Math. Journal, 19 (1988) 139–148. [44] T. R. Dawson, Ornamental squares and triangles, Math. Gazette, 30 (1946) 19–21. [45] M. N. Desphande, An unexpected encounter with the Fibonacci numbers, Fibonacci Quarterly, 32 (1994) 108 – 109. [46] D. W. DeTemple, The triangle of smallest perimeter which cir- cumscribes a semicircle, Fibonacci Quarterly, 30 (1992) 274. [47] C. Dodge, T. Schoch, P. Y. Woo, and P. Yiu, Those ubiquitous circles, Math. Mag., 72 (1999) 202–213. [48] H. G. Dworschak and L. Sauv´e, Problem 19, Crux Math., 1 (1975) 8; solution, 1 (1975) 32–33. [49] H. Dubner, Recursive prime generating sequences, Journal of Recreational Math., 29 (1998) 170–175. [50] H. E. Dudeney, Amusements in Mathematics, 1919, Dover reprint, 1958. [51] H. E. Dudeney, 536 Curious Problems and Puzzles, edited by M. Gardner, Barnes and Noble reprint, 1995. [52] H. E. Dudeney, Canterbury Puzzles, 1919, Dover reprint, 2002. [53] U. Dudley, Mathematical Cranks, Math. Assoc. America, 1992. [54] H. G. Dworschak and L. Sauve, Problem 19, Crux Math., 1 (1975) 8; solution 32. [55] E. J. Eckert, Primitive Pythaogrean triples, College Math. Journal, 23 (1992) 413–417. [56] E. J. Eckert and H. Haagensen, A Pythagorean tiling of the plane, Math. Mag., 62 (1989) 175. [57] R. E. Edwards et al., Problem 889, Math. Mag., 47 (1974) 46–47; solution 289–292. [58] R. B. Ely, III, Magic designs, Journal of Recreational Math., 1 (1968) 5–17. BIBLIOGRAPHY 1521

[59] A. Engel, Problem Solving Strategies, Springer, 1998. [60] R. Epp and T. Furguson, A note on takeaway games, Fibonacci Quarterly, 18 (1980) 300–303. [61] P. Erd˝os and G. Szekeres, Some number theoretic problems on binomial coefficients, Australian Math. Soc. Gazette, 5 (1978)97– 99. [62] S. Forman, A serendipitous application of the Pythagorean triplets, College Math. Journal, 23 (1992) 312–314. [63] R. L. Francis, Mathematical haystacks: another look at repunit numbers, College Math. Journal, 19 (1988) 240–246. [64] A. S. Fraenkel and H. Herda, Never rush to be first in playing nimbi, Math. Mag., 53 (1980) 21–26. [65] H. Fukagawa and D. Pedoe, Japanese Temple Geometry, Charles Babbage Research Centre, Wennipeg, 1989. [66] H. Fukagawa and J. F. Rigby, Traditional Japanese Mathematical Problems, 2002, SCT Publishing, Singapore. [67] H. F¨urstenberg, On the infinitude of primes, American Math. Monthly, 62 (1955) 353. [68] J. Gallego-Diaz and D. L. Silverman, Problem 1453 (corrected), American Math. Monthly, 68 (1961) 177; correction, 572; solution 69 (1962) 166. [69] J. A. Gallian, The mathematics of identification numbers, College Math. Journal, 22 (1991) 194–202. [70] M. Gardner, Mathematical card tricks, Scripta Math., 14 (1948) 99–111. [71] M. Gardner, Hexaflexagons and Other Mathematical Diversions, The First Scientific American Book of Mathematical Puzzles and Diversions, University of Chicago Press, 1988. [72] M. Gardner, The Second Scientific American Book of Mathemati- cal Puzzles and Diversions, University of Chicago Press, 1987. [73] M. Gardner, The Colossal Book of Mathematics, Norton, 2001. 1522 BIBLIOGRAPHY

[74] R. Gauntt and G. Rabson, The irrationality of √2, American Math. Monthly, 63 (1956) 247. [75] I. Gessel, Problem H-187, Fibonacci Quarterly, 10 (1972) 417– 419. [76] R. A. Gibbs, M. Chamberlain, and R. Lyons, Problem 1031, Math. Mag., 51 (1978) 69; solution, 52 (1979) 116. [77] S. Golomb, Permutations by cutting and shuffling, SIAM Review, 3 (1961) 114–118. [78] S. Golomb, Iterated binomial coefficients, American Math. Monthly, 87 (1980) 719 - 727. [79] S. Golomb, Problem 477, Pi Mu Epsilon Journal, 7.3 (1980) 187; solution, 8.5 (1981) 348–349. [80] S. Golomb and M. S. Klamkin, Problem 232, Pi Mu Epsilon Jour- nal, 5.2 (1970) 87; solution, 5.4 (1971) 208. [81] R. Goormaghtigh, Lemoyne’s theorem, Scripta Math., 18 (1953) 182–184. [82] H. D. Grossman, Ternary epitaph on coin problems, Scripta Math., 14 (1948) 69–71. [83] R. K. Guy, Problem 1153, Crux Math., 12 (1986) 139; solution, 13 (1987) 286–287. [84] R. K. Guy, Problem 1220, Crux Math., 13 (1987) 54; solution, 14 (1988) 125–126. [85] R. K. Guy, The strong law of small numbers, Amer. Math. Monthly, 95 (1988) 697–712. [86] R. K. Guy and M. E. Marcin, Problem 1915, Crux Math., , 20 (1994) 48; solution, 21 (1995) 30. [87] R. K. Guy and C. Springer, Problem 1367, Crux Math., 14 (1988) 202; solution, 15 (1989) 278–279. [88] R. K. Guy, The second strong law of small numbers, Math. Mag., 63 (1990) 3–20. BIBLIOGRAPHY 1523

[89] R. K. Guy, Unsolved Problems in , 2nd edition, Springer, 1994. [90] R. K. Guy and R. E. Woodrow, The Lighter Side of Mathematics, MAA, 1994. [91] A. Hall, Genealogy of Pythagorean triples, Math. Gazette, 54 (1970) 377–379. [92] C. L. Hamberg and R. A. Gibbs, Problem 975, Math. Mag., 49 (1976) 96; solution, 50 (1977) 266. [93] G. H. Hardy, A Mathematician’s Apology, Cambridge Univesity Press, 1940. [94] G. H. Hardy, A Course in Pure Mathematics, 10th edition, 1952, Cambridge; reprint 1963. [95] A.P.Hatzipolakis and P.Yiu, The Lucas circles of a triangle, Amer. Math. Monthly, 108 (2001) 444 – 446. [96] O. Higgins, Another long string of primes, Journal of Recre- ational Math., 14 (1981-82) 185. [97] A. M. Hinz, Pascal’s triangle and the tower of Hanoi, Amer. Math. Monthly, 99 (1992) 538–544. [98] V. Hoggatt and L. Moser, Problem E 861, American Math. Monthly, 56 (1949) 262; solution 57 (1950) 35. [99] A. Holshouser and H. Reiter, One pile nim with arbitrary move function, Electronic Journal of Combinatorics, 10 (2003) #N7. [100] R. Honsberger, Semi-regular lattice polygons, College Math. Journal, 13 (1982) 36–44. [101] R. Honsberger, In Polya’s´ Footsteps, Math. Assoc. America, 1997. [102] A. F. Horadam, Fibonacci sequences and a geometric paradox, Math. Mag. 35 (1962) 1–11. [103] L. S. Johnson, Denumerability of the rational number system, amm 55 (1948) 65–70. 1524 BIBLIOGRAPHY

[104] J. H. Jordan, R. Walsh, and R. J. Wisner, Triangles with integer sides, American Math. Monthly, 86 (1979) 686–688. [105] S. Kahan, s-transposable integers, Math. Mag., 49 (1976) 27–28. [106] D. Kalman and R. Mena, The Fibonacci numbers – exposed, Math. Mag., 76 (2003) 167–181. [107] H. Kestelman, On arithmetic and geometric means, Math. Gazette, 46 (1962) 130.

[108] C. Kicey and S. Goel, A series for ln k, American Math. Monthly, 105 (1998). [109] M. S. Klamkin and P. Watson, Triangulations and Pick’s theorem, Math. Mag., 49 (1976) 35–37. [110] D. A. Klarner, Mathematical Recreations, A Collection in Honor of Martin Gardner, Dover, 1998, originally published as Mathe- matical Gardner, Wadsworth International, CA, 1981. [111] M. Kleber, The best card trick, Math. Intelligencer, 24 (2002) 1:9– 11. [112] D. E. Knuth, Fundamental Algorithms, 2nd edition, Addison- Wesley, 1973. [113] T. Koshy, The of a , Journal of Recre- ational Math., 31 (2002–2003) 112–113. [114] M. Kraitchik, Mathematical Recreations, 2nd edition, 1942; Dover reprint, 1953. [115] N. Krier and B. Manvel, Counting integer triangles, Math. Mag., 71 (1998) 291–295. [116] S. Kumar, On Fibonacci sequences and a geometric paradox, Math. Mag., 37 (1964) 221–223. [117] V. S. Kumar, On the digital root series, Journal of Recreational Math., 12 (1979–80) 267–270. [118] M. E. Larson, The eternal triangle – a history of a counting prob- lem, College Math. Journal, 20 (1989) 370–384. BIBLIOGRAPHY 1525

[119] H. Larson and V. G. Feser, Problem 566, Journal of Recreational Math., 9 (1976) 298; solution, 10 (1977–78) 311–313. [120] W. G. Leavitt, Repeating decimals, College Math. Journal, 15 (1984) 299–308. [121] D. N. Lehmer, Asymptotic evaluation of certain totient sums, Amer. J. Math. 22 (1900) 293–335. [122] R. B. Leigh and R. T. Ng, Minimizing aroma loss, College Math. Journal, 30 (1999) 356–358.

[123] J. Lesko, A series for ln k, College Math. Journal, 32 (2001) 119– 122. [124] R. E. Lester, The malititudes of a cyclic quadrilateral, Math. Gazette, 46 (1962) 147. [125] A. Liu, A direct proof of Pick’s theorem, Crux Math., 4 (1978) 242–244. [126] E. Lucas, Recreations´ Mathematiques´ , 4 tomes, Gauthier Villars, Paris, 1891, 1896, 1893, 1894. [127] A. Machado, Nineteenth problems on elementary geometry, Math. Intelligencer, 17:1 (1995) 17–19. [128] G. Markowsky, Misconceptions about the golden ratio, College Math. Journal, 23 (1992) 2–19. [129] L. Marvin and F. H. Kierstead, Problem 315, Journal of Recre- ational Math., 7 (1974) 62; solution 9 (1976–77) 307. [130] S. W. McInnis, Magic circles, American Math. Monthly, 60 (1953) 347–351. [131] D .S. Mitrinovi´c, An inequality concerning the arithmetic and ge- ometric means, Math. Gazette, 50 (1966) 310–311. [132] R. K. Morley and P. Schub, Problem E24, American Math. Monthly, 40 (1933) 111; solution, 425–426. [133] S. B. Morris, Faro shuffling and card placement, Journal of Recre- ational Math., 8 (1975) 1–7. 1526 BIBLIOGRAPHY

[134] S. B. Morris, The basic mathematics of the faro shuffle, Pu Mu Epsilon Journal, 6.2 (1975) 85–92. [135] W. Moser, It is elementary (combinatorics), Crux Math., 18 (1992) 257–262; 289–295; 19 (1993) 1–2. [136] D. Nelson, A regular pentagon construction, Math. Gazette, 61 (1977) 215–216. [137] I. Niven, Note on a paper by L. S. Johnson, Amer. Math. Monthly, 55 (1948) 358. [138] L. C. Noll and D. I. Bell, n-clusters for 1

[149] F. Rubin and V. G. Feser, Problem 1078, Journal of Recreational Math., 14 (1981) 141–142; solution, 15 (1982–1983) 155–156. [150] K. R. S. Sastry and J. H. Steelman, Problem 647, College Math. Journal, 30 (1999) 143; solution, 31 (2000) 139–140. [151] N. Sato, An ambivalent sum, Crux Math., 23 (1997) 290–293. [152] D. Schattschneider, Counting it twice, College Math. Journal, 22 (1991) 203–211. [153] J. Schram, A string of 176 primes, Journal of Recreational Math., 15 (1982–83) 168–169. [154] J. Schram, A recurrence relation for Fermat numbers, Journal of Recreational Math., 16 (1983–84) 195–197. [155] A. J. Schwenk, Take-away games, Fibonacci Quarterly, 8 (1970) 225–234. [156] H. Shapiro, An arising from the φ function, Amer. Math. Monthly, 50 (1943) 18–30. [157] D. L. Silverman and D. Singmaster, Problem 1017, Journal of Recreational Math., 13 (1980) 298; solution, 14 (1981–1982) 313. [158] D. Singmaster, Problem 267, Journal of Recreational Math., 6 (1973) 152–153. [159] D. Singmaster and B. Barwell, Problem 812, Journal of Recre- ational Math., 13 (1980–1981) 62–63. [160] D. Singmaster, Triangles with integer sides and sharing barrels, College Math. Journal, 21 (1990) 278–285. [161] J. St. C. L. Sinnadurai, A well-known geometrical problem, Math. Gazette, 46 (1962) 143–144. [162] J. Slocum, The Tangram Book, Sterling, New York, 2003. [163] , L. M. Smiley, A quick solution of triangle counting, Math. Mag., 66 (1995) 40. [164] C. A. B. Smith, Compound games with counters, Journal of Recreational Math., 1 (1968) 67–77. 1528 BIBLIOGRAPHY

[165] M. Somos and R. Haas, A linked pair of sequences implies the primes are infinite, American Math. Monthly, 110 (2003) 539– 540. [166] J. A. Spencer and H. Ahlburg, Problem 428, Crux Math., 5 (1979) 77; solution, 6 (1980) 50. [167] J. E. Trevor and W. E. Buker, Problem 178, American Math. Monthly, 43 (1937) 104; solution, 499–500. [168] C. W. Trigg, Eight digits on a cube’s vertices, Journal of Recre- ational Math., 7 (1974) 49–55. [169] C. W. Trigg, Tetrahedral models from envelopes, Math. Mag., 51 (1978) 66–67. [170] C. W. Trigg, Some curiosa involving the first ten perfect numbers, Journal of Recreational Math., 23 (1991) 286. [171] T. Trotter, Perimeter-magic polygons, Journal of Recreational Math., 7 (1974) 14–20. [172] M. Wald, Solution to Problem 1664, Journal of Recreational Math., 21 (1989) 236–237. [173] F. T. Wang and C. C. Hsiung, A theorem on the tangram, Ameri- can Math. Monthly, 49 (1942) 596–599. [174] S. R. Wassel, Rediscovering a family of means, Math. Intelli- gencer, 24.2 (2002) 58–65. [175] C. Waiveris and Y. Chen, Folding stars, College Math. Journal,30 (1999) 370–378. [176] M. Wald, Solution to Problem 1664, Journal of Recreational Math., 21 (1989) 236–237. [177] J. E. Waltrom and M. Berg, Prime primes, Math. Mag., 42 (1969) 232. [178] E. T. H. Wang and J. I. Levy, Problem 1001, Math. Mag., 49 (1976) 253; solution, 51 (1978) 246. [179] W. C. Waterhouse, Continued fractions and Pythagorean triples, Fibonacci Quarterly, 30 (1992) 144–147. BIBLIOGRAPHY 1529

[180] A. Wayne, A genealogy of 120◦ and 60◦ natural triangles, Math. Mag., 55 (1982) 157–162. [181] C. S. Weaver, Geoboard triangles with one interior point, Math. Mag., 50 (1977) 92–94. [182] D. Wells, Beauty in mathematics, Math. Intelligencer, 10:4 (1988) 31. [183] D. T. Whiteside, The Mathematical Papers of Issac Newton, vol. V, Cambridge University Press, 1976. [184] A. W. Willcox and L. A. Ringenberg, Problem 971, American Math. Monthly, 58 (1951) 417; solution 59 (1952) 105–106. [185] P. Woo, Simple constructions of the incircle of an arbelos, Forum Geometricorum, 1 (2001) 133–136. [186] M. Wunderlich, Another proof of the infinite primes theorem, American Math. Monthly, 72 (1965) 305. [187] S. Yates, The mystique of repunits, Math. Mag., 51 (1978) 22–28. [188] S. Yates, Periods of unique primes, Math. Mag., 53 (1980) 314. [189] S. Yates, Repunits and Repetends, privately published, Delray Beach, FL, 1982. [190] P. Yiu, Construction of indecomposable Heronian triangles, Rocky Mountain Journal of Mathematics, 28 (1998) 1189 – 1202. [191] P. Yiu and J. Young, Problem 2406, Crux Math., 25 (1999) 48; solution, 26 (2000) 53–54. [192] P. Yiu, Mixtilinear incircles, Amer. Math. Monthly, 106 (1999) 952 – 955. [193] P. Yiu, The uses of homogeneous barycentric coordinates in plane euclidean geometry, Int. J. Math. Educ. Sci. Technol, 31 (2000) 569 – 578. [194] P. Yiu, Heronian triangles are lattice triangles, Amer. Math. Monthly, 108 (2001) 261 – 263. [195] P. Yiu, The volume of an isosceles tetrahedron and the Euler line, Mathematics & Informatics Quarterly, 11 (2001) 15–19. 1530 BIBLIOGRAPHY

[196] N. Yoshigahara, Card-return numbers, Journal of Recreational Math., 5 (1972) 36–38.