<<

Problem Solving and Recreational

Paul Yiu

Department of Mathematics Florida Atlantic University

Summer 2016

April 4, 2016

Contents

1 Arithmetic Problems 101 1.1 Reconstruction of division problems ...... 101 1.1.1 AMM E1 ...... 101 1.1.2 AMM E10 ...... 103 1.1.3 AMM E1111 ...... 104 1.1.4 AMM E971 ...... 105 1.1.5 AMM E198 ...... 106

2 Digit problems 107 2.1 When can you cancel illegitimately and yet get the cor- rect answer? ...... 107 2.2 ...... 109 2.3 Sums of of digits ...... 112

3 Representation of a in different bases 115 3.1 Base b-representation of a number ...... 115 3.1.1 A number from its base b-representation . ....116 3.2 The Josephus problem ...... 119

4 Representation of a number in different bases 121 4.1 Balanced division by an odd number ...... 121 4.2 Balanced base b representation of a number ...... 121 4.3 Arithmetic in balanced base 3 representations . ....123 4.3.1 A matrix card trick ...... 124

5 Cheney’s card trick 127 5.1 Three basic principles ...... 127 5.1.1 The pigeonhole principle ...... 127 5.1.2 Arithmetic modulo 13 ...... 127 iv CONTENTS

5.1.3 of three objects ...... 128 5.2 Examples ...... 129 5.3 A variation: Cheney card trick with spectator choosing secret card ...... 131

6 The nim game 133 6.1 Thenimsum...... 133 6.2 Thenimgame...... 134

7 Fibonacci and Lucas 137 7.1 The Fibonacci ...... 137 7.2 Some relations of Fibonacci numbers ...... 140 7.3 Zeckendorff representations ...... 141 7.4 The Lucas numbers ...... 142 7.5 How can we know if a given is a ? ...... 143 7.6 Periodicity of Fibonacci sequence mod m ...... 144

8 Counting with Fibonacci numbers 145 8.1 Squares and dominos ...... 145 8.2 Fat subsets of [n] ...... 146 8.3 An arrangement of pennies ...... 147 8.4 Counting circular permutations ...... 149

9 Floor and Ceiling 201 9.1 Clock problems ...... 201 9.2 Some equations involving x ...... 202 9.3 Number of trialing zeros in n! ...... 203 9.4 Characterizations of the ceiling and floor functions . . . 204

10 Combinatorial games 207 10.1 Subtraction games ...... 207 10.2 The Sprague-Grundy sequence ...... 209

11 Permutations 213 11.1 The universal sequence of permutations ...... 213 11.2 The position of a in the universal sequence 214 11.3 The disjoint cycle decomposition of a permutation . . . 216 11.4 Lexicographical ordering of permutations ...... 217 11.5 Dudeney’s puzzle ...... 221 CONTENTS v

11.6 Problems on permutations ...... 224

12 Perfect card shuffles 227 12.1 In-shuffles ...... 229 12.2 Out-shuffles ...... 231 12.3 Perfect shuffling a card to a specified position . ....232

13 Interpolation problems 233 13.1 What is f(n +1)if f(k)=2k for k =0, 1, 2 ...,n? . . 233 1 13.2 What is f(n +1)if f(k)= k+1 for k =0, 1, 2 ...,n? . 235 13.3 Why is ex not a rational ? ...... 237

14 Transferrable numbers 239 14.1 Right-transferrable numbers ...... 239 14.2 Left-transferrable ...... 241

15 The equilateral lattice L (n) 245 15.1 Counting ...... 245 15.2 Counting parallelograms ...... 248 15.3 Counting regular ...... 249

16 Counting triangles 253 16.1 Integer triangles of sidelengths ≤ n ...... 253 16.2 Integer scalene triangles with sidelengths ≤ n .....254 16.3 Number of integer triangles with perimeter n ...... 255 16.3.1 The partition number p3(n) ...... 255

17 Pythagorean triangles 301 17.1 Primitive Pythagorean triples ...... 301 17.1.1 Rational angles ...... 302 17.1.2 Some basic properties of primitive Pythagorean triples ...... 302 17.2 A Pythagorean with an inscribed ....304 17.3 When are x2 − px ± q both factorable? ...... 305 17.4 Dissection of a square into Pythagorean triangles ....305

18 The area of a triangle 307 18.1 Heron’s formula for the area of a triangle ...... 307 18.2 Heron triangles ...... 309 18.2.1 The perimeter of a Heron triangle is even ....309 vi CONTENTS

18.2.2 The area of a Heron triangle is divisible by 6 . . 309 18.2.3 Heron triangles with sides < 100 ...... 310 18.3 Heron triangle as lattice triangle ...... 311 18.4 Indecomposable Heron triangles ...... 312 18.5 Heron triangles with area equal to perimeter ...... 314 18.6 Heron triangles with integer inradii ...... 315 18.7 Heron triangles with square areas ...... 316

19 The 317 19.1 Division of a segment in the golden ratio ...... 317 19.2 The regular ...... 319 19.3 Construction of 36◦, 54◦, and 72◦ angles ...... 320 19.4 The most non-isosceles triangle ...... 324

20 The Arbelos 325 20.1 Archimedes’ twin circle theorem ...... 325 20.2 Incircle of the arbelos ...... 326 20.2.1 Construction of incircle of arbelos ...... 327 20.3 Archimedean circles in the arbelos ...... 328

21 Menelaus and Ceva theorems 331 21.1 Menelaus’ theorem ...... 331 21.2 Ceva’s theorem ...... 333

22 Routh and Ceva theorems 339 22.1 Barycentric coordinates ...... 339 22.2 Cevian and traces ...... 340 22.3 Area and barycentric coordinates ...... 342

23 Perimeter - area bisectors of a triangle 347 23.1 Construction of perimeter-area bisectors in angle A . . 348 23.2 Isosceles triangles ...... 349 23.3 Scalene triangles ...... 350 23.4 Triangles with exactly two perimeter-area bisectors . . 352 23.5 Integer triangles ...... 353 23.5.1 Triangles with Da < 0 ...... 353 23.5.2 Triangles with Da =0 ...... 354 23.5.3 Triangles with Da > 0 ...... 354

24 Very Small Integer Triangles 357 CONTENTS vii

25 The games of Euclid and Wythoff 401 25.1 The game of Euclid ...... 401 25.2 Wythoff’s game ...... 403 25.3 Beatty’s Theorem ...... 405

26 Number 407 26.1 The Farey sequence ...... 407 26.2 The number spiral ...... 410 26.3 The spirals ...... 412 26.4 The prime number spiral beginning with 17 ...... 413 26.5 The prime number spiral beginning with 41 ...... 414 26.6 Two enumerations of the rational numbers in (0,1) . . . 416

27 Inequalities 417 27.1 The inequality AGH2 ...... 417 27.2 Proofs of the A-G inequality ...... 420 27.3 The AGH mean inequality ...... 422 27.4 Cauchy-Schwarz inequality ...... 424 27.5 Convexity ...... 427 27.6 The power mean inequality ...... 429 27.7 Bernoulli inequality ...... 430 27.8 Holland’s Inequality ...... 430 27.9 Miscellaneous inequalities ...... 432 27.10 A useful variant of AG2 ...... 433

28 Calculus problems 435 28.1 Philo’s line ...... 435 28.1.1 Triangle with minimum perimeter ...... 436 28.2 Maxima and minima without calculus ...... 440

29 449 29.1 Quartic polynomials and the golden ratio ...... 449

30 Infinite 453 30.1 ...... 453 30.2 The Bernoulli numbers and the tangent function ....455 30.3 The and the secant function ...... 457 30.4 of finite series ...... 458 viii CONTENTS

31 The art of integration 461 31.1 Indefinite integrals ...... 461 31.2 An iterated integral and a generalization ...... 463 31.2.1 Crux Math. 3913 ...... 463 31.2.2 A generalization ...... 464

32 Rearrangements of the alternating harmonic series 467 32.1 Riemann’s theorem on conditionally . 467 32.2 Rearrangements of the alternating harmonic series . . . 468 Chapter 1

Arithmetic Problems

1.1 Reconstruction of division problems

1.1.1 AMM E1

This is Problem E1 of the AMERICAN MATHEMATICAL MONTHLY: x 7 xxx xxx) xxxxxxxx xxxx xxx xxx xxxx xxx xxxx xxxx Clearly, the last second digit of the quotient is 0. Let the 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. 102 Arithmetic Problems

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 968 868 1003 992 1116 1116 1.1 Reconstruction of division problems 103

1.1.2 AMM E10

This is Problem E10 of the MONTHLY, by Fitch Cheney. In this case, not even one single digit is given.

xxxxxx xxx) xxxxxxxx xxx xxxx xxx xxxx xxx xxxx xxxx 104 Arithmetic Problems

1.1.3 AMM E1111

This is said to be the most popular MONTHLY problem. It appeared in the April issue of 1954. Our good friend and eminent numerologist, Professor Euclide Paracelso Bombasto Umbugio, has been busily engaged test- ing on his desk calculator the 81 · 109 possible solutions to the problem of reconstructing the following exact long division in which the digits indiscriminately were each replaced by x save in the quotient where they were almost entirely omitted.

xx8xx xxx)xxxxxxxx xxx xxxx xxx xxxx xxxx

Deflate the Professor! That is, reduce the possibilities to (18 · 109)0.

Martin Gardner’s remark: Because any number raised to the power of zero is one, the reader’s task is to discover the unique reconstruction of the problem. The 8 is in correct position above the line, making it the third digit of a five-digit answer. The problem is easier than it looks, yielding readily to a few elementary insights. 1.1 Reconstruction of division problems 105

1.1.4 AMM E971 Reconstruct the division problem ∗∗∗∗∗ ∗∗) ∗∗∗∗2 ∗ ∗∗ ∗∗∗ ∗∗ ∗∗∗ ∗∗∗ ∗∗ ∗∗

Charles Twigg comments that if the digit 2 is replaced by 9, the answer is also unique. ∗∗∗∗∗ ∗∗) ∗∗∗∗9 ∗ ∗∗ ∗∗∗ ∗∗ ∗∗∗ ∗∗∗ ∗∗ ∗∗ 106 Arithmetic Problems

1.1.5 AMM E198 Here is 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).

ppp × pp pppp p ppp p pppp Chapter 2

Digit problems

2.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 = bc = c ,

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). 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 108 Digit problems 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) bad = d , cab c (b) dba = d , abc a (c) bcd = d .

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. 2.2 Repdigits 109

2.2 Repdigits

A is a number whose 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 n an = (10 − 1). 9 Example 2.1. Show that 16n 1 19n 1 26n 2 49n 4 = , = , = , = . 6n4 4 9n5 5 6n5 5 9n8 8

abn a Solution. More generally, we seek equalities of the form bnc = c for 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 (abn) × c =(bnc) × a is equivalent to 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 divisor 9 , we obtain (9a + b)c =10ab, which ab a is the same condition for bc = c .

Exercise 1. 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 1n013n−1215n−1417n−1619n−18 3 9n 13n−1216n−1519n−1823n−1126n−1429n−17 4 17n−162n026n−1431n−208 35n−1239n−16 5 27n−153n038n−154n049n−15 6 39n−1646n−1253n−228 59n−14 7 54n−239 62n−216 69n−13 8 71n−204 79n−12 9 98n−201

2. Simplify (1n)(10n−15). Answer. (1n)(10n−15) = 1n5n. 110 Digit problems

Exercise 1. 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. √ 2. 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 ∗∗∗ ∗∗∗

3. 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? 4. 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? 5. Find all possibilities of a 3-digit number such that the three num- bers obtained by cyclic permutations of its digits are in . 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.

k 37 × ks 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 2.2 Repdigits 111

6. 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? 7. 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. 112 Digit problems

2.3 Sums of squares of digits

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

2 2 2 s(N)=a1 + a2 + ···+ an. 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 2.1. For every positive integer N, the sequence S(N) is either eventually constant at 1 or periodic. The period has length 8 and form a cycle 37 58 16

89 1 4

145 20 42 A proof of the theorem is outlined in the following exercise. 2.3 Sums of squares of digits 113

Exercise 1. Prove by that 10n−1 > 81n for n ≥ 4. 2. Prove that if N has 4 or more digits, then s(N) 81n ≥ s(N). 3. Verify a stronger result: if N has 3 digits, then s(N)

(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)=1for some k.

7 70

44 94 19 91

23 79 49 82 32 31 97 28 86

13 130 68

10 100

1 114 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 3

Representation of a number in different bases

3.1 Base b-representation of a number

Let b be a fixed positive integer. To write an integer n in base b, keep on dividing the number by b until the quotient is 0, and record the re- mainders, which are integers between 0 and b − 1, from right to left. The resulting sequence, which always begins with a nonzero leftmost digit, is the representation of n in base b.

Example 3.1. (a) 123 = [1111011]2

divisor quotient remainder 2 123 1 61 1 30 0 15 1 7 1 3 1 1 1 0 116 Representation of a number in different bases

(b) 123 = [11120]3

divisor quotient remainder 3 123 0 41 2 13 1 4 1 1 1 0

3.1.1 A number from its base b-representation Given the base b representation of an integer:

n =[a0a1 ···ak−1ak]b, to find the integer in its decimal form, calculate a sequence of numbers n0, n1,...,nk as follows: (i) n0 = a0, (ii) for i =1, 2,...,k, ni = ai + b · ni−1. Then, n = nk.

Example 3.2. (a) [1111011]2 = 123.

1 1 1 1 0 1 1 2 2 6 14 30 60 122 1 3 7 15 30 61 123

(b) [23147]11 = 33447.

2 3 1 4 7 11 22 275 3036 33440 2 25 276 3040 33447 Example 3.3. Ask your friend to think of a number between 1 and 31. Then ask her if the number appears in card (a), (b), (c), (d), or (e). Now add up the numbers from the lower left hand corners of the card which she answers yes. That is the number she has chosen. 3.1 Base b-representation of a number 117

4 4 7 15 23 31 7 15 23 31 3 3 5 13 21 29 6 14 22 30 2 2 3 11 19 27 3 11 19 27 1 1 1 9 17 25 2 10 18 26 0 0 0 1 2 3 4 0 1 2 3 4

4 4 7 15 23 31 14 28 25 9 3 3 6 14 22 30 12 31 27 11 2 2 5 13 21 29 10 26 30 13 1 1 4 12 20 28 8 24 29 15 0 0 0 1 2 3 4 0 1 2 3 4

4 20 28 25 17 3 22 31 27 19 2 18 26 30 23 1 16 24 29 21 0 0 1 2 3 4 118 Representation of a number in different bases

Exercise 1. Complete the multiplication table in base 7. 1 2 3 4 5 6 1 1 2 3 4 5 6 2 2 3 3 12 4 4 5 5 6 6 15 51

2. Multiply in base 7:

[12346]7 × [06]7 = [12346]7 × [15]7 = [12346]7 × [24]7 = [12346]7 × [33]7 = [12346]7 × [42]7 = [12346]7 × [51]7 =

3. Ask your friend to write down a polynomial f(x) with nonnegative integer coefficients. Ask her for the value of f(1). She returns 7. Ask her for the value of f(8). She returns 4305. What is the polynomial? 3.2 The Josephus problem 119

3.2 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. Here is M. Chamberlain’s solution:

Write n =2m + k where 0 ≤ k ≤ 2m − 1. Then seat the people 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 is easy to see that 2m−1 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.

2 6 4 3 * 1 5 2

3 6 1 8

7 10 7 5 8 9 4 9 Let J(n) be the position of the last standing man in a circle of n. Theorem 3.1. The binary expansion of J(n) is obtained by transferring the leftmost digit 1 of the binary expansion of n to the rightmost. Proof. If n =2m + k for k ≤ 2m, then J(n)=2(n − 2m)+1. The binary expansion of J(n) is obtained by moving the leftmost digit of the binary expansion of n (corresponding to 2m) to the rightmost. 120 Representation of a number in different bases

Exercise 1. For what values of n is J(n)=n? 2. For what values of n is J(n)=n − 1? Chapter 4

Representation of a number in different bases

4.1 Balanced division by an odd number

Given a positive integer b and a string of b consecutive integers, for every integer a, there are unique integers q and r so that a = bq + r with r in the given string of b consecutive integers. In particular, if b is odd, say b =2c +1, we may choose the string of remainders to be −c, −(c − 1), ..., −1, 0, 1, ..., c− 1,c. If we write a = bq + r, −c ≤ r ≤ c, we say that this is the balanced division of a by the odd number b.

4.2 Balanced base b representation of a number

Let b be a positive odd number. The balanced base b representation of an integer n is obtained by repeatedly performing balanced divisions by b and recording, from right to left, the remainders, which are integers in − b−1 ··· − b−1 the range 2 , , 1, 0, 1, ..., 2 . We shall write 1, 2, 3, 4, ... in place of the negative remainders −1, −2, −3, −4, .... 122 Representation of a number in different bases

Examples

(1) 100 = 11011 3

divisor quotient remainder 3 100 1 33 0 11 1 4 1 1 1 0 The balanced ternary form of a number expresses it as a sum and/or differences of distinct powers of 3: 100 = 34 +33 − 32 +1.

Here is a simple application of the balanced ternary expansion of numbers. Example 4.1. Suppose we have a beam balance and a set of seven stan- dard weights 1, 2, 4, 8, 16, 32, 64 units. It is possible to weigh every integer units from 1 to 127 with these seven standard weights. For ex- ample, since 1002 = 1100100, balance is achieved by putting a weight of 100 units on one pan, and standard weights of 4, 32 and 64 units on the other. However, with a set of five standard weights 1, 3, 9, 27, 81,itis possible to weigh every integer units from 1 to 121. For example, since 100 3 =11101, a weight of 100 units can be balanced by putting it with a standard weight 9 units on one pan and the standard weights 1, 27, 81 on the other pan. 4.3 Arithmetic in balanced base 3 representations 123

4.3 Arithmetic in balanced base 3 representations

+ 1 01 × 1 01 1 11 1 0 1 101 0 1 01 0 000 1 0111 1 1 01

Example 4.2. 11111 3 × 1111 3 = 11000011 3.

1 1111 × 111 1 1 1111 1 1111 1 1111 1 1111 1 1 000011 124 Representation of a number in different bases

4.3.1 A matrix card trick

Let p and q be given odd numbers, say p =2h +1and q =2k +1. Arrange pq cards in the form of a p × q matrix. Ask a spectator to select one secret card and name the column containing the secret card. Then the cards are (i) picked up along columns in any order, except that the named one is the middle one, being preceded by k arbitrary columns and followed by the remaining k columns arbitrarily, (ii) rearranged into the p × q matrix along rows. Repeat a number of times, each time asking for the column which contains the secret card. The secret card will eventually appear exactly in the middle row of the matrix. If p ≤ q, you can tell what the secret card is after the first step. It is in the middle row. We shall henceforth assume p>qso that there are more rows than columns.

Example 4.3. In the arrangement below, the spectator chooses ♦2 and tells you that it is in the second column.

♣5 ♠6 ♦8 ♣J ♠Q ♠K ♥9 ♠A ♦6 ♦9 ♣6 ♥10 ♠10 ♦2 ♣9

Then you pick up, in order, the first, the second, and then the third columns, and deal the cards in rows:

♣5 ♣J ♥9 ♦9 ♠10 ♠6 ♠Q ♠A ♥6 ♦2 ♦8 ♠K ♦6 ♥10 ♠9

Now ask the spectator which column contains the secret card. She will answer the first column. Then you pick up, in order, the third, the first, and the second column, and deal the cards in rows: 4.3 Arithmetic in balanced base 3 representations 125

♥9 ♠6 ♥6 ♠K ♠9 ♣5 ♦9 ♠Q ♦2 ♦6 ♣J ♠10 ♠A ♦8 ♥10

Now, the spectator will tell you that the secret card is in the third column. You immediately know that the card is ♦2. How many times do you need to rearrange the cards before you can tell what the secret card is? 1 Label the rows −h, −(h − 1),...,0,...,h − 1, h so that the middle rowisrow0. An application of (i) and (ii) will bring the i-th card in the column containing the secret card into row g(i), where g(i) is the quotient in the balanced division of i by q. Equivalently, g(i)=b if i = bq + r for − k ≤ i ≤ k. It is easy to see that g is an odd function: under the same condition, −i = −bq − r, with −k ≤−r ≤ k, so that g(−i)=−b.Now,g(i) is decreasing for positive i, and increasing for i<0. Furthermore, if g(i)=0, then all subsequent iterates by g are stationary at 0. Therefore, if we write p =2h +1, then the number of times to guarantee the secret card in the middle row is min{ : g(h)=0}. The function g on positive integers can be easily described in terms of the base q representations of numbers.

Lemma 4.1. If n = amam−1 ...a1a0 q in balanced base q representa- tion, then g(n)= amam−1 ···a1 q. Proposition 4.2. The number of times for the secret card to move to the middle row is not more than the length of the balanced base q- p−1 representation of the integer 2 .

Examples

(1) 51 cards in 3 columns: p =17, q =3. Since 8= 101 3, three operations suffice.

1G. R. Sanchis, A card trick and the mathematics behind it, College Math. Journal, 37 (2006) 103Ð109. Here, we make use of balanced base q representation of numbers. 126 Representation of a number in different bases

(2) 35 cards in 5 columns: p =7, q =5. Since 3= 12 5,two operations suffice.

Exercise Find the number of operations required to move the secret card to the middle row for 1. 45 cards in 5 columns; 2. 39 cards in three columns. Chapter 5

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 everybody what 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.

5.1 Three basic principles

5.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.

5.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 travelling this distance on the 13-hour clock. Keep the latter as the secret card. 128 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

5.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 should add 4 to 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: ♣ < ♦ < ♥ < ♠. 5.2 Examples 129

5.2 Examples

Example 5.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 5.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. 130 Cheney’s card trick

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

5 2 ♠ 7 ♥ J ♠ 6 ♠ 2 ♦ 5 ♣ 8 ♣ ? ♠ ? ? ? 5.3 A variation: Cheney card trick with spectator choosing secret card 131

5.3 A variation: Cheney card trick with spectator choos- ing secret card

Now the spectators say they would 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. (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, 132 Cheney’s card trick

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?

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

The nim game

6.1 The nim sum

The nim sum of two nonnegative integers is the 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 =(a1a2 ···an) (b1b2 ···bn)=(a1 b1)(a2 b2) ···(an bn).

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

Example 6.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: 134 The nim game

0123456789101112131415 0 0123456789101112131415 1 1032547698111013121514 2 2301674510118914151213 3 3210765411109815141312 4 4567012312131415891011 5 5476103213121514981110 6 6745230114151213101189 7 7654321015141312111098 8 8910111213141501234567 9 9811101312151410325476 10 1011891415121323016745 11 1110981514131232107654 12 1213141589101145670123 13 1312151498111054761032 14 1415121310118967452301 15 1514131211109876543210

6.2 The nim 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 6.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 Missere` 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. 6.2 The nim game 135

Exercise In each of the following nime 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. 136 The nim game Chapter 7

Fibonacci and Lucas numbers

7.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 101112 ... Fn 01123581321345589144...

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

n F (x):=F0 + F1x + ···+ Fnx + ··· .

From the defining relations, we have

2 2 F2x = F1x · x + F0 · x , 3 2 2 F3x = F2x · x + F1x · x , 4 3 2 2 F4x = F3x · x + F2x · x , . . n n−1 n−2 2 Fnx = Fn−1x · x + Fn−2x · x , . . 138 Fibonacci and Lucas numbers

Combining these relations we have 2 F (x) − (F0 + F1x)= (F (x) − F0) · x + F (x) · x , 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 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),wehaveapartial 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 2 ··· n ··· n − =1+x + x + + x + = x , 1 x n=0 √ and noting that α − β = 5,wehave ∞ ∞ x 1 = √ αnxn − βnxn − − 2 1 x x 5 n=0 n=0 ∞ αn − βn = √ xn. n=0 5 The coefficients of this power series are the Fibonacci numbers: αn − βn Fn = √ ,n=0, 1, 2,.... 5 7.1 The Fibonacci sequence 139 n n √α √α 1. Fn is the integer nearest to 5 : Fn = 5 .

Proof. n n α β 1 1 Fn − √ = √ < √ < . 5 5 5 2

2. For n ≥ 2, Fn+1 = αFn .

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

Fn+1 n→∞ 3. lim Fn = α.

Exercise 1. (a) Make use of only the fact that 987 is a Fibonacci number 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 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? 140 Fibonacci and Lucas numbers

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.

7.2 Some relations of Fibonacci numbers

1. Sum of consecutive Fibonacci numbers: n Fk = Fn+2 − 1. k=1

2. Sum of consecutive odd Fibonacci numbers: n F2k−1 = F2n. k=1

3. Sum of consecutive even Fibonacci numbers: n F2k = F2n+1 − 1. k=1

4. Sum of squares of consecutive Fibonacci numbers: n 2 Fk = FnFn+1. k=1

5. Cassini’s formula:

2 n Fn+1Fn−1 − Fn =(−1) . 7.3 Zeckendorff representations 141

7.3 Zeckendorff representations

Every positive integer can be written uniquely as a sum of distinct Fi- bonacci numbers with no consecutive indices:

N = Fk1 + Fk2 + ···+ Fkm ,ki >ki+1 +1,i

Exercise 1. Prove that

F1 + F3 + ···+ F2k−1 =F2k − 1, F2 + F4 + ···+ F2k =??

2. (a) Suppose Fibonacci had wanted to set up an annuity that would pay Fn lira on the nth year after the plan was established, for n = 1, 2, 3,... (F1 = F2 =1,Fn = Fn−1 + Fn−2 for n>2). To fund such an annuity, Fibonacci had planned to invest a sum of money with the Bank of Pisa, which paid 70% interest per year, and instruct them to administer the trust. How much money did he have to invest so that the annuity could last in perpetuity ? (b) When he got to the bank, Fibonacci found that their interest rate was only 7% (he had misread their ads), not enough for his purposes. Despondently, he went looking for another bank with a higher interest rate. What rate must he seek in order to allow for a perpetual annuity ?

3. It is known that if Fn is a prime number, then n must be a prime number. The converse is not true. In fact, the following Fibonacci numbers are composites. Give a factorization of each of them:

p Fp Factorization 19 4181 37 × 113 31 1346269 37 24157817 41 165580141 142 Fibonacci and Lucas numbers

7.4 The Lucas numbers

The sequence (Ln) satisfying

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 = Fn +2Fn−1.

3. Ln+1 + Ln−1 =5Fn.

4. F2k = L1L2L4L8 ···L2k−1 .

5. L1 =1and L3 =4are the only square Lucas numbers (U. Alfred, 1964).

Exercise 2 n−1 1. Prove that L2n = Ln +2(−1) . Solution.

2n 2n L2n = α + β =(αn + βn)2 − 2(αβ)n 2 n = Ln − 2(−1) .

2. Express F4n ÷ Fn in terms of Ln. Solution. 3 n−1 F4n = F2nL2n = FnLnL2n = Fn(Ln +2(−1) Ln).

3. Express F3n ÷ Fn in terms of Ln. 2 n Answer. F3n = Fn(Ln +(−1) ). 7.5 How can we know if a given integer is a Fibonacci number? 143

7.5 How can we know if a given integer is a Fibonacci number?

Theorem 7.1 (Gessel). An integer N is a Fibonacci number if and only if 5N 2 ± 4 is a square. 2 n 2 Proof. Necessity: 5Fn +4(−1) = Ln. Sufficiency: If 5N 2 +4ε = M 2 for ε = ±1 and an integer M, then √ √ M + N 5 M − N 5 · = ε = ±1, 2 2 √ √ √ M+N 5 Q Q ± n ∈ Z and 2 is a unit in [ 5]. The units in [ 5] are α for n . Therefore, √ √ n n n n M + N 5 (α + β )+(α − β ) Ln + Fn 5 = αn = = , 2 2 2 and N = Fn. M−N M+N Remark. Ln = M, Fn−1 = 2 and Fn+1 = 2 . 144 Fibonacci and Lucas numbers

7.6 Periodicity of Fibonacci sequence mod m

Let m>1 be a given integer. We prove that the sequence (Fn (mod m)) 2 is periodic. Let fn = Fn (mod m). Since there are m − 1 possi- bilities for the pair (fn,fn+1), by the pigeonhole principle, there are 2 h

m Fibonacci numbers modulo m period 2 0, 1, 1, 0, 1, ... 3 3 0, 1, 1, 2, 0, 2, 2, 1, 0, 1, ... 8 4 0, 1, 6 5 0, 1, 20

6 0, 1, 24

7 0, 1, 16

8 0, 1, 12

Exercise Complete the table above and construct an arithmetic progression which does not contain any Fibonacci number. Chapter 8

Counting with Fibonacci numbers

8.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 =1and 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 an = Fn+1 for every n ≥ 1. 146 Counting with Fibonacci numbers

8.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.Ifm =1, then A = {n}.Ifm>1, then every element of A is greater than 1. The subset A := {j − 1:j

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 permutation satisfying the condition in (a). Suppose for distinct a, b ∈ [n], π(a)=b. Prove that π(b)=a. 8.3 An arrangement of pennies 147

8.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 =2,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. 148 Counting with Fibonacci numbers

Here are some beginning values:

nan 11 22 35 45+2· 2+3· 1+1=13, 513+2· 5+3· 2+4· 1+1=34, 634+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 an = F2n−1 for n ≥ 1.

Proof. We prove by mathematical induction a stronger result:

an = F2n−1, n ak = F2n. k=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=1 k=1

= F2n+1 + F2n = F2(n+1).

Therefore, the conjecture is established for all positive integers n.In particular, an = F2n−1. 8.4 Counting circular permutations 149

8.4 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 +2such 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 9

Floor and Ceiling

For a real number x, we denote by •x the greatest integer not exceeding x, (the floor of x), 1 •x the least integer not smaller than x, (the ceiling of x). • x the integer nearest to x: ⎧ ⎪ − 1 ⎨ x , if x x < 2 ,

x := ⎪ ⎩  − ≥ 1 x , if x x 2 .

•{x} := x − [x] the fractional part of x.

9.1 Clock problems

Consider a clock with an hours hand and a minutes hand, graduated by the points 1, 2,...,12 indicating the hours. At time t (hours), t ∈ [0, 12), when the hours hand is at position t, the minutes hand is at position {12t}. Example 9.1. Three easy problems At what times do the hours hand and the minutes hand of a clock (1) align with one another, (2) point in opposite directions, (3) make right angles with each other ?

1This is also denoted [x] in older books. 202 Floor and Ceiling

Example 9.2. At what times must the hands of a clock be interchanged in order to obtain a new correct time? Solution. Let t ∈ [0, 12). At time t (hours), the hours hand is at position t and the minutes hand at position 12{t}. If the two hands are interchanged, the time is s =12{t} hours. The minutes hand should be at position 12{12t}. Now we require t =12{12t}. t = 12(12t − [12t]) = 144t − 12[12t]=⇒ 143t = 12[12t]. 12k Therefore, t = 143 for an integer k =1,...,11.

9.2 Some equations involving x

Example 9.3. Solve nx = n for a given integer n. If n =0, this is true for all x. If n =1, x =1 =⇒ x ∈ [1, 2). If n = −1, −x = −1=⇒x =1 =⇒ x ∈ (0, 1]. Now we assume |n| > 1. Write x = m + t for an integer m and 0 ≤ t<1. nx = mn + nt = n =⇒nt =(1− m)n. Since 0 ≤ t<1, nt is strictly between −n and n. It is a multiple of n only when nt =0and m =1.  ≤ 1 ∈ 1 Therefore, for n>1, 0 t< n , and x = m + t 1, 1+ n . For n<−1, t =0and m =1, x =1. Summary: ⎧ ⎪{1}, if n<−1, ⎪ ⎨⎪(0, 1], if n = −1, { } R x : nx = n = ⎪ , if n =0, ⎪ ⎪[0, 1),  if n =1, ⎩ 1 1, 1+ n , if n>1.

Example 9.4. For an integer n ≥ 2, solve the equation n x = nx.

Write x = m + t for an integer m and 0 ≤ t<1. nm = nm + nt = nm + nt. ⇒ ≤ 1 nt =0 = 0 t< n . 9.3 Number of trialing zeros in n! 203

  1 {x : n x = nx} = m, m + . m∈Z n Example 9.5. Let n be a positive integer. Solve the equation {x2} = n {x}.

9.3 Number of trialing zeros in n!

(1) Let p be a prime. The highest power of p dividing n! is     n n νp(n!) = + + ··· p p2 n − sp(n) = , p − 1 where sp(n) is the sum of the digits in the base p expansion of n.

n−s5(n) (2) The number of trailing zeros in n! is ν5(n)= 4 .

Example 9.6. Find the smallest n, if possible, for which n! ends in 2015 zeros. Solution. This number is around 4 · 2015 = 8060. Numbers around 8060 has 6 digits in their base 5 expansions. Therefore such a number is between 8060 and 8060 + 6 × 4 = 8084.

1 − Now, 8074 = 2242445 has digit sum 18. 8074! has 4 (8074 18) = 2014 trailing zeros. 1 − On the other hand, 8075 = 2243005 has digit sum 11. 8075! has 4 (8075 11) = 2016 trailing zeros. There is no integer n for which n! has exactly 2015 trailing zeros. Remark. The following numbers within 100 do not appear as the number of trailing zeros of n! for any integer n: 5, 11, 17, 23, 29, 30, 36, 42, 48, 54, 60, 61, 67, 73, 79, 85, 91, 92, 98,... 204 Floor and Ceiling

9.4 Characterizations of the ceiling and floor functions

Theorem. Let θ : Q −→ Z be a function satisfying (i) θ(c + x)=c + θ(x) for c ∈ Z and x ∈ Q, θ(x) x ∈ Q (ii) θ( n )=θ( n ) for x and positive integer n. Then either θ(x)=x or θ(x)=x.

Proof. (1) If θ(0) = k ∈ Z, then

k = θ(0) = θ(θ(0)) = θ(k)=θ(k +0)=k + θ(0). (ii) (i)

Therefore θ(0) = 0. (2) For every integer m, θ(m)=θ(m +0)=m + θ(0) = m. 1 (3) Let θ( 2 )=m for an integer m. For any nonnegative integer k,   1 1 2k +1 θ k + 1 m = θ = θ θ = θ 2 2 (ii) 2k +1 2 2k +1 k + θ( 1 ) k + m = θ 2 = θ . (ii) 2k +1 2k +1

(i) If m<0, then by putting k = −m(> 0), we have m = θ(0) = 0, a contradiction. (ii) If m>1, then by putting k = m − 1, we have m = θ(1) = 1, again a contradiction. 1 Therefore, θ 2 =0 or 1. 1 (4) Assume θ 2 =0.   1 We prove (by induction) that θ n =0for every integer n>1. This is true for n =2. 1 ≥ Assume  θ n =0for some integer  n 2. Then n+1 1 1 θ n = θ 1+ n =1+θ n =1+0=1. It follows that 1 1 n +1 1 θ = θ θ = θ =0. n +1 n +1 n n Therefore the proof is complete by induction.

1P. Eisele and K. P. Hadeler, Game of cards, dynamical systems, and a characterization of the floor and ceiling functions, AMERICAN MATH.MONTHLY, 97 (1990) 466Ð477. 9.4 Characterizations of the ceiling and floor functions 205   m (5) We prove (by induction on m) that θ n =0for 0 0, thenh 1= m , h = m , n = n =1+ n . mh m−r m−r Therefore, θ n = θ 1+ n =1+θ n =1+0=1. It follows that   m 1 mh 1 θ = θ θ = θ =0. n h n h

This completes the proof of (5) by induction. 1 ∈ ∩ Q (6) Summary (assuming θ 2 =0): if r (0, 1) , then θ(r)=0. It follows that for x ∈ Q, θ(x)=θ(x + {x})=x + θ({x})=x +0=x .   1 (7) It remains to consider the case when θ 2 =1. If θ satisfies (i) and (ii), then so does θ defined by θ (x)=−θ(−x). Proof: (i) θ (c + x)=−θ(−c − x)=−(−c + θ(−x)) = c − θ(−x)= c + θ (x).          θ(x) θ(x) θ(−x) (ii) θ = −θ − = −θ = −θ −x = θ x . n   n n n n 1 (8) If θ 2 =1 , then      1 − − 1 − − 1 − − 1 − − θ 2 = θ 2 = θ 1+ 2 = 1+θ 2 = ( 1+1)= 0. (9) Therefore, θ (x)=x, and θ(x)=−θ (−x)=−−x = x. 206 Floor and Ceiling Chapter 10

Combinatorial games

10.1 Subtraction games

Consider a 2-person game in which two players A (first) and B (second) alternately remove a positive amount of counters according to certain specified rules. The winner is the one who makes the last legitimate move.

Examples 1. Subtraction of a number

Winning strategy: secure a multiple of d. 2. Removal of 1, 2,or4:

Winning positions (which you want to secure to win) are multiples of 3. 3. Subtraction of proper (including 1): Two players start with a positive integer and alternately subtract any proper divisor of the number left by the opponent. If the starting number is 12, A may subtract either 1, 2, 3, 4,or 6 (but not 12). If he subtracts 2, leaving 10, then B may subtract either 1, 2,or5. 208 Combinatorial games

Winning positions: Odd numbers. 4. Subtraction of proper divisors not allowing 1: Winning positions: odd numbers and 22k−1. For example, start with 128. Whenever your opponent leaves you a number other than a power of 2, leave him an odd number by subtracting the largest possible odd factor. He will be forced to leave you an even number; eventually you will leave him with a prime number, which wins for you. If your opponent plays down the powers of 2 string you do the same and he is the loser because he will eventually be left with 2. From this he has no move. 5. Binary nim: no player may start by removing the whole pile; each player may not remove more than what his opponent has removed in his last move.

Winning strategy: if the pile size N is not a power of 2, remove the largest power of 2 dividing N. 6. Fibonacci nim: no player may start by removing the whole pile; each player may not remove more than twice what his opponent has removed in his last move. Winning strategy: if the pile size N is not a Fibonacci number, (i) remove the whole pile if possible, otherwise (ii) remove the smallest term in the Zeckendorff expression of N. 10.2 The Sprague-Grundy sequence 209

10.2 The Sprague-Grundy sequence

The Sprague-Grundy sequence of G is the sequence (g(n)) of nonnega- tive integers defined recursively as follows. (1) g(n)=0for 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

Examples 1. Subtraction of square numbers Two players alternately subtract a positive . We calculate the Sprague-Grundy sequence.

g(0) = 0 1 /0=⇒ g(1) = 1 2 /1=⇒ g(2) = 0 3 /2=⇒ g(3) = 1 4 /3, 0=⇒ g(4) = 2 5 /4, 1=⇒ g(5) = 0 6 /5, 2=⇒ g(6) = 1 7 /6, 3=⇒ g(7) = 0 8 /7, 4=⇒ g(8) = 1 9 /8, 5, 0=⇒ g(9) = 2 10 /9, 6, 1=⇒ g(10) = 0 The first 50 terms of the Sprague-Grundy sequence are as follows. 12345678910 101201012 0 101201012 0 101232345 3 234012320 1 232012323 4

Suppose we start with 74. Player A can subtract 64 to get 10, which has value 0. This means no matter how B moves, A can always win. 210 Combinatorial games

This is clear if B moves to 9 or 1. But if B moves to 6, then A can move to 5 which again has value 0, since now B can only move to 4 or 1. The winning positions within 300 are as follows.

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

2. Subtraction of primes The first 50 terms of the Sprague-Grundy sequence

12345678910 011223340 0 112233445 5 667704152 6 347001122 3 348576890 4 The winning positions within 300 are as follows.

0 1 910253435495585 91 100 115 121 125 133 145 155 169 175 187 195 205 217 235 247 253 259 265 289 295

3. Removal of 1, 3,or4:

Winning positions within 100:

0279141621232830 35 37 42 44 49 51 56 58 63 65 70 72 77 79 84 86 91 93 98 100

4. Removal of Fibonacci numbers 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, ...:

Winning positions within 300:

0 4 11 15 26 30 37 41 48 52 63 67 74 78 94 98 109 113 120 124 135 146 150 157 161 172 186 197 204 208 215 219 226 230 245 254 265 269 276 280 287 291 298 10.2 The Sprague-Grundy sequence 211

5. Removal of Lucas numbers 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, ...

Winning positions within 300:

0 2 8 10 16 25 30 35 40 52 60 68 73 83 85 93 98 108 113 118 134 143 151 156 164 170 176 186 195 200 212 214 220 222 228 237 245 250 270 278 291 300 212 Combinatorial games Chapter 11

Permutations

11.1 The universal sequence of permutations

For convenient programming we seek an enumeration of the permuta- tions. Regard each permutation of 1, 2, . . . n as a bijection π : N /N which is “eventually” constant, i.e., f(m)=m for m>n. The enu- meration begins with the identity permutation. The permutations of 1, 2, ...n are among the first n! of them, and each of the first (n − 1)! permutations ends with n. Given an integer m, we write

m − 1=r2 × 1! + r3 × 2! + ···+ rk × (k − 1)! for 0 ≤ ri

qi−1 = i × qi + ri.

In other words,    qi−1 (qi,ri)= , mod(qi−1,i) . i Along with these, we construct a sequence of lists which ends at the desired permutation. Let L1 =(1).Fori ≥ 2, form Li by inserting i into Li−1 so that there are exactly ri members smaller than i on its right hand side. Then Lk is the permutation corresponding to m. 214 Permutations

Example To find the 12345th permutation, we write 12344 = 0 × 1! + 1 × 2! + 1 × 3! + 4 × 4! + 0 × 5! + 3 × 6! + 2 × 7!. The corresponding sequences are

k Lk 1 (1) 2 (1, 2) 3 (1, 3, 2) 4 (1, 3, 4, 2) 5 (5, 1, 3, 4, 2) 6 (5, 1, 3, 4, 2, 6) 7 (5, 1, 3, 7, 4, 2, 6) 8 (5, 1, 3, 7, 4, 8, 2, 6) The permutation is (5,1,3,7,4,8,2,6).

11.2 The position of a permutation in the universal se- quence

Given a permutation Ln, we want to determine its position in the enu- meration scheme above. For j = n, n − 1,...,2, let (i) rj be the number of elements in Lj on the right hand side of j, (ii) Lj−1 be the sequence Lj with j deleted. Then, the position number of the permutation Ln is

1+r2 × 1! + r3 × 2! + ···+ rn × (n − 1)!. This number can be computed recursively as follows.

sn =rn, sn−1 =sn × (n − 1) + rk−1, . . sj−1 =sj × (j − 1) + rj−1, . . s2 =s2 × 2+r2, s1 =s2 × 1+1. 11.2 The position of a permutation in the universal sequence 215

Example Consider the permutation L =(1, 4, 6, 2, 3, 7, 9, 8, 5).

jLj rj sj 9(1, 4, 6, 2, 3, 7, 9, 8, 5) 2 2 8(1, 4, 6, 2, 3, 7, 8, 5) 1 17 7(1, 4, 6, 2, 3, 7, 5) 1 120 6(1, 4, 6, 2, 3, 5) 3 723 5(1, 4, 2, 3, 5) 0 3615 4(1, 4, 2, 3) 2 14462 3(1, 2, 3) 0 43386 2(1, 2) 0 86772 1 (1) 1 86773 This permutation appears as the 86773-th in the universal sequence. 216 Permutations

11.3 The disjoint cycle decomposition of a permutation

Theorem 11.1. Every permutation can be decomposed into a product of disjoint cycles. For example, the permutation 123456 7 8 9 XJQK 698342K 7 Q 51JX decomposes into the two disjoint cycles (1629QJ)(387KX54). Theorem 11.2. Every cycle decomposes into a product of transpositions. Theorem 11.3. A permutation can be decomposed into a product of transpositions. The (of the number of transpositions) of the per- mutation is independent of the decomposition. Thus, permutations are classified into even and odd permutations. Even (respectively odd) permutations are said to have parity +1 (respec- tively −1). Corollary 11.4. A cycle of length k has parity (−1)k−1. More generally, a permutation of n objects has parity

(−1)n− number of disjoint cycles in a decomposition.

In using this formula, the fixed points are counted as 1-cycles, though we usually do not write them in the cycle decomposition of a permuta- tion. 11.4 Lexicographical ordering of permutations 217

11.4 Lexicographical ordering of permutations

1. What is the permutation in a particular position when all permutations of n letters are arranged in lexicographical order? Among the n! permutations of 1, 2, ..., n in lexicographical order, the first (n − 1)! begin with 1, the next (n − 1)! begin with 2, and so on. The permutation at a particular position N can be determined as follows. (1) Successively divide N −1 by 2, 3,...n−1, and write the sequence of remainders in reverse order. For example, with N = 12345 (for 9 letters), we have

divisor remainder 1 12344 0 2 6172 0 3 2057 1 4 514 1 5 102 4 6170 72 3 80 2 90 0

The first line is artificial but helps simplifying the description of the procedure. The sequence of remainders has exactly n terms:

r1,r2,...,rn.

In this example, it is 0, 2, 3, 0, 4, 1, 1, 0, 0.

(2) Begin with the natural sequence A1 =1, 2, 3,...,n. For each position k =1,...,n, (i) form the k-th term of the ak := (1 + rk)-th term of Ak, (ii) the sequence Ak+1 by deleting ak from Ak. The 12345-th permutation in the lexicographical ordering of 9 letters is 146295738: 218 Permutations

krk Ak ak 10 1, 2, 3, 4, 5, 6, 7, 8, 91 22 2, 3, 4, 5, 6, 7, 8, 94 33 2, 3, 5, 6, 7, 8, 96 40 2, 3, 5, 7, 8, 92 54 3, 5, 7, 8, 99 61 3, 5, 7, 85 71 3, 7, 87 80 3, 83 90 8 8 11.4 Lexicographical ordering of permutations 219

2. What is the position of a given permutation among those of n letters arranged in lexicographical order? Begin with A1 := given permutation, and N0 := 0. For each k =1, 2,...,n, form (i) ak := −1+ position number of the first term of Ak when Ak is sorted in increasing order, (ii) Nk := (n +1− k) · Nk−1 + ak, (iii) Ak+1 by deleting the first term of Ak. The given permutation occupies position N =1+Nn in the lexico- graphical ordering of the permutations of n letters. For example, what is the position number of 642917835 among all permutations of 9 letters?

kAk ak Nk 1 642917835 5 9 · 0+5=5 2 42917835 3 8 · 5+3=43 3 2917835 1 7 · 43 + 1 = 302 4 917835 5 6 · 302 + 5 = 1817 5 17835 0 5 · 1817 + 0 = 9085 6 7835 2 4 · 9085 + 2 = 36342 7 835 2 3 · 36342 + 2 = 109028 835 0 2· 109028 + 0 = 218056 95 0 1· 218056 + 0 = 218056 This is the 218057-th permutation.

3. What is the permutation immediately following a given one? Find the rightmost pair ak,ak+1 in increasing order. Let b be the smallest term on the right of ak exceeding it. Interchange ak and b. Sort the terms subsequent to b in increasing order. Thus, for the permutation 365978421, we have the rightmost “in- creasing pair” 78, and b =8. Replace 7 by 8 and append 7421 sorted in increasing order. We obtain 365981247.

4. What is the permutation immediately preceding a given one? Find the longest increasing subsequence ak+1 ···an. (If there is no such sequence, simply interchange the last two terms). Among these terms let b be the greatest one smaller than ak. Interchange ak and b. Sort the terms subsequent to b (after decreasing order. 220 Permutations

For example, given 481962357, the longest increasing sequence on the right is 2357, preceded by 6. Replace 6 by 5 and sort 6237 in de- creasing order. Thus, we have 481957632 preceding the given one.

Exercise 1 (1) What is the 1234-th permutation among all permutations of 7 let- ters? (2) What is the 1234-th permutation among all permutations of 8 let- ters? (3) What is the position of the permutation 13578642 among all per- mutations of 8 letters? (4) Among the permutations of 8 letters, find the permutation imme- diately following 13578642. (5) Among the permutations of 8 letters, find the permutation imme- diately preceding 13578642.

1Answers can be found on the preceding page. 11.5 Dudeney’s puzzle 221

11.5 Dudeney’s puzzle

Take nine counters numbered 1 to 9, and place them in a row in the natural order. It is required in as few exchanges of pairs as possible to convert this into a square number. As an example in six moves we give the following: (7846932), which give the number 139854276, which is the square of 11826. But it can be done in much fewer moves. 2

The square of 12543 can be found in four moves, as follows.

123456789 (25) 153426789 (37) 157426389 (38) 157426839 (34) 157326849

The squares of 25572, 26733, and 27273 can also be obtained in four moves. • 123456789

653927184 • 123456789

714653289 • 123456789

743816529

2Puzzle 128 of [Dudeney] 222 Permutations

However, there is one, namely, 523814769, which can be made in three moves.

123456789 11.5 Dudeney’s puzzle 223

Exercise 1. While 7 × 28 = 196, it is not true that 34 × 5 = 196.

7 × 2 8 = 1 9 6 = 3 4 × 5 . Move as few counters as possible to make the equations valid. 224 Permutations

11.6 Problems on permutations

Denote by Sn the set of permutations of [n]:={1, 2,...,n}.  n | − | Example 11.1. Find maxπ∈Sn i=1 π(i) i . Solution. Consider each π ∈ Sn in disjoint cycle decomposition, and denote n d(π)= |π(i) − i|. i=1

(i) If (a1 ...akak+1 ...ar) is a cycle of π with least element a1 and greatest element ak, k

(a1a2)(a3a4) ···(a2k−1a2k)ifn =2k; (a1a2)(a3a4) ···(a2k−1a2k)(a2k+1)ifn =2k +1.

Here, d(π) ≤ d(π )=2((a2 +a4 +···+a2k)−(a1 +a3 +···+a2k−1)). It follows that, if n =2k, max d(π)=2((k +1)+(k +2)+···+2k) − (1 + 2 + ···+ k)) = 2k2, π∈Sn and if n =2k +1, max d(π)=2((k+2)+(k+2)+···+(2k+1))−(1+2+···+k)) = 2k(k+1). π∈Sn Summary: n   n2 max |π(i) − i| = . π∈Sn i=1 2 11.6 Problems on permutations 225

Exercise n 1. Prove that i=1 |π(i) − i| is an even number.

2. For what integers n does there exist a permutation (x1,x2,...,xn) of (1, 2,...,n) such that the differences |xk − k|, 1 ≤ k ≤ n, are all distinct?

3. Let Sn, n ≥ 2, denote the set of all permutations of {1, 2,...,n}. Obviously, 1 ≤ max |πi − i|≤n − 1 1≤i≤n

for each permutation π =(π1,π2,...,πn) in Sn.

(a) For how many permutations π ∈ Sn do we have max1≤i≤n |πi − i| = n − 1? Answer. 2(n − 1)! − (n − 2)!=(2n − 3)(n − 2)!.

(b) For how many permutations π ∈ Sn do we have max1≤i≤n |πi − i| =1?

Answer. Fn+1 − 1

4. Call a permutation π ∈ Sn an equidistance permutation if there is a constant c =0 such that |π(i) − i| = c for all i ∈ [n]. Find the number of equidistancet permutations in Sn.   n Answer. n must be even, and there are there are τ 2 equidistance permutations.

5. Let n ≥ 2. Find all permutations π ∈ Sn satisfying 1|π(1) − π(2), 2|π(2) − π(3), ..., n− 1|π(n − 1) − π(n)?

n 6. Let c(π):= i=1 |π(i +1)− π(i)|.

(a) What is minπ∈Sn c(π)? How many permutations of Sn achieve this minimum? Answer. n · 2n−2 permutations achieve min c(π)=2n − 2.

(b) What is maxπ∈Sn c(π)? How many permutations of Sn achieve this maximum? Answer.Ifn =2k, 2(k!)2 permutations achieve max c(π)= 1 2 2 2 n .Ifn =2k +1, 2(2k +1)(k!) permutations achieve n2−1 max c(π)= 2 . 226 Permutations Chapter 12

Perfect card shuffles

Consider a deck of an even number of cards, say, 2n. Separates the top half (of n cards) from the bottom half, and perfectly interlaces them. It is called the out-shuffle if the top and bottom cards remain respectively on top and in bottom. Otherwise it is called the in-shuffle.

1 2 3 4

5 6 7 8

Figure 12.1: The out-shuffle ω8

More generally, the out-shuffle on 2n cards is the permutation

ω2n =(1,n+1, 2,n+2, ..., n− 1, 2n − 1,n,2n). While it demands great skill to actually do an out-shuffle, we achieve this in the following leisurely way. Align the two halves of cards in two rows and n columns, the first half in the top row, and the second half in the bottom row. Collect the cards along the columns, from top to bottom, then left to right. This gives the out-shuffle ω2n. If you want to do the in-shuffle, put the first half in the bottom row and the second half in the top row instead.

ρ2n =(n +1, 1,n+2, 2, ..., 2n − 1,n− 1, 2n, n). 228 Perfect card shuffles

5 6 7 8

1 2 3 4

Figure 12.2: The in-shuffle ρ8

Examples (1) 8 cards ι 12345678 ω 15263748 ω2 13572468 ω3 12345678 ι 12345678 ρ 51627384 ρ2 75318642 ρ3 87654321 ρ4 48372615 ρ5 24681357 ρ6 12345678 (2) 10 cards ι 12345678910 ω 16273849510 ω2 18642975310 ω3 19876543210 ω4 15948372610 ω5 13579246810 ω6 12345678910 ι 12345678910 ρ 61728394105 ρ2 36914710258 ρ3 73106295184 ρ4 97531108642 ρ5 10987654321 ρ6 51049382716 ρ7 85210741963 ρ8 48159261037 ρ9 24681013579 ρ10 12345678910 12.1 In-shuffles 229

12.1 In-shuffles

We shall simply write ρ for ρ2n.  m, if k =2m, ρ(k)= n + m, if k =2m − 1.

Example 12.1. Take a complete suit of spade put an extra heart at the end to form a row of 14 cards. Here, 2n =14and n + 1 = 8 = 10002. We consider every number ≤ 14 with 4 binary digits. In this case, ρ14 is simply transferring the rightmost binary digit of k to the leftmost positions. This is why after 4 in-shuffles, every card is restored. This applies to any n which is one less than a power of 2: if the number of cards is 2 less than a power of 2, after an in-shuffle, the card in position k has number obtained by transferring the rightmost binary digit of k to the leftmost. Example:

ρ14(7) = ρ14(01112) = 10112 =11.

Where does card 18 go after 3 in-shuffles of 30 cards? Here, we work with 5 binary digits, and keep track of this by transferring the leftmost binary digit to the rightmost:

−3 −3 −2 −1 ρ (18) = ρ (100102)=ρ (001012)=ρ (010102) = 101002 =20.

Example 12.2. For an ordinary deck of 52 cards, n + 1 = 27 = 110112. What is the 11-th card after 4 in-shuffles? Note that 11 = 10112.

4 3 3 ρ (10112)=ρ (110112 + 1012)=ρ (1000002) 2 =ρ (100002) =ρ(10002) =1002

This is 4. In the natural order, this is ♣4. The positions of a particular card under repeated in-shuffles has an easy description in terms of congruences.  2k, if k ≤ n, ρ−1(k)= 2k − 2n − 1, if k>n, 230 Perfect card shuffles or we simply say ρ−1(k)=2k mod (2n +1).

−1 • ρ is simply multiplication by 2 in Z2n+1 := Z2n+1 \{0}.If is the smallest positive integer with 2 ≡ 1mod2n +1, then in-shuffles restore every card in their original positions.

Exercise 1. How many in-shuffles of a deck of 52 cards will bring the first card to the third position? 1 2. How many in-shuffles of a deck of 52 cards will bring every card to its original position?

13 · 2 ≡ 1mod53for =17. 12.2 Out-shuffles 231

12.2 Out-shuffles

We write ω for the out-shuffle ω2n when the number of cards is clear from the context.  m, if k =2m − 1, ω(k)= n + m, if k =2m. In terms of binary digits, ω(k) is found by deleting the rightmost binary digit from k, and to the resulting number add this digit if it is nonzero, otherwise, add n. For the inverse, we have  2k − 1ifk ≤ n, ω−1(k)= 2(k − n)ifk>n, or simply ω−1(k)=2k − 1mod(2n − 1). Example 12.3. Take an ordinary deck of 2n =52cards and out-shuffle 3 times. Where does card 13 appear? −3 −2 −1 −1 ω52 (13) ≡ ω52 (25) ≡ ω52 (49) ≡ ω52 (−2) ≡−5 ≡ 46 mod 51. On the other hand, what is the 13-th card after 3 out-shuffles? With n = 26 = 110102,wehave 3 2 ω (11012)=ω (1112) =ω(1002) =110102 +102 =111002 =28. If the original order is natural, then this is ♥2.

Theorem 12.1. The out-shuffle ω52 has order 8.

Proof. This follows from the cycle decompostion of ω52: (1)(2, 27, 14, 33, 17, 9, 5, 3)(4, 28, 40, 46, 49, 25, 13, 7)(6, 29, 15, 8, 30, 41, 21, 11) (10, 31, 16, 34, 43, 22, 37, 19)(12, 32, 42, 47, 24, 38, 45, 23)(18, 35) (20, 36, 44, 48, 50, 51, 26, 39)(52). It has 6 cycles of length 8, one cycle of length 2, two cycles of length 1. The order is 8. 232 Perfect card shuffles

12.3 Perfect shuffling a card to a specified position

The position of card in the m-th in-shuffle is 2m mod 53. To put card 1 in position 3, we need to iterate the in-shuffle 17 times. Can it be done in fewer step with we allow both kinds? Theorem 12.2. In a deck of N cards, to move the top card to position m ≤ N, express m − 1 as a , replace each 1 by ρ−1 and each 0 by ω−1, resulting in a sequence of shuffles from left to right. The composite will move the top card to position m. Corollary 12.3. In a deck of 52 card, the top card can be moved to any position by no more than 6 perfect shuffles. For example, to bring the top card to the 13-th position, we note from −1 −1 −1 −1 12 = 11002 that the sequence ρ ρ ω ω , from left to right, will do the job: ρ−1 ρ−1 ω−1 ω−1 1 −→ 2 −→ 4 −→ 7 −→ 13.

Exercise 1. The 52 cards in a deck are face down, in their usual order, ♣A, ♣2, ..., ♠Q, ♠K. What is the 10-th card after 2 in-, 3 out-, followed by another in-shuffles? 2. In how many shuffles, either in- or out-, can ♣A be brought to the 12-th place? How? Chapter 13

Interpolation problems

13.1 What is 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 +1consecutive integers 0, 1, ..., n. Then we can easily find the values of f(x +1)− f(x) at1,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. 234 Interpolation 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  0ifn is odd, f(−1) = 1ifn 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 13.2 What is f(n +1)if f(k)= k+1 for k =0, 1, 2 ...,n? 235

1 13.2 What is 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 1 1 1 1 1 ··· 1 f(x)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=0for x = 0, 1,...,n. Therefore, (x +1)f(x) − 1 is a polynomial of degree n +1 with n +1roots 0, 1,...,n. (x +1)f(x) − 1=cx(x − 1)(x − 2) ···(x − n), for some constant c. With x = −1,wehave (−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. 236 Interpolation 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). Fn, if n is odd, Answer. f(n +1)= 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. 13.3 Why is ex not a rational function? 237

13.3 Why is 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 divisors (other than scalars from the field of coefficients). Theorem 13.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)=degf +degg. (c) If f =0 , then deg f < deg f. (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 =degP − 1. P (x) P Q−PQ P − PQ Now let f(x)= Q(x) . Then f = Q2 = Q Q2 . Now, P deg =degP − deg Q =(degP − 1) − deg Q Q =degP − deg Q − 1=degf − 1, PQ deg =degP +(degQ − 1) − 2degQ Q2 =degP − deg Q − 1=degf − 1.

It follows from (a) that deg f ≤ deg f − 1. This proves (c). Corollary 13.2. ex is not a rational function. Proof. Note that f(x)=ex satisfies the differential equation (x)= f(x). Suppose f(x)=ex is a rational function. Then deg f =degf ≤ deg f − 1, a contradiction. 238 Interpolation problems

Exercise 1. Make use of the fact (tan x) =sec2 x to show that tan x is not a rational function. 2 1 2. Make use of the identity cos x = 2 (1 + cos 2x) to show that cos x is not a rational function. 3. Deduce that sin x is not a rational function. 4. Show that the function log x is not a rational function. Chapter 14

Transferrable numbers

14.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

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

n (10 − k)X = a(10 − 1) = 9 × an, and

9 × a × 1n X = . 10 − k

Clearly, k =1if 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). 240 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 n · 106m−1 is a multiple of 6. Therefore X = a 7 and has first digit a. Now, 106m − 1 = (142857)m. 7 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)m = (428571)m, 3 × (285714)m = (857142)m. 14.2 Left-transferrable integers 241

14.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

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

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

Again, k =1if 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.

kn 219Y = b(10n − 1) 19|10n − 118m 329Y = b(10n − 1) 29|10n − 128m 439Y = b(10n − 1) b =3 , 6, 9; 39|10n − 16m 549Y = b(10n − 1) b =7;49 |10n − 142m b =7;7|10n − 16m 659Y = b(10n − 1) 59|10n − 158m 769Y = b(10n − 1) b =3 , 6, 9; 69|10n − 122m 879Y = b(10n − 1) 79|10n − 113m 989Y = b(10n − 1) 89|10n − 144m

Consider the case k =2.Wehaven =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: 242 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

(bXb)m =(2× Yb)m =2× (Yb)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 0169491525423728813559322033898305084745762711864406779661 7 0144927536231884057971 8 79 0126582278481 9 89 01123595505617977528089887640449438202247191 14.2 Left-transferrable integers 243

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?

RR RRRRR × RR RRRRR 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). p 7. If a Mersenne number Mp =2 − 1 is prime, is the corresponding repunit 1p also prime? 244 Transferrable numbers Chapter 15

The equilateral lattice L (n)

15.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 +1points, there are 2 such triangles. (2) Inverted ones with exactly one vertex on the new base line: there are 1+2+ ··· +2+1 such triangles. n−1 terms n +1 T (n)=T (n − 1) + +1+2+···+2+1. 2   n−1 terms 246 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 4 , where  1, if n is odd, δn = . 0, if n is even.

2. With δn defined above, show that n n + δn δk = . k=1 2

3. Define  1, if n is even, εn = . 0, if n is odd. Show that n n − 1+εn εk = . k=1 2 Therefore, 2 2 n +1 n − δn 3n +2n − δn T (n) − T (n − 1) = + = , 2 4 4 and 15.1 Counting triangles 247

n T (n)=T (0) + (T (k) − T (k − 1)) k=1 n 2 3k +2k − δk = k=1 4 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 ··· 248 The equilateral lattice L (n)

15.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 +1points. 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 − 1. Show that P (n) is the 2 (n 1)(n +2)-th . 15.3 Counting regular hexagons 249

15.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   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 k 3j − 1 = j=1 2 k 1 = (3j − 1)(3j − 2) 2 j=1 = ··· 1 = k(3k2 − 1). 2 250 The equilateral lattice L (n)

(ii) n =3k +1: k H(3k +1)= H(1) + H(3j +1)− H(3j − 2)) j=1 k 3j = j=1 2 = ··· 3 = k2(k +1). 2 (iii) n =3k +2: k H(3k +2)= H(2) + H(3j +2)− H(3j − 1)) j=1 k 3j +1 = j=1 2 = ··· 3 = k(k +1)2. 2 Summary: ⎧ ⎪ 1 2 − ≡ ⎨ 18 n(n 3), if n 0(mod3), 1 − 2 ≡ H(n)=⎪ 18 (n 1) (n +2), if n 1(mod3), ⎩ 1 2 − ≡ 18 (n +1) (n 2), if n 2(mod3).

n 3 4 5 6 7 8 9 10 11 ··· H(n) 1 3 6 11 18 27 39 54 72 ··· 15.3 Counting regular hexagons 251

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? 252 The equilateral lattice L (n) Chapter 16

Counting triangles

16.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.Forn ≥ 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

a n 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 2 = ((n +1) − εn), 4 254 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 1 = ((k +1)2 − ε(k)) 4 k=1 1 1 n − 1+εn = (n +1)(n + 2)(2n +3)− 1 − 4 6 2 1 1 εn = (n +1)(n + 3)(2n +1)− 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 ···

16.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). 16.3 Number of integer triangles with perimeter n 255

16.3 Number of integer triangles with perimeter n

16.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 − δn p2(n):=|{(a, b):1≤ a ≤ b, a + b = n}| = = . 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

p3(n)= p2(n − 3a). a=1 We distinguish between the following cases. (1) n =3k: k p3(3k)= p2(3(k − a)) a=1 k−1 = p2(3j) j=0 1 k−1 = (3j +1+ε ) 2 3j j=0 1 1 1 k−1 = · k(1 + 3(k − 1) + 1) + ε 2 2 2 j j=0 1 k +1− ε = k(3k − 1) + k 4 4 1   = 3k2 +1− ε 4 k   1 n2 = +1− ε 4 3 n n2 δ = + n . 12 4 256 Counting triangles

(2) n =3k +1: k p3(3k +1)= p2(3(k − a)+1) a=1 k−1 = p2(3j +1) j=0 1 k−1 = (3j +2+ε ) 2 3j+1 j=0 1 k−1 = (3j +2+δ ) 2 j j=0 1 1 1 k−1 = · k(2 + 3(k − 1) + 2) + δ 2 2 2 j j=0 1 k − δ = k(3k +1)+ k 4 4 1  2  = 3k +2k − δk 4   1 1 = (n2 − 1) − ε 4 3 n n2 3+ε = − n . 12 12 16.3 Number of integer triangles with perimeter n 257

(3) n =3k +2: k p3(3k +2)= p2(3(k − a)+2) a=1 k−1 = p2(3j +2) j=0 1 k−1 = (3j +3+ε ) 2 3j+2 j=0 1 k−1 = (3j +3+ε ) 2 j j=0 1 3 1 k−1 = · k(k +1)+ ε 2 2 2 j j=0 1 k +1− ε = · 3k(k +1)+ k 4 4 1  2  = 3k +4k +1− εk 4   1 1 = (n2 − 1) − ε 4 3 n n2 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} =1and { 3} =2. ! n2 Summary: p3(n)= 12 . 258 Counting triangles

Theorem 16.1. The number of integer triangles with perimeter n is ⎧ ! ⎪ n2 ⎨⎪ 48 , if n is even, c(n)=⎪ ! ⎩⎪ (n+3)2 48 , if n is odd.

Proof. The number of triangles of perimeter n is p3(n), subtracting the ≤ ≤ ≤ − ≤ n number of those partitions a b c with c a+b = n c, i.e., c 2 :  n  2 c(n)=p3(n) − p2(c). c=1 Note that h h 1 p2(c)= (c − δc) 2 c=1 c=1 1 1 h − δh = h(h +1)− 2 2 2   1 2 = h + δh . 4

 n  2 n p3(n) c=1 p2(c) c(n) n2 n2 n2 12k 12 16 48 n2−1 (n−1)2 n2+6n−7 (n+3)2−16 12k +1 12 16 48 48 n2−4 n2−4 n2−4 12k +2 12 16 48 n2+3 n2−2n−3 n2+6n+21 (n+3)2+12 12k +3 12 16 48 48 n2−4 n2 n2−16 12k +4 12 16 48 n2−1 (n−1)2 n2+6n−7 (n+3)2−16 12k +5 12 16 48 48 n2 n2−4 n2+12 12k +6 12 16 48 n2−1 n2−2n−3 n2+6n+5 (n+3)2−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 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) 16.3 Number of integer triangles with perimeter n 259

1 n2 (n+3)2 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 Chapter 17

Pythagorean triangles

17.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>nand form

(a, b, c)=(2mn, m2 − n2,m2 + n2).

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

B

2 n + 2 2mn m

A m2 − n2 C

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. 302 Pythagorean triangles

17.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 , which has r =(m − n)n.

B

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

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

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

17.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. 17.1 Primitive Pythagorean triples 303

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 304 Pythagorean triangles

17.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 shape of the right triangle is given by a primitive Pythagorean triple (a, b, c). The length of a side of the square must be a common mul- 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? 17.3 When are x2 − px ± q both factorable? 305

17.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 − 4q 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 those of x2+px−q are s − c and −s. Here, s is the semiperimeter of the Pythagorean triangle.

17.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 306 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 18

The area of a triangle

18.1 Heron’s formula for the area of a triangle

Theorem 18.1. The area of a triangle of sidelengths a, b, c is given by "  = s(s − a)(s − b)(s − c), 1 where s = 2 (a + b + c).

B

Ia

I ra

r

C A Y s − b s − c Y 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 · ra =(s − b)(s − c). 308 The area of a triangle

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

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

18.2 Heron triangles

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

18.2.1 The perimeter of a Heron triangle is even Proposition 18.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.

18.2.2 The area of a Heron triangle is divisible by 6 Proposition 18.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(mod3)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. 310 The area of a triangle

18.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) 18.3 Heron triangle as lattice triangle 311

18.3 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 18.4. Every Heron triangle can be realized as a lattice trian- gle. Example 18.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. 312 The area of a triangle

18.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.

Exercise 1. Find all shapes of Heron triangles that can be obtained by joining integer multiples of (3, 4, 5) and (5, 12, 13). 18.4 Indecomposable Heron triangles 313

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 known that the smallest acute Heron triangle also has its longest sides two consecutive integers. Identify this triangle. 314 The area of a triangle

18.5 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)=4s2. 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 =3or 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 =3or 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) 18.6 Heron triangles with integer inradii 315

18.6 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.Wehave uvw = n2. u + v + w ≤ ≤ n2(u+v) If we assume√u v w, then (i) w = uv−n2 , (ii) n ≤ u ≤ √ 3n, and ≤ n(n+ n2+u2) (iii) v u . Therefore, the number T (n) of integer triangles with inradius n is finite. Here are the beginning values of T (n):

n 12345678910··· T (n)151318154524455152···

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 . 316 The area of a triangle

18.7 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

1American Mathematical Monthly, 98 (1991). 2On A4 + B4 + C4 = D4, Math. Comp., 51 (1988) 825 Ð 835. Chapter 19

The golden ratio

19.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 = PB AB. Equivalently, PB = 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 19.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. 318 The golden ratio

Suppose PB has unit length. The length ϕ of AP satisfies ϕ2 = ϕ +1.

This equation can be rearranged as

2 1 5 ϕ − = . 2 4 Since ϕ>1,wehave   1 √ ϕ = 5+1 . 2 Note that √ AP ϕ 1 2 5 − 1 = = = √ = . AB ϕ +1 ϕ 5+1 2 This explains the construction above. 19.2 The regular pentagon 319

19.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 = ∠PCB =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,wehaveAB : AC = BC : PB. In other words AB · AP = AP · PB,orAP 2 = AB · PB. This means that P divides AB in the golden ratio. 320 The golden ratio

19.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 ϕ

◦ ϕ cos 36 = 2 .

C

C

54◦ 72◦

◦ 36 B A P 1

◦ 54 ◦ 72 B A P ϕ D

◦ 1 cos 72 = 2ϕ . 19.3 Construction of 36◦, 54◦, and 72◦ angles 321

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.IfD is the vertex above A, construct the bisector of angle ADC to intersect AB at P . Calculate the ratio AP : PB.

D

A P B C 322 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 TX ZT AB , XY , TO. is equal to the golden ratio.

Z X Y

T B O A 19.3 Construction of 36◦, 54◦, and 72◦ angles 323

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? 324 The golden ratio

19.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 19.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,wehave 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],wehavet2 + 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 20

The Arbelos

20.1 Archimedes’ twin circle theorem

Theorem 20.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 PQ. Denote by t the radius of this circle. Calculating in two ways the height of the center of this circle above the line AB,wehave (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 PQhas the same radius t. 326 The Arbelos

20.2 Incircle of the arbelos

Theorem 20.2 (Archimedes). The circle tangent to each of the three ab(a+b) semicircles has radius given by ρ = 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 θ,wehave 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. Theorem 20.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 20.2 Incircle of the arbelos 327

20.2.1 Construction of incircle of arbelos Bankoff’s construction

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 the incircle of the arbelos. Z

Q1 C

X Q2

C 3 Y

A O1 O P O2 B Note that C3(P ) has the same radius as the Archimedean circles.

Woo’s constructions

L Z

L O3 Z M

O N M 3 X N Y S X Y

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

Z

O 3 M

L X Z Y N

A B O3 P M O1 O O2

N

X Y

L A O1 O P O2 B 328 The Arbelos

20.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.

C5 H U

M N V

K

C4

A O1 O P O2 B

Let M be the midpoint of the chord HK. Since O and P are sym- metric (isotomic conjugates) with respect to O1O2,

OM + PN = O1U + O2V = a + b. it follows that (a+b)−QM = PN =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. Theorem 20.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 20.3 Archimedean circles in the arbelos 329

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). 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 PQ 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 PQ has radius ab t = a+b .

Q

C

A O1 O P O2 B 330 The Arbelos Chapter 21

Menelaus and Ceva theorems

21.1 Menelaus’ theorem

Theorem 21.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 YA 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 YW It follows that BX CY AZ WY CY AY CY AY WY · · = · · = · · = −1. XC YA ZB YC YA YW YC YA YW 332 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 YA ZB It follows that CY CY = . Y A YA 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 21.1. The external angle bisectors of a triangle intersect their opposite sides at three collinear points.

Y

A

c b

C

X B 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 XC Y A ZB = 1 and the points X , Y , Z are collinear. 21.2 Ceva’s theorem 333

21.2 Ceva’s theorem

Theorem 21.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 YA 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 PA BX · · = −1, or · · =+1. YA PX BC YA 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 PA ZB XC PA Multiplying the two equations together, we have CY AZ BX · · =+1. YA ZB XC (⇐=) Exercise. 334 Menelaus and Ceva theorems

Example 21.2. (1) The centroid.IfD, E, F are the midpoints of the sides BC, CA, AB of triangle ABC, then clearly AF BD CE · · =1. FB 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 YA c

A

Y Z I

B X C It follows that AZ BX CY b c a · · = · · =+1, ZB XC YA a b c and AX, BY , CZ are concurrent. Their intersection is the incenter of the triangle. 21.2 Ceva’s theorem 335

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 AXT Y .

P A Q

Y

Z

B X T C Note that triangle AT C is isosceles since ∠TAC = ∠AT X−∠ACB = π − π π 4 8 = 8 = C. Therefore, BX 1 = √ , XC 1+ 2 √ CY BC 2+ 2 √ = = √ =1+ 2. YA BA 2 Since Z is the midpoint of AB, BX CY AZ · · =1. XC YA ZB The three lines AX, BY , CZ are concurrent by Ceva’s theorem. 336 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 C B C X 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 21.2 Ceva’s theorem 337

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 338 Menelaus and Ceva theorems Chapter 22

Routh and Ceva theorems

22.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

C B(mass y) C(mass z) B X(mass y + z) 340 Routh and Ceva theorems

22.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 22.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. 22.2 Cevian and traces 341

Example 22.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 22.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). 342 Routh and Ceva theorems

22.3 Area and barycentric coordinates

Theorem 22.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

C B X(mass y + z)

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. 22.3 Area and barycentric coordinates 343

A useful area formula

If for i =1, 2, 3, Pi = xi · A + yi · B + zi · C (in absolute barycentric coordinates), then the area of the oriented triangle P1P2P3 is x1 y1 z1 ΔP1P2P3 = x2 y2 z2 · ΔABC. x3 y3 z3

Example 22.3. Let X, Y , Z be points on BC, CA, AB such that BX : XC =2:1, CY : YA =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. 012 1 1 1 28 7 ΔXY Z = · · 305 ΔABC = ΔABC = ΔABC. 3 8 5 230 120 30 344 Routh and Ceva theorems

Example 22.4. With the same points X, Y , Z in the preceding example, the lines AX, BY , CZ bound a triangle PQR. Suppose triangle ABC has area Δ. Find the area of triangle PQR. 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 PQR 10 15 6 1 · 576 = · · 236 Δ= Δ. 31 11 19 10 3 6 6479 22.3 Area and barycentric coordinates 345

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 PB. (iii) Compare the areas of triangles XY Z and PQR. 1

1Crux Math. Problem 3609. Answer: 4. 346 Routh and Ceva theorems Chapter 23

Perimeter - area bisectors of a triangle

Given triangle ABC with sidelengths BC = a, CA = b, and AB = c, let s denote the semiperimeter. Let Y and Z be points on the sides AC and AB respectively. We call the line YZ (i) a perimeter bisector in angle A if AY + AZ = ZB+ BC + CY = s, (ii) an area bisector in angle A if the areas of triangle AZY and convex quadrilateral ZBCY are each one half of the area of triangle ABC, (iii) a perimeter-area bisector in angle A if it is both a perimeter bisector and an area bisector in angle A.

A

Y

Z

I Y

B C

Figure 23.1:

A perimeter-area bisector YZ in angle A of triangle ABC depends on the lengths of AY = y and AZ = z. We require y + z = s and 348 Perimeter - area bisectors of a triangle

1 yz = 2 bc. These two lengths are the roots of the quadratic polynomial

2 1 Qa(t):= t − st + bc 2  2 s Da = t − − , 2 4 where 2 Da = s − 2bc =((s − a)+(s − b)+(s − c))2 − 2((s − c)+(s − a))((s − a)+(s − b)) =(s − b)2 +(s − c)2 − (s − a)2. It is interesting to note that a perimeter bisector necessarily passes through the incenter of the triangle. We shall make use of this to simplify a construction in §23.4 below. Clearly, if the line YZis a perimeter-area bisector in angle A, then so is its reflection in the bisector of angle A, provided that the reflections Z of Y , and Y of Z are on the sides AB and AC respectively. The line Y Z in Figure 23.6, for example, is not a perimeter-area bisector in angle A.

23.1 Construction of perimeter-area bisectors in angle A

Figure 23.2 shows a simple geometric construction of these two lengths. Suppose there is a circle C which has 1 (i) a chord through A divided into two segments of lengths b and 2 c, and (ii) another chord of length s. Then a tangent through A to the concentric circle C tangent to the chord in (ii) solves our problem, because it clearly has the same length s, and by the intersecting chords theorem, the product of the two segments divided by A is the same as the product of the segments of the chord in (i). Now, given triangle ABC, we take C to be the circumcircle of A B C, where A is a point on the extension of CB such that CA = s, and B c is a point on the extension of CA such that AB = 2 . (The point A is the point of tangency of the line BC with the excircle on the opposite side of C.) The circle C is concentric with C, and tangent to A C at its midpoint. If the vertex A is on or outside the circle C , construct a tangent from A to C to intersect C the circle C at B and C . With these, construct 23.2 Isosceles triangles 349

B

C C A

C Y Z O B

Y C A B Z

Figure 23.2: points Y on AC, Z on AB such that AY = AZ = AB , and Y on AC, Z on AB such that AY = AZ = AC . Each of the lines YZ and Y Z is a perimeter-area bisector in angle A, provided both of its endpoints are on the sides AC and AB respectively. For example, in Figure 23.2, the line YZis a perimeter-area bisector, but Y Z is not. Clearly, if the vertex A is inside the circle C , there is no perimeter- area bisector in angle A. We also speak of perimeter-area bisectors in angles B and C.In §§23.2, 23.3 below, we determine the number of perimeter-area bisector in terms of the lengths a, b, c.

23.2 Isosceles triangles

We begin with the equilateral triangle. Clearly each angle bisector is a perimeter-area bisector. There are no others since for the perimeter-area − − a bisectors in angle A, the polynomial Qa(t)=(t a) t 2 leads to the bisectors of angle B and C. Lemma 23.1. A perimeter-area bisector passes through a vertex of the triangle if and only if it is isosceles. Proof. If AB = AC, then the bisector of angle A is clearly a perimeter- area bisector in angle B and C. Conversely, let a perimeter-area bisector YZ in angle A pass through a vertex, say Y = C. Then, b is a root of 1 − the polynomial Qa(t). Since Qa(b)= 2 b(b a), we must have b = a, and the triangle is isosceles. 350 Perimeter - area bisectors of a triangle

Now, let ABC be isosceles with AB = AC. We determine the perimeter-area bisectors in angle A. Since b = c, in this case, 2 a +2b Da Qa(t)= t − − , 4 4

(a+2b)2−8b2 where Da = 4 . If Da < 0, there is no perimeter-area bisector in angle A. a+2b If Da =0, then Qa(t) has a unique positive root 4 0 so that Qa(t) has two positive roots. 1 − (i) If a>b, then Qa(b)= 2 b(b a) < 0, and Qa(t) has a root greater than b. In this case, there is no perimeter-area bisector in angle A. s (ii) If a 0,Qa = − < 0,Qa(b) > 0, 2 4 both roots of Qa are smaller than b. In this case, there are two perimeter- area bisectors in angle A. Counting also the bisector of angle A, we obtain the following enu- meration of perimeter-area bisectors of an isosceles triangle. Proposition 23.2. Let ABC be an isosceles triangle with b = c, the number of perimeter-area bisectors is 1 if Da < 0 or a>b, 2 if Da =0, 3 if Da > 0 and a ≤ b.

Remark. In terms of a and b = c, Da is negative, zero,√ or positive ac- cording as a is greater than, equal to, or less than 2( 2 − 1)b.

23.3 Scalene triangles

Since we have dealt with the isosceles case, we shall assume a

If Da > 0, the two positive roots of Qa(t) are smaller than b (and c) since   1 s Da 1 Qa(0) = bc > 0,Qa = − < 0,Qa(b)= b(b−a) > 0. 2 2 4 2 In this case, there are two perimeter-area bisectors. Now consider the perimeter-area bisector in angle B. These are given by the roots of the quadratic polynomial  2 2 1 s Db Qb(t)=t − st + ca = t − − , 2 2 4 where 2 2 2 Db =(s − c) +(s − a) − (s − b) > 0. In this case, 1 1 1 Qb(0) = ca > 0,Qb(a)=− a(b−a) < 0,Qb(c)= c(c−b) > 0. 2 2 2 The two roots are smaller than c, but are separated by a. There is only one perimeter-area bisector in the “middle” angle B. Finally, the perimeter-area bisectors in angle C are given by the roots of the quadratic polynomial  2 2 1 s Dc Qc(t)=t − st + ab = t − − , 2 2 4 where 2 2 2 Dc =(s − a) +(s − b) − (s − c) > 0. In this case, 1 1 1 Qc(0) = ab > 0,Qc(a)=− a(c−a) < 0,Qc(b)=− b(c−b) < 0. 2 2 2 The larger root is greater than b (and a). There is no perimeter-area bisector in the largest angle. Combining these results with Proposition 23.2, we obtain the follow- ing enumeration result on the number of perimeter-area bisectors. Theorem 23.3. Let ABC be a triangle with a ≤ b ≤ c. The number of perimeter-area bisectors is 1, 2,or3 according as 2 2 2 Da =(s − b) +(s − c) − (s − a) is negative, zero, or positive. 352 Perimeter - area bisectors of a triangle

23.4 Triangles with exactly two perimeter-area bisec- tors

Here is a construction of triangles satisfying Da =0. Let X be a point on a given a segment BC. Construct (i) a point PY on the perpendicular to BC at B such that BP = XC, (ii) the circle, center X, radius XP, to intersect the line BC at B and C (so that B and B are on the same side of X, as are C and C ), (iii) the circles, center B, radius BC , and center C, radius CB , to in- tersect at A. ABC is a triangle whose incircle touches BC at X, and satisfies

(s − b)2 +(s − c)2 =(s − a)2.

The perimeter-area bisector in angle A is the perpendicular to the bisec- tor at the incenter I (see [?, Lemma 1] and Figure 23.3).

A

Z P

Y I

B B X C C

Figure 23.3:

Remark. If in (ii) above, the radius of the circle is taken to be shorter (re- spectively longer) than XP, then with A constructed in (iii), the number of perimeter-area bisectors in angle A is 2 (respectively 0).

There is a unique right triangle satisfying Da =0. If we put t = A − 2 2 3 − 2 tan 2 , then a : b : c =2t :1 t :1+t , and Da =(t + 1)(2t 2t + 3t−1). This has a unique real root, which is approximately 0.396608 ···. Correspondingly, A ≈ 43.2674 degrees. 23.5 Integer triangles 353

23.5 Integer triangles

We determine scalene triangles with integer sides whose perimeter-area bisectors are given by points on the sides with rational (integer or half- integer) distances from the vertices.

23.5.1 Triangles with Da < 0

2 2 2 2 We require Db =(s − c) +(s − a) − (s − b) = v for an integer v. 2 2 2 2 Let d1 = h1 + k1 with h1 >k1 and d2 = h2 + k2 with h2 >k2.We further assume k1h2

p = h1h2 + k1k2,q= h1k2 − k1h2; u = h1h2 − k1k2,v= h1k2 + k1h2.

Note that p>u>q. Also,

2 2 2 2 2 2 2 u + q − p = h1k2 + h2k1 − 6h1h2k1k2 2 2 < 2h1k2 − 6h1h2k1k2 =2h1k2(h1k2 − 3h2k1) < 0.

Therefore, by setting s − a = p, s − b = u, s − c = q,wehaveDa < 0 2 2 2 2 and Db =(s − c) +(s − a) − (s − b) = v . For example, by using the five smallest Pythagorean triples, we ob- tain the following integer triangles (a, b, c) with only one perimeter-area bisectors XbZb in angle B with (BXb,BZb) given in the rightmost col- umn in the table below.

(d1,d2)(h1,k1)(h2,k2)(p, q)(u, v)(a, b, c, s)(BXb,BZb) (5, 29) (4, 3) (21, 20) (144, 17) (24, 143) (41, 161, 168, 185) (21, 164) (13, 5) (12, 5) (4, 3) (63, 16) (33, 56) (49, 79, 96, 112) (28, 84) (13, 17) (12, 5) (15, 8) (220, 21) (140, 171) (161, 241, 360, 381) (105, 276) (13, 29) (12, 5) (21, 20) (352, 135) (152, 345) (287, 487, 504, 639) (147, 492) (17, 5) (15, 8) (4, 3) (84, 13) (36, 77) (49, 97, 120, 133) (28, 105) (17, 29) (15, 8) (21, 20) (475, 132) (155, 468) (287, 607, 630, 762) (147, 615) (25, 5) (24, 7) (4, 3) (117, 44) (75, 100) (119, 161, 192, 236) (68, 168) (25, 13) (24, 7) (12, 5) (323, 36) (253, 204) (289, 359, 576, 612) (204, 408) (25, 17) (24, 7) (15, 8) (416, 87) (304, 297) (391, 503, 720, 807) (255, 552) 354 Perimeter - area bisectors of a triangle

A A 3 − √3 12 2

Zb Zb

3+ √3 2 6

84 79

Za

I Ya I 3 2

B X C B X C 28 b 21 6 − √3 b 1+ √3 2 2

Figure 4 Figure 5

23.5.2 Triangles with Da =0 In this case, (s − b)2 +(s − c)2 =(s − a)2. It is enough to determine (a, b, c) from a Pythagorean triple. In this case, AYa = AZa = s. Note 2 that Db =2(s − c) and the perimeter-area bisector in angle B cannot intersect the sides BC and BA with rational length BXb and BZb. Here are some small examples.

(s − a, s − b, s − c)(a, b, c) s (5, 4, 3) (7, 8, 9) 12 (13, 12, 5) (17, 18, 25) 30 (17, 15, 8) (23, 25, 32) 40 (25, 24, 7) (31, 32, 49) 56 (29, 21, 20) (41, 49, 50) 70

23.5.3 Triangles with Da > 0

We require Da and Db to be squares of integers u and v. Let D := (s−a)2 +(s−b)2 +(s−c)2. Then D = u2 +2(s−a)2 = v2 +2(s−b)2. A number D can be written as u2 +2x2 in two different ways if and only if it is divisible by two prime numbers congruent to 1 or 3(mod8). Let D be one such number with

2 2 2 2 D = u1 +2x = v +2y ,x>y. 23.5 Integer triangles 355

If, in addition, D − x2 − y2 = z2 for an integer z

A

12

Zb 16 28

2 Za

Za 18 I Ya 2 Ya 5

B C 22 Xb 11

Figure 23.6: 356 Perimeter - area bisectors of a triangle Chapter 24

Very Small Integer Triangles

We compile some interesting metric and geometric properties of trian- gles with very small integer sidelengths, say, not more than 10. We shall list such triangles as (a, b, c), and exclude those with a common divisor > 1. There are 94 such triangles; exactly one half of them are scalene, i.e., with a

(2, 3, 4)

H

Ib

C

2 2 3

Fe

B 4 A

(2, 3, 4)

• The inradius and the B- and C-exradii are in geometric progres- sion. What is the common ratio?

1 • The distances from A to the excenters Ib and Ic are integers. Cal- culate these distances. • The Feuerbach point 2 trisects the B-Nagel cevian. 3 • The length of c-side of orthic triangle is an integer. 4 Calculate this length.

1AI2 = bc(s−c) b s−b . 2The Feuerbach point Fe is the point of tangency of the incircle with the nine-point circle. 3A Nagel cevian joins a vertex of the triangle to the point of tangency of the opposite side with the excircle on that side. The three Nagel cevians are concurrent at the Nagel point Na. The Feuerbach point lies on the B-Nagel cevian if and only if 2b = c + a. In this case, Fe trisects the B-Nagel cevian. The triangles (3, 4, 5), (3, 5, 7), (4, 5, 6), (4, 7, 10), (5, 6, 7), (5, 7, 9), (6, 7, 8), (7, 8, 9), (8, 9, 10) also satisfy this condition. 4The vertices of the orthic triangle are the orthogonal projections of the vertices on their opposite sides. 2 2 2 a | a(b +c −a ) | The length of the -side of the orthic triangle is bc . 359

(2, 5, 6)

C N

Ge

2 5

Na

Fe B 6 A

(2, 5, 6)

• The exradii are in . What is the common ratio? • The Feuerbach point lies on B-median; 5 • The Gergonne point 6 on B-symmedian. 7

8 • GeNa is parallel to CA. Calculate the length of GeNa. • A Gergonne cevian intersects a second Nagel cevian on a third me- dian. 9

5The Feuerbach point lies on the B-median if and only if b(c + a)=c2 + a2. The triangle (3, 5, 6) also satisfies this condition. 6A Gergonne cevian joins a vertex of the triangle to the point of tangency of the incircle on its opposite side. The three Gergonne cevians are concurrent at the Gergonne point Ge. 7A symmedian is the reflection of a median in the corresponding angle bisector. The Gergonne point lies on the B-symmmedian if and only if b(c + a)=c2 + a2. The triangle (3, 5, 6) also satisfies this condition. 2 2 8GeNa is parallel to CA if and only if c + a = b(c + a). The triangle (3, 5, 6) also satisfies this condition. 9The median must be on the b-side, and c2 + a2 = b(c + a). 360 Very Small Integer Triangles

(3, 4, 5) Pythagorean

A

5 4

C 3 B

(3, 4, 5)

• The inradius and A- and B-exradii are in arithmetic progression. • 5 10 R = 2 r. • The Feuerbach point trisects the B-Nagel cevian. • The Nagel point bisects A-Nagel cevian and trisects B-Nagel ce- vian on incircle. 11

• FeIa =3.

10This is certainly obvious. But there are only three more triangles (in the range we consider) with diame- ter of circrumcircle equal to an integer multiple of the inradius. The smallest integer triangle with R = mr for an integer m is (11, 39, 49) with m =26. 11The Nagel point Na lies on the incircle if and only if one of 3a = b + c, 3b = c + a, 3c = a + b holds. It bisects the A-Nagel cevian if and only if 361

(3, 4, 6)

B

6 3

X Z P

C 4 Y A (3, 4, 6)

• The sides are in harmonic progression. • The cevians AX, BY , CZ with BX = CY = AZ =2are con- current (at P ). Find the ratio of the areas PBC : PCA : PAB. 362 Very Small Integer Triangles

(3, 5, 6) • b cos B = c+a . • The exradii are in geometric progression. What is the common ratio? • The Feuerbach point lies on the B-median. • The Gergonne point lies on the B-symmedian.

• GeNa is parallel to CA. Calculate the length of GeNa. • The A-Gergonne cevian and the B-median intersect on incircle. 12

12The A-Gergonne cevian and the B-median intersect on the incircle if and only if 5a +3b − 5c =0. The triangle (4, 5, 7) also satisfies this condition. 363

(3, 5, 7)

C 3 5

B 7 A

8

(3, 5, 7)

• C = 120◦. • The distance between the circumcenter and the orthocenter is an integer. 13 What is this distance?

• The distances from C to the incenter and the excenter Ic are inte- gers. 14 Calculate these distances. • The Feuerbach point trisects the B-Nagel cevian. • The distance from C to the vertex of external equilateral triangle on its opposite sides =8.

σ6−6σ4σ +8σ2σ2+8σ3σ −16σ σ σ +9σ2 13OH2 = 1 1 2 1 2 1 3 1 2 3 3 OH (3, 7, 8) (a+b+c)(b+c−a)(c+a−b)(a+b−c) . is an integer also for the triangle and (5, 7, 8). 14CI2 = ab(s−c) CI2 = abs s ; c s−c . 364 Very Small Integer Triangles

(3, 7, 8)

A

B

C

11 7 3 57 7

B 8 A

C

(3, 7, 8)

• B =60◦. • The distance between the circumcenter and the orthocenter is an integer. What is this distance? • 7 R = 2 r.

• The distances from B to the excenters Ia and Ic are integers. Cal- culate these distances. • The a-side of the tangential triangle has integer length. 15 Calculate this length. • The b-side of the triangle of reflections 16 contains B. • The a-side of the triangle of reflections has rational length. 17 Cal- culate this length.

15The tangential triangle is bounded by the tangents to the circumcircle at the vertices. The length of the 3 a | 2a bc | -side of the tangential triangle is (c2+a2−b2)(a2+b2−c2) . 16The triangle of reflections is formed by the reflections of the vertices in their respective opposite sides. 17The square length of the a-side of the triangle of reflections is a6−3a4(b2+c2)+3a2(b4+b2c2+c4)−(b2−c2)2(b2+c2) b2c2 . 365

(3, 8, 10) • C =3B.

• The distances from A to the excenters Ib and Ic are integers. Cal- culate these distances. • The C-Gergonne cevian has integer length. 18 Calculate this length. • The A-bisector is quadrisected (3 : 1) by the incircle. 19 • The length of the b-side of the orthic triangle is an integer. Calculate this length.

(3, 9, 10) • The C-median is bisected by incircle. 20 • The C-median and the A-Gergonne cevian intersect on incircle. 21

2 18 C (a+b−c)((a+b+c)c−2(a−b) ) The -Gergonne cevian has square length 4c . 19a(4b2 − bc +4c2) − (b + c)(4b2 − 7bc +4c2)=0. 202(a2 + b2) − 4(a + b)c +3c2 =0. 215a − 5b +3c =0. 366 Very Small Integer Triangles

(4, 5, 6)

C 1

Z 2 4 4

4 I

Fe B 6 A (4, 5, 6)

• C =2A. • The inradius and and B- and C-exradii are in arithmetic progres- sion.

• The distances from C to the incenter and the excenter Ic are inte- gers. Calculate these distances. • The Feuerbach point trisects the B-Nagel cevian. • The length of the a-side of orthic triangle is an integer. Calculate this length. 367

(4, 5, 7)

B

7 4

Na

C 5 A

(4, 5, 7)

• The Nagel point bisects the A-Nagel cevian on incircle. • The A-Gergonne cevian and the B-median intersect on incircle. • The a-side of tangential triangle has integer length. Calculate this length. 368 Very Small Integer Triangles

(4, 7, 9)

C

7 4

B 9 A (4, 7, 9)

• 7 R = 2 r. • The C-Gergonne cevian has integer length. Calculate this length. • The distance from C to the Gergonne point is an integer. Calculate this distance. 22 • The Gergonne point lies on the C-Soddy circle. 23

3 2 22CG2 = c(a+b−c) ((a+b+c)c−2(a−b) ) e (a2+b2+c2−2bc−2ca−2ab)2 . 23A Soddy circle has center at a vertex and passes through the points of tangency of the incircle with the two sides containing the vertex. 369

(4, 7, 10) • The Feuerbach point trisects the B-Nagel cevian. • The distance between the centroid and the incenter is an integer. 24 Calculate this distance.

(4, 9, 10)

C

9 4

Fe

B 10 A (4, 9, 10)

• The exradii are in arithmetic progression. • The distance between the centroid and the Gergonne point is an integer. 25 Calculate this distance. • The Feuerbach point trisects the B-Gergonne cevian. 26

−σ3+5σ σ −18σ 24GI2 = 1 1 2 3 . 9σ1 4(−σ6+7σ4σ −24σ3σ −8σ2σ2+96σ σ σ −16σ3−108σ2) 25 2 1 1 2 1 3 1 2 1 2 3 2 3 GGe = 2 2 . The triangle (7, 9, 10) also satis- 9(σ1 −4σ2) fies this condition. 26 B 1 1 1 The Feuerbach point lies on the -Gergonne cevian if and only if s−a , s−b , s−c are in arithmetic progression. In this case, the Feuerbach point trisects the B-Gergonne cevian. Also, the exradii are in arithmetic progression. 370 Very Small Integer Triangles

(5, 6, 7)

C

Y Y 5 6

B 7 A

(5, 6, 7)

• B-Gergonne cevian = a; • The Feuerbach point trisects the B-Nagel cevian. • If the incircle touches CA at Y , the incircles of BY A and BY C touch the B-Gergonne cevian at the same point Y , whose distance from Y is an integer. 371

(5, 6, 9)

• The distances from B to the excenters Ia and Ic are integers. Cal- culate these distances. • The distance from C to the Nagel point is an integer. 27 Calculate this distance. • The A-median and B-Gergonne cevian intersect on incircle. 28 • The Nagel point bisects A-Nagel cevian on incircle. • The length of c-side of orthic triangle is an integer. Calculate this length.

2 27CN2 = c((a+b−c)c+2(a−b) ) a a+b+c . 283a +5b − 5c =0. The triangle (5, 7, 10) also satisfies this condition. 372 Very Small Integer Triangles

(5, 7, 8)

C

5 X 7

I Na

B 8 A

(5, 7, 8) • B =60◦. • The b-side of the triangle of reflections contains B and has length 13. • The distance between the circumcenter and the orthocenter is an integer. What is this distance?

• The distances from B to the excenters Ia and Ic are integers. Cal- culate these distances. • A-Gergonne cevian = b. • The distance from C to the Nagel point is an integer. Calculate this distance. • The Nagel point bisects A-Nagel cevian on incircle. • The chord of circumcircle through C and Nagel point is bisected at Nagel point.

• ta : tc = c : a. • If the incircle touches BC at X, the incircles of AXB and AXC touch the A-Gergonne cevian at the same point X , whose distance from X is an integer. • The a-side of the tangential triangle has integer length. Calculate this length. 373

(5, 7, 9) • The Feuerbach point trisects the B-Nagel cevian. • The length of b-side of the tangential triangle is an integer. Calcu- late this length.

(5, 7, 10) • The A-median and the B-Gergonne cevian intersect on incircle.

(5, 8, 9) • The exradii are in arithmetic progression. • The Feuerbach point trisects the B-Gergonne cevian.

• FeIa =4; FeIc =12. • The centroid is on the line joining the points of tangency of the A- and B-excircles with the corresponding sides. 29 • The Gergonne point on the line joining midpoints of BC and CA. 30 • 5 R = 2 r. • The length of b-side of the tangential triangle is an integer. Calcu- late this length.

29(a − b)2 +2(a + b)c − 3c2 =0. 30(a − b)2 +2(a + b)c − 3c2 =0. 374 Very Small Integer Triangles

(6, 7, 8) • The Feuerbach point trisects the B-Nagel cevian. • The length of the c-side of the orthic triangle is an integer. Calculate this length. • The b-bisector has integer length. Calculate this length.

• The vertex B is at integer distances from the incenter and Ib. Cal- culate these distances. • The Nagel point is at integer distances from A and C. Calculate these distances. • The vertices A and B are at integer distances from the line OI. Calculate these distances. 31 • The excenters are at integer distances from the line OI. Calculate these distances. 32

2 2 31 bc(b−c) (s−a) The square distance from A to the line OI is 3 . a(σ1 −4σ1σ2+9σ3) 2 32 abc(b−c) The square distance from Ia to the line OI is 3 . σ1 −4σ1σ2+9σ3 375

(7, 8, 9)

C

7 8

Na

B 9 A

(7, 8, 9)

• mb = a. • The Feuerbach point trisects the B-Nagel cevian. • The length of the b-side of the tangential triangle is an integer. Cal- culate this length. • The Nagel point lies on the line joining the the points of tangency of the incircle with CA and AB. 33

33(s − a)2 =(s − b)2 +(s − c)2. 376 Very Small Integer Triangles

(7, 8, 10)

• The distance from the excenter Ic to A is an integer. Calculate this distance.

34 • The distance from the excenter Ic to the centroid is an integer. Calculate this distance.

(7, 9, 10)

C

5 7 9

Fe

B 10 A (7, 9, 10)

• The exradii are in arithmetic progression. • The Feuerbach point trisects the B-Gergonne cevian. • The distance from the centroid to the Gergonne point is an integer. Calculate this distance.

• CFe =5.

3 2 2 2 2 2 34GI2 = c +2(a+b)c −(2a −9ab+2b )c−(a+b)(a −3ab+b ) c 9(a+b−c) . 377

(8, 9, 10)

C

Tb 8 9

4

Fe B 10 A (8, 9, 10)

• The Feuerbach point trisects the B-Nagel cevian. • The distance between the midpoints of B-bisector and CA is an integer. 35 Calculate this distance.

3 3 2 35 (c+a)(c +a )−cab The square distance between the two points is 4(c+a)2 . 378 Very Small Integer Triangles

Answers

• (2, 3, 4): Common ratio =3. AIb =2; AIc =6. c-side of orthic triangle =1. • (2, 5, 6) =3 G N = 40 : Common ratio of exradii . e a 13 . • (3, 4, 6): Ratio of areas PBC : PCA : PAB =2:1:2. • (3, 5, 6) =2 G N = 15 : Common ratio of exradii . e a 7 . • (3, 5, 7): OH =8. IC =1; CIc =15.

• (3, 7, 8): OH =5. BIa =2; BIc =12. a-side of tangential triangle =21. a-side of = 57 triangle of reflections 7 .

• (3, 8, 10): AIb =4; AIc =20. C-Gergonne cevian =2. b-side of orthic triangle =6.

• (4, 5, 6): IC =2; CIc =10. a-side of orthic triangle =3. • (4, 5, 7): a-side of tangential triangle =14.

• (4, 7, 9): C-Gergonne cevian =3. CGe =1. • (4, 7, 10): GI =1.

• (4, 9, 10): Exradii in the ratio 1:3:5. GGe =2. • (5, 6, 7): YY =1.

• (5, 6, 9): BIa =3; BIc =15. CNa =3. c-side of orthic triangle =3. • (5, 7, 8): OH =3. BIa =4; BIc =10. CNa =4. XX =1. a-side of tangential triangle =14. • (5, 7, 9): b-side of tangential triangle =42. • (5, 8, 9): Exradii in the ratio 1:2:3. b-side of tangential triangle =48.

• (6, 7, 8): c-side of orthic triangle =2. tb =6. IB =4; BIb =12. ANa =4; CNa =4. Distances from A and B to OI are 3 and 4. Distances from Ia, Ib, Ic to OI are 4, 8, 4. • (7, 8, 9): b-side of tangential triangle =21.

• (7, 8, 10): AIc =12. GIc =13.

• (7, 9, 10): Exradii 2:3:4. GGe =1. • (8, 9, 10): Distance between the midpoints of B-bisector and CA =4. Distance between the midpoints of B-bisector and BC =2. Chapter 25

The games of Euclid and Wythoff

25.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). − 1 Proof. The golden ratio ϕ satisfies ϕ 1= ϕ . ⇒ − − 1 · ⇒ − (i) a<ϕb = a b<(ϕ 1)b = ϕ b = ϕ(a b) ϕb = a b>(ϕ 1)b = ϕ b = ϕ(a b) >b. Theorem 25.2. In the game of Euclid (a, b), the first player has a win- ning strategy if and only if a>ϕb. 402 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 25.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 25.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 25.2 Wythoff’s game 403

25.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

an := min{c : c = ai,bi,i

134 6 8 9 111214161719212224252729 257101315182023262831343639414447

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, an+1 = an. This means that an+1

This means, by definition, that an = an+1, a contradiction. 404 The games of Euclid and Wythoff

3. The sequence (bn) is increasing.

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

4. Since (an) and (bn) are increasing, an ≥ n and bn ≥ n for every n.

5. am = bn for all integers m and n.

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

a1,...,am−1,b1,...,bn,...,bm−1.

In particular, am = bn.

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

/ Proof. A move (an,bn) (am,bm) must subtract the same number from an and bn. This is impossible since bn − an = n>m= bm − am.

8. Let a

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

n = b − a

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. 25.3 Beatty’s Theorem 405

25.3 Beatty’s Theorem

Theorem 25.3 (Beatty). If α and β are positive irrational numbers sat- 1 1 isfying α + β =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 > , q +1 α q k 1 k − 1 > > . q +1 β q 406 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 (an) and (bn) for the 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 1 1 1 2 β α =1. Since α +√β =1,wehaveα + α+1 =1or α = α +1. 1 Therefore, α = ϕ = 2 ( 5+1), the golden ratio, and β = ϕ +1. Here is a succinct description of the Wythoff sequence. Theorem 25.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 26

Number sequences

26.1 The Farey sequence

Let n be a positive integer. The Farey sequence of order n is the sequence of rational numbers in [0, 1] of denominators ≤ n arranged in increasing 0 1 order. We write 0= 1 and 1= 1 .

F 0 1 1 : 1 , 1 . F 0 1 1 2 : 1 , 2 , 1 . F 0 1 1 2 1 3 : 1 , 3 , 2 , 3 , 1 . F 0 1 1 1 2 3 1 4 : 1 , 4 , 3 , 2 , 3 , 4 , 1 . F 0 1 1 1 2 1 3 2 3 4 1 5 : 1 , 5 , 4 , 3 , 5 , 2 , 5 , 3 , 4 , 5 , 1 . F 0 1 1 1 1 2 1 3 2 3 4 5 1 6 : 1 , 6 , 5 , 4 , 3 , 5 , 2 , 5 , 3 , 4 , 5 , 6 , 1 . F 0 1 1 1 1 2 1 2 3 1 4 3 2 5 3 4 5 6 1 7 : 1 , 7 , 6 , 5 , 4 , 7 , 3 , 5 , 7 , 2 , 7 , 5 , 3 , 7 , 4 , 5 , 6 , 7 , 1 . h h F Theorem 26.1. 1. If k and k are successive terms of n, then kh − hk =1 and k + k >n.

h h h F 2. If k , k , and k are three successive terms of n, then h h + h = . k k + k

The rational numbers in [0, 1] can be represented by lattice points in the first quadrant (below the line y = x). Restricting to the left side of the vertical line x = n, we can record the successive terms of the 408 Number sequences

Farey sequence Fn by rotating a ruler about 0 counterclockwise from the positive x-axis. The sequence of “visible” lattice points swept through corresponds to Fn.IfP and Q are two lattice points such that triangle OPQ contains no other lattice points in its interior or boundary, then the rational numbers corresponding to P and Q are successive terms in a Farey sequence (of order ≤ their denominators).

1 Corollary 26.2. A primitive lattice triangle has area 2 .

The Farey polygons P10 and P20

26.1 The Farey sequence 409

Let φ(n) be the number of integers m satisfying 1 ≤ m ≤ n and F n gcd(m, n)=1. The Farey sequence n has 1+ k=1 φ(k) terms. The P n polygon n contains 2+ k=1 φ(k) boundary points and no interior 1 n points. By Pick’s formula, its area is An = 2 k=1 φ(k). By a calcula- tion of D. N. Lehmer [Lehmer], for large values of n, this area is about 3 2π2 of the (smallest) square containing it:

An 3 lim = . n /∞ n2 2π2 410 Number sequences

26.2 The number spiral

Beginning with the origin, we trace out a spiral clockwise through the lattice points. Along with this, we label the lattice points 0, 1, 2, . . . consecutively.

30

16 12

4 3 2

5 0 1

9 6

20 25

Given a positive integer N, let (2m − 1)2 be the largest odd square ≤ N, and write N =(2m − 1)2 + q, 0 ≤ q<8m.

Then the number N appears at the lattice point ⎧ ⎪(m, −m + q +1) ifq ≤ 2m − 1, ⎨⎪ (3m − q − 1,m)if2m − 1 ≤ q ≤ 4m − 1, ⎪(−m, 5m − q − 1) if 4m − 1 ≤ q ≤ 6m − 1, ⎩⎪ (−7m + q +1, −m)if6m − 1 ≤ q ≤ 8m − 1.

Denote by f(m, n) the number at the lattice point (m, n). It is clear that along the 45-degree line, f(n, n)=2n(2n − 1). Also, f(−n, n)=4n2 if n ≥ 0, and f(n, −(n − 1)) = (2n − 1)2 if n>0. More generally, ⎧ 2 ⎪4m − 3m + n if m>|n|, ⎨⎪ 4m2 − m − n if − m = |m| > |n|, f(m, n)= ⎪4n2 − n − m if n>|m|, ⎩⎪ 4n2 − 3n + m if − n = |n| > |m|. 26.2 The number spiral 411

Project

Find the coordinates of the n-th point of the path, beginning with the origin. What is the position of the lattice point (a, b) in the sequence? 412 Number sequences

26.3 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.

2 26.4 The prime number spiral beginning with 17 413

26.4 The prime number spiral beginning with 17

17

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. nf(n) nf(n) nf(n) nf(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 414 Number sequences

26.5 The prime number spiral beginning with 41

41

The numbers on the 45 degree line are f(n)=n2 + n +41. f(n)=n2 + n +41is prime for 0 ≤ n ≤ 39. nf(n) nf(n) nf(n) nf(n) nf(n) 041143247353461 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 26.5 The prime number spiral beginning with 41 415

Prime number spiral beginning with 41: A closer look

41 416 Number sequences

26.6 Two enumerations of the rational numbers in (0,1)

Consider two enumerations of the rational numbers in (0,1). E1 lists them by increasing denominator, and for equal denominators, by increasing numerator. Thus, 1 1 2 1 3 1 2 3 4 1 5 E1 : , , , , , , , , , , , .... 2 3 3 4 4 5 5 5 5 6 6 E2, on the other hand, lists them by increasing sum of numerator and denominator, and for equal sums of terms, by increasing numerator. Thus, 1 1 1 2 1 1 2 3 1 3 1 E2 : , , , , , , , , , , , .... 2 3 4 3 5 6 5 4 7 5 8 1 1 2 The fractions 2 , 3 , and 5 occupy the same positions in both se- m quences. More generally, the n (with m

1 1 2 9 30 59 67 97 197 513 Fraction 2 3 5 23 73 143 163 235 477 1238 Position 1 2 7 158 1617 6211 8058 16765 69093 465988 What is the next match? For m + n ≤ 20000, I found four more: Fraction 1729 1922 3239 4646 4175 4641 7820 11217 Position 5297983 6546724 18588348 38244610

1Journal of Recreational Math., 10 (1977Ð78) 122Ð123. Chapter 27

Inequalities

27.1 The inequality AGH2

Theorem 27.1. For positive numbers x and y, x + y √ 2xy ≥ xy ≥ . 2 x + y Equality holds if and only if x = y.

Q Y Y

K H H G G A A O

X X P

Proof. Let XX = x, YY = y.

1 1. AA = 2 (x + y)=XY . $     √ x+y 2 − x−y 2 2. GG = diameter of circle = PQ = 2 2 = xy.

2xy 1 3. HH = x+y .

1 HK + HK = YH+ HX = YH+HX =1 1 = 1 + 1 2 = 1 + 1 Proof: x y XY XY XY ; HK x y . This means that HH x y , HH = 2xy and x+y . 418 Inequalities

4. AA ≥ GG ≥ HH . Equality holds if and only if the trapezoid is a square.

Examples

1. Prove that if a, b, c are positive numbers, then (a+b)(b+c)(c+a) ≥ 8abc. √ √ √ Proof. (a + b)(b + c)(c + a) ≥ 2 ab · 2 bc · 2 ca =8abc.

2. (Easy) Prove that 2(x2 +y2) ≥ (x+y)2. When does equality hold? 3. Let a, b, c, d be positive numbers such that a + b + c + d =1. Show that √ √ √ √ 4a +1+ 4b +1+ 4c +1+ 4d +1< 6. √ " · 4a+1+1 Proof. 4a +1 = (4a +1) 1 < 2 =2a +1; similarly for b, c, d. Adding up the four inequalities, we obtain √ √ √ √ 4a +1+ 4b +1+ 4c +1+ 4d +1< 2(a+b+c+d)+4 = 6.

4. For positive numbers x1, x2,...,xn, 2 2 2 2 x1 x2 xn−1 xn + + ···+ + ≥ x1 + x2 + ···+ xn. x2 x3 xn x1

2

5. For positive real numbers x, y, z, 1 x3 + y3 + z3 ≥ (x + y + z)(x2 + y2 + z2). 3 3 Generalization: 4 1 xn + yn + zn ≥ (x + y + z)(xn−1 + yn−1 + zn−1). 3  2   xi 2 ≥ (2xi − xi+1)= xi. xi+1 3Chinese Mathematical Bulletin, Problem 1128, April, 1998. 4Chinese Mathematical Bulletin, January, 2000, 24Ð25;19. 27.1 The inequality AGH2 419

Equality holds if and only if n =1or x = y = z. More generally, m m m n 1 n−1 xi ≥ xi xi . i=1 m i=1 i=1

m m m n 1 k n−k xi ≥ xi xi . i=1 m i=1 i=1

• If x + y + z =1, then x2 + y2 + z2 ≥ 1 .  3 • If xi =1, then

2 2 1 2 (n +1) (xi + ) ≥ . xi n

• (s − a)4 +(s − b)4 +(s − c)4 ≥2. √ √1 √1 ··· √1 5 6. For n>1, 1+ 2 + 3 + + n > n.

n+1 n 7. Show that n! < ( 2 ) . 8. Show that 1 · 3 · 5 ···(2n − 1)

10. Show that n4 13 +23 + ···+(n − 1)3 < < 13 +23 + ···+ n3. 4

11. Prove that f(x)=sinx is convex on [0,π], and hence 1 1 (sin θ1 +sinθ2 + ···+sinθn) ≤ sin (θ1 + θ2 + ···+ θn) n n

for 0 ≤ θi ≤ π.

5Chinese Mathematical Bulletin, June, 2000, 28Ð29. 420 Inequalities

12. Prove that if k is a positive integer, then √ √ √ k +1+ k − 1 < 2 k.

Hence deduce that 1 √ √ √ < k +1− k − 1. k Making use of the above, or otherwise, prove that for every positive integer n, 1 1 1 √ √ 1+√ + √ + ···+ √ < n +1+ n − 1. 2 3 n

13. Which is larger: eπ or πe?

27.2 Proofs of the A-G inequality

The Arithmetic-Geometric Means Inequality For positive real num- bers a1, a2,...,an, let √ n 1 G(a1,a2,...,an)= a1a2 ···an, and A(a1,a2,...,an)= (a1+a+ ···+an). n

(a) Show that if a1 = a2 = ···= an = a, then

G(a1,a2,...,an)=A(a1,a2,...,an)=a.

(b) Show that if a1, a2, ..., an are not all equal then there is one ai which is greater than G(a1,a2,...,an), and there is one aj which is less than G(a1,a2,...,an).

(c) Suppose a1 >G(a1,a2,...,an) >an. Let

a1 = G(a1,a2,...,an),

a2 = a2,...,an−1 = an−1, and a1an an = G(a1,a2,...,an) .

Show that G(a1,a2,...,an)=G(a1,a2,...,an),

and A(a1,a2,...,an)

(d) Using the results above, show that

G(a1,a2,...,an) ≤ A(a1,a2,...,an),

and that equality holds if and only if a1 = a2 = ···= an.

Cauchy - Schwarz Inequality For real numbers x1, x2, ..., xn; y1, y2,...,yn,

2 2 2 2 2 2 2 (x1y1 + x2y2 + ···+ xnyn) ≤ (x1 + x2 + ···+ xn)(y1 + y2 + ···+ yn). Equality holds if and only if

x1 : y1 = x2 : y2 = ···= xn : yn.

Inequalities from Convexity Let f(x) be a convex function defined on [a, b]: x1 + x2 f(x1)+f(x2) ≤ 2f( ) 2 for all x1,x2 ∈ [a, b]. For each positive integer n, consider the statement

I(n): For xi ∈ [a, b], 1 ≤ i ≤ n,

x1 + x2 + ···+ xn f(x1)+f(x2)+···+ f(xn) ≤ n · f( ). n (i) Prove by induction that I(2k) is true for every positive integer k. (ii) Prove that if I(n), n ≥ 2, is true, then I(n − 1) is true. (iii) Prove that I(n) is true for every positive integer n.

[H228.] Verify that the following three inequalities hold for positive reals x, y, and z: (i) x(x − y)(x − z)+y(y − x)(y − z)+z(z − x)(z − y) ≥ 0. [This is known as Schur’s inequality]. (ii) x4 + y4 + z4 + xyz(x + y + z) ≥ 2(x2y2 + y2z2 + z2x2). (iii) 9xyz +1≥ 4(xy + yz + zx), where x + y + z =1. Can you devise an ingenious method that allows you to solve the problem without having to prove all three inequalities directly ? 422 Inequalities

27.3 The AGH mean inequality

Theorem 27.2. Let x1, x2,...,xn be positive numbers.

A(x1,x2,...,xn) ≥ G(x1,x2,...,xn) ≥ H(x1,x2,...,xn).

Equality holds if and only if x1 = x2 = ···= xn. Proof. We first prove the AG mean inequality by induction on the num- ber of variables. The validity of AG2 has already been established. As- suming AGn, we consider n +1nonnegative numbers x1, x2, ..., xn, xn+1, with arithmetic mean A and geometric mean G. Applying AGn to x1, x2,...,xn, and also to xn+1 and n − 1 copies of G,wehave √ n x1 + x2 + ···+ xn ≥n x1x2 ···xn, " n n−1 xn+1 +(n − 1)G ≥n xn+1 · G .

Combining these two inequalities and applying AG2,wehave

(n +1)A +(n − 1)G =(x1 + x2 + ···+ xn)+(xn+1 +(n − 1)G) √ " n n n−1 ≥n x1x2 ···xn + n xn+1 · G $ √ " n n n−1 ≥2n x1x2 ···xn · xn+1 · G " 2n n−1 =2n x1x2 ···xnxn+1 · G √ 2n =2n Gn+1 · Gn−1 =2n · G.

From this, A ≥ G. Equality√ holds if and only if x1 = x2 = ··· = xn, n+1 n and xn+1 = G = x1 xn+1, which entails xn+1 = x1. This proves AGn+1 and completes the proof of the AG mean inequality. The GH mean inequality now follows easily. 1 1 H(x1,x2,...,xn)= 1 1 1 ≤ 1 1 1 = G(x1,x2,...,xn). A( x1 , x2 ,..., xn ) G( x1 , x2 ,..., xn )

There are many proofs of the AG mean inequality. A very elegant proof of a stronger inequality (by H. Alzer) appeared recently in the American Mathematical Monthly. 6

6H. Alzer, A proof of the arithmetic mean - geometric mean inequality, American Mathematical Monthly, 103 (1996) 585. 27.3 The AGH mean inequality 423

For positive real numbers a1 ≤ a2 ≤ ··· ≤ an, and p1, p2, ..., pn satisfying p1 + p2 + ···+ pn, let n %n pk A = pkak,G= ak . k=1 k=1

The number G lies between some ah and ah+1. The sum n & h & n & G 1 1 G 1 1 ak 1 1 pk − dt = pk − dt+ pk − dt k=1 ak t G k=1 ak t G k=h+1 G G t is clearly nonnegative. On the other hand, it is equal to n  ' n G ( )G t ak pk log t − = pk log G − log ak − 1+ G G ak k=1 ak k=1 n n n n pk pkak = pk log G − log ak − pk + k=1 k=1 k=1 k=1 G A = − 1. G From this, A ≥ G. Equality holds if and only if each of these intervals has length zero, i.e., a1 = a2 = ···= an(= G).

Exercise

1. Prove that (n +1)n ≥ 2n · n! for n =1, 2, 3,.... 2. Prove that for any positive integer n, nn (4n)n 1 ≥ ≥ . (n!)2 (n +1)2n

3. Prove that for x>0, (n +1)n+1 (1 + x)n+1 ≥ x. nn

4. (Israel Math. Olympiad, 1995.) Prove the inequality # 1 1 1 1 n k +1 + + +···+ ≥ n − 1 . kn kn +1 kn +2 (k +1)n − 1 k 424 Inequalities

This clearly suggests using the AG mean inequality. There are n terms on the left. To deal with the −1 on the right, we transfer it to the left. The inequality becomes    1 n−1 1 k +1 1+ ≥ n . n kn + j k j=0

1+ 1 = kn+(j+1) Note that kn+j kn+j . Now it is clear that the AG mean inequality does the job.

The AG means inequality can be rationalized by replacing each xk by n n n n xk . Since G(x1 ,x2 ...,xn)=x1x2 ···xn,

Theorem 27.3. For nonnegative numbers x1, x2,...,xn, n n n Fn(x1,x2,...,xn):=x1 + x2 + ···+ xn − n · x1x2 ···xn ≥ 0.

Equality holds if and only if x1 = x2 = ···= xn. 2 Proof. • n =2: F2(x1,x2)=(x1 − x2) ≥ 0. • n =4:

F4(x1,x2,x3,x4) 4 4 4 4 =x1 + x2 + x3 + x4 − 4x1x2x3x4 4 2 2 4 4 2 2 4 2 2 2 2 =(x1 − 2x1x2 + x2)+(x3 − 2x3x4 + x4)+2(x1x2 − 2x1x2x3x4 + x3x4) 2 2 2 2 2 2 2 =(x1 − x2) +(x3 − x4) +2(x1x2 − x3x4) ≥0.

• n =3: Let A = A(x1,x2,x3) and G = G(x1,x2,x3). Apply the AG means inequality to the 4 numbers x1, x2, x3 and G. Note that 3A+G – A(x1,x2,x3,G)= , √4 √ 4 4 3 – G(x1,x2,x3,G)= x1x2x3G = G · G = G. 1 ≥ ≥ It follows from 4 (3A + G) G that A G. In each of the above, it is clear that equality holds if and only if the x’s are equal.

27.4 Cauchy-Schwarz inequality

Theorem 27.4 (Cauchy-Schwarz inequality). Let x and y be vectors in Rn. |x · y|≤||x||·||y||. 27.4 Cauchy-Schwarz inequality 425

Equality holds if and only if x and y are linearly dependent. More ex- plicitly, if x =(x1,x2,...,xn) and y =(y1,y2,...,yn), then 2 2 2 2 2 2 2 (x1y1 + x2y2 + ···xnyn) ≤ (x1 + x2 + ···+ xn)(y1 + y2 + ···+ yn). Proof. For a real number t, consider the vector x − ty, which has square length ||x||2 − 2(x · y)t + ||y||2t2. Since this quadratic in t is always nonnegative, its |x·y|2 − ||x||2||y||2 ≤ 0. Equality holds if and only if there is a real number t for which the square length of the vector x − t · y is zero. This is the case precisely when x and y are linearly dependent. An immediate corollary is the triangle inequality in Rn: Corollary 27.5 (Minkowski inequality). ||x+y|| ≤ ||x||+||y||. Equal- ity holds if and only if x and y are linearly dependent. Proof. ||x+y||2 = ||x||2+2(x·y)+||y||2 ≤||x||2+2||x||·||y||+||y||2 = (||x|| + ||y||)2.

Examples

1. For positive numbers x1, x2,...,xn, 1 1 1 2 (x1 + x2 + ···+ xn) + + ···+ ≥ n . x1 x2 xn

2. Show that 7 1 1 1 2n 1+ + + ···+ ≥ . 2 3 n n +1 3. The inequality 2 2 2 2 x x x (x1 + x2 + ···+ xn) 1 + 2 + ···+ n ≥ y1 y2 yn y1 + y2 + ···+ yn 8 for positive numbers xk and yk, k =1, 2,...,n, follows by ap- plying the Cauchy-Schwarz inequality to the vectors x1 x2 xn √ √ √ √ , √ ,...,√ and ( y1, y2,..., yn). y1 y2 yn

7Easy; but the result is too crude, since the right hand side is below 2. 8Actually, only the y’s need to be positive. 426 Inequalities

4. (Crux Math., Problem 2113.) Prove the inequality n n n n xkyk xk yk ≥ (xk + yk) k k k=1 k=1 k=1 k=1 x + y

for positive numbers x1, x2,...,xn, and y1, y2,...,yn. 5. (Crux Math., Problem 1982.)

Determine all sequences a1 ≤ a2 ≤ ··· ≤ an of positive real numbers such that n n n 2 3 ak =96, ak = 144, ak = 216. k=1 k=1 k=1 27.5 Convexity 427

6. Locate the point P inside a given triangle ABC for which the sum of the squares of the distances to the three sides is smallest possible. Suppose the given triangle ABC has side lengths BC = a, CA = b, AB = c, and area . Let the distances from P to BC, CA, AB be x, y, z respectively. These satisfy ax + by + cz =2. By the Cauchy-Schwarz inequality, (ax + by + cz)2 42 (x2 + y2 + z2) ≥ = . a2 + b2 + c2 a2 + b2 + c2

Equality holds if and only if x : y : z = a : b : c. The sum of squares of the distances of a point to the three sides is smallest when these distances are in the ratio of the corresponding side lengths. Since the actual distances can be determined, there is only one such point P . Here is a construction of P . Construct squares externally on the sides of the triangle. The outer sides of the square bound a larger triangle ABC. Construct the lines AA and CC to intersect at a point P . This is the point that satisfies the requirement.

PX : XX = PC : CC = PY : YY = PA : AA = PZ : ZZ =⇒ x : y : z = a : b : c.

The point P also lies on the line BB. It is called the symmedian point of triangle ABC.

B

Z

B

Z X X P

C A Y

C A Y

27.5 Convexity

A real valued function f on an interval I is convex if

f(tx1 +(1− t)x2) ≤ tf(x1)+(1− t)f(x2) for x1,x2 ∈ I and t ∈ [0, 1]. 428 Inequalities

Lemma 27.6. If f is a convex function on an interval I, and x1, x2,..., n xn ∈ I, λ1, λ2,...,λn ∈ [0, 1] such that k=1 λk =1, then n n f λkxk ≤ λkf(xk). k=1 k=1 Theorem 27.7. Let r>0.Forx, y ∈ Rn, x nonnegative and y positive,  n r+1 n r+1 xk ≥ ( k=1 xk) r n r . k k=1 yk ( k=1 y ) Equality holds if and only if x and y are linearly dependent. Proof. Apply Lemma 27.6 to the convex function xr+1 on the interval n ∞ xk yk (0, ). Let zk = y for each k. Set λk = Y , where Y = k=1 yk. Note n k that k=1 λk =1. Therefore, r+1 n n r+1 xk yk xk ≤ . k k=1 Y k=1 Y y Rearranging this, we obtain r+1 n r+1 X ≤ xk r r . Y k=1 yk

1. Let a, b be positive numbers, and x and y be nonnegative numbers a b satisfying x + y =1. Find the least possible value of xn + yn . Write a = αn+1 and b = βn+1. Since a b αn+1 βn+1 (α + β)n+1 √ √ + = + ≥ =(α + β)n+1 =(n+1 a + n+1 b)n+1, xn yn xn yn (x + y)n √ √ n+1 this latter is the least possible value; it occurs when x : y = α : β = n+1 a : b, i.e., √ √ n+1 a n+1 b x = √ √ , and y = √ √ . n+1 a+ n+1 b n+1 a+ n+1 b

2. Given positive numbers a1,...,an, find the least possible value of a1 a2 ··· an k + k + + k x1 x2 xn 2 2 2 subject to x1 + x2 + ···+ xn =1. 3. Prove that for real numbers x>y>z, 2x(y − z)+2y(z − x)+2z(x − y) > 0. 27.6 The power mean inequality 429

27.6 The power mean inequality

Throughout this chapter, x denotes a vector (x1,x2,...,xn) of nonneg- ative numbers. Let s be a nonzero rational number. We define the s- power mean 9  1 n s s k=1 xk As(x)= . n Theorem 27.8 (Power mean inequality). For a given x, the s-power mean As(x) is an increasing function of s, i.e., for r

n 1 n 1 xr r xs s k=1 k ≤ k=1 k . n n

Equality holds if and only if x1 = x2 = ···= xn.

Theorem 27.9. 1. lims /−∞ As(x)=min(x1,x2,...,xn);

2. lims /∞ As(x)=max(x1,x2,...,xn);

3. lims /0 As(x)=G(x).

Examples

1. For a positive integer k>1,

1k +3k + ···+(2n − 1)k >nk+1.

k k k k+1 L.S. = n · Ak(1, 3,...,2n − 1) >n· A1(1, 3,...,2n − 1) = n · n = n . 2. For positive numbers x, y, z, √ √ √ x y z x + y + z √ + √ + √ > √ . y + z z + x x + y 3

x y z x + y + z √ √ + √ + √ > √ = x + y + z y + z z + x x + y *x + y + z $ √ √ √ 2 √ √ √ " x + y + z x + y + z = 3A1(x, y, z) ≥ 3A 1 (x, y, z)= 3 · = √ . 2 3 3

9For s<0, we require x1, x2,...,xn to be positive. 430 Inequalities

Remark.√ Crux Math., Problem 1366√ improves the inequality by re- placing 3 in the denominator by 2. 3. 3(x2y + y2z + z2x)(xy2 + yz2 + zx2) ≥ xyz(x + y + z)3. √ √ √ (x2y + y2z + z2x)(xy2 + yz2 + zx2) ≥ (x2 yz + y2 zx + z2 xy)2  2 3 3 3 3 2 3 1 3 =xyz x 2 + y 2 + z 2 ≥ xyz · (3(A3/2) 2 ) ≥ 9xyz · A = xyz(x + y + z) . 1 3 4. 5.

27.7 Bernoulli inequality

Theorem 27.10 (Bernoulli inequality). Let n ≥ 2 be a natural number. (1 + x)n ≥ 1+nx for x>−1. 1. If n is odd, the Bernoulli inequality is valid for x ≥−2. 2. If n is even, the Bernoulli inequality is valid for all x ∈ R.

Exercise

1. Prove that for x>0, (n +1)n+1 (1 + x)n+1 ≥ x. nn

Crux 2260: This is indeed valid for all n. This inequality is an improvement of the Bernoulli in- n+1   (n+1) = 1+ 1 n+1 · n>e· n equality since nn n . 2. 3.

27.8 Holland’s Inequality

Let x1, x2, ..., xn be a sequence of nonnegative numbers. For k = 1, 2,...,n, let

• Ak := A(x1,...,xk), 27.8 Holland’s Inequality 431

• Gk := G(x1,...,xk).

Theorem 27.11 (Holland’s inequality). A(G1,G2,...,Gn) ≥ G(A1,A2,...,An). Equality holds if and only if x1 = x2 = ···= xn.

Lemma 27.12 (Holder¬ inequality). Let ak, bk, k =1, 2,...,nbe posi- 1 1 tive, and p, q > 1 satisfy p + q =1. 1 1 n n p n q p q akbk ≤ ak bk . k=1 k=1 k=1 Lemma 27.13. For positive numbers a, b, p, q with 0

Proof of Theorem The inequality is clearly true for n ≤ 2. Let n>2.Fork =2,...,n−1, rewrite 1  n−k k−1  n n n Gk = xk Gk · Gk−1 . We have n G1 + ···+ Gn ⎛ n ⎞ 1 n−1 1 n−k k−1 1 n−1 n n n n n n n n x1 · G1 + ···+ xk · Gk Gk−1 + ···+ xn · Gn−1 = ⎝ ⎠ n ⎛ ⎞  n−k k−1 n−1 n−1 n−1 n−1 ··· G1 + G G + Gn−1 ≤ x1 + xn ⎝ k=2 k k−1 ⎠ n n by Holder’s¬ inequality. Applying Lemma 27.13 to the second factor, n−k k−1 with p = n−1 , q = n−1 , we continue    n−1 n−k k−1 n−1 ··· G1 + Gk + Gk−1 + Gn−1 ≤ x1 + xn k=2 n−1 n−1 n n n−1 x1 + ···xn G1 + G2 + ...Gn−1 = . n n − 1 The result now follows by induction. 432 Inequalities

27.9 Miscellaneous inequalities

1. For real numbers a and b, |a + b| |a| |b| ≤ + . 1+|a + b| 1+|a| 1+|b|

1 − 1 Analysis: Note that each of the terms is of the form x . This observation reduces to inequality into 1 1 1 1 − − + ≥ 0. 1+|a| 1+|b| 1+|a + b| 1 1 The left hand side can be factored if instead of 1+|a+b| ,wehave (1+|a|)(1+|b|) . To maintain the proper ordering, we have to make sure that 1+|a + b|≤(1 + |a|)(1 + |b|). This is clear since 1+|a + b|≤1+|a| + |b|≤1+|a| + |b| + |a||b| =(1+|a|)(1 + |b|).

We reorganize this into a direct proof: |a + b| 1 ≤1 − 1+|a + b| 1+|a + b|   1 =2 − 1+ 1+|a + b|   1 ≤2 − 1+ 1+|a| + |b| + |ab|   1 ≤2 − 1+ (1 + |a|)(1 + |b|)   1 1 =2 − + 1+|a| 1+|b|     1 1 = 1 − + 1 − 1+|a| 1+|b| |a| |b| = + . 1+|a| 1+|b|

2. (Crux Math., Problem 1976.) If a, b, c are positive numbers, prove that a(3a − b b(3b − c) c(3c − a) a3 + b3 + c3 + + ≤ . c(a + b) a(b + c) b(c + a) abc

3. (Crux Math., Problem 1940.) Show that if x, y, z>0, 1 1 1 9 (xy + yz + zx) + + ≥ . (x + y)2 (y + z)2 (z + x)2 4

4. 27.10 A useful variant of AG2 433

27.10 A useful variant of AG2

The AG mean inequality for two positive numbers x and y can be rewrit- ten as x2 ≥ 2x − y. (AG ) y 2 We present some interesting applications of this variant.

1. Let a1, a2, ..., an be positive numbers. For each k =1, 2, ..., n,

applying (AG2)toak and ak+1 (stipulating that an+1 = a1), and adding up the n inequalities, we have

n 2 n n n ak ≥ 2ak − ak+1 =2 ak − ak+1 = ak. k+1 k=1 a k=1 k=1 k=1

a2 b2 c2 ≥ Corollary: For three positive numbers ab, c, b + c + a a+b+c.

2. Consider n positive numbers a1, a2,...,an, with sum S. For each

k =1, 2,...,n, applying (AG2)toak and the arithmetic mean of S−ak the remaining terms, namely, n−1 ,wehave

2 ak S − ak (2n − 1)ak − S ≥ 2ak − = ···= . 1 − − − n−1 (S ak) n 1 n 1 Adding these n inequalites, we obtain

n 2 n a (2n − 1)ak − S (2n − 1)S − nS (n−1) k ≥ = = S. − k − − k=1 S a k=1 n 1 n 1 It follows that n 2 a a1 + a2 + ···+ an k ≥ . k+1 ··· k−1 − k=1 a + + a n 1

S−ak S Equality holds if and only if ak = n−1 , i.e., ak = n for each k,. This is equivalent to a1 = a2 = ···= an. For three numbers a, b, c,wehave a2 b2 c2 a + b + c + + ≥ . b + c c + a a + b 2 434 Inequalities

3. Let a1, a2,...,an be positive numbers such that aa +a2 +···+an = 1. Show that a2 1 k ≥ . − k − k=1 1 a n 1

4. Let x1, x2, ..., xn and y1, y2, ..., yn be two sequences of positive numbers. 2 2 2 2 x x x (x1 + x2 + ···+ xn) 1 + 2 + ···+ n ≥ . y1 y2 yn y1 + y2 + ···+ yn

Proof. Let X := x1 + x2 + ···+ xn and Y := y1 + y2 + ···+ Y 2 yn. Apply (AG2)to X xk and yk for each k and add up the inequalities.

5. Let a1, a2,...,an be (pairwise) distinct positive integers. Applying

(AG2)toak and k for each k, and adding up the inequalities, we obtain n 2 n n ak ≥ 2ak − k =2 ak − Tn. k=1 k k=1 k=1

Since a1, a2,...,ak are distinct positive integers, their sum exceeds the nth triangular number Tk. It follows that n a2 n(n +1) k ≥ . k=1 k 2

6. (International Mathematical Olympiad, 1978.) Let a1, a2, ..., an be (pairwise) distinct positive integers. Show that n n ak ≥ 1 2 . k=1 k k=1 k

Exercise 1. (Should this be here?) If a and b are positive numbers such that a + b =1, prove that 1 1 25 (a + )2 +(b + )2 ≥ . a b 2 Chapter 28

Calculus problems

28.1 Philo’s line

Given a point P (a, b) in the first quadrant, find the length of the shortest segment XY through P , with X, Y on the x- and y-axes respectively.

Y

P

b

θ O a X

In terms of the angle θ between XY and the x-axis, the length of XY a b is L = cos θ + sin θ . dL a sin θ b cos θ a sin3 θ − b cos3 θ = − = . dθ cos2 θ sin2 θ sin2 θ cos2 θ dL 3 3 dθ =0if and only if a sin θ = b cos θ. Equivalently, b tan3 θ = . a The position of this shortest segment, called Philo’s line, cannot be constructed with ruler and compass. 436 Calculus problems

28.1.1 Triangle with minimum perimeter The perimeter of triangle XOY is a b P = a + b + a tan θ + + b cot θ + cos θ sin θ a(1 + sin θ) b(1 + cos θ) = a + b + + cos θ sin θ

dP a(cos2 θ +(1+sinθ)sinθ) b(sin2 θ +(1+cosθ)cosθ) = − dθ cos2 θ sin2 θ a(1 + sin θ) b(1 + cos θ) = − cos2 θ sin2 θ a b = − 1 − sin θ 1 − cos θ a − b − a cos θ + b sin θ = . (1 − sin θ)(1 − cos θ)

dP dθ =0if and only if a cos θ − b sin θ = a − b.

Since d2P d a b = − dθ2 dθ 1 − sin θ 1 − cos θ a cos θ b sin θ = + > 0 (1 − sin θ)2 (1 − cos θ)2 for acute angle θ, the solution of a cos θ − b sin θ = a − b gives the minimum perimeter P . This equation can be rewritten in the form a − b cos(θ + α)=√ a2 + b2 with a b cos α = √ and sin α = √ . a2 + b2 a2 + b2 The position of the segment XY can be constructed with ruler and compass. 28.1 Philo’s line 437

Y Z

θ Y P (a, b) a α

Q b

O X X

Without loss of generality, assume a ≥ b. (1) Construct a point Q on the segment OP such that PQ = a − b. (2) Draw the perpendicular to OP at Q to intersect the circle P (O) at Z (so that angle Y PZ is acute). (3) Construct the line PZ to intersect the axes at X and Y respectively. Triangle XOY has the least perimeter among all triangles with XY containing P . √ √ The minimum perimeter is 2( a + b)2.

Exercise 1. Given a cos θ − b sin θ = a − b, find a sin θ + b cos θ. Solution.

(a sin θ + b cos θ)2 +(a cos θ − b sin θ)2 = a2 + b2 =⇒ (a sin θ + b cos θ)2 =(a2 + b2) − (a − b)2 =2ab.

2. A coffee filter is formed by gluing two radii of a sector cut out from a circle. For what angle of the sector does the coffee filter have largest capacity? 438 Calculus problems

3. A right pyramid has a square base and a given surface area A. What is the largest possible volume?

l h

2b

4. Inscribe in a given cone a cylinder whose volume is largest possi- ble.

2r

h r

5. Find the largest cylinder contained in a sphere of radius R.

R

h r

6. Find the largest right circular cone contained in a sphere of radius R. 7. A pencil of length just fits inside a cylindrical tin. What are the of the tin if 28.1 Philo’s line 439

h

R r

(a) the volume is maximum? (b) the area of the curved surface without lids is maximum? (c) the area of the curved surface with the bottom lid only is max- imum? (d) the area of of the curved surface with both lids is maximum?

8. Let P be a point on the graph of a cubic polynomial y = ax3 + bx, (a =0 ). The tangent at P intersects the graph again at Q. (a) Find the area A between the tangent PQand the graph. (b) If the tangent at Q intersects the graph again at R, show that the area between the tangent QR and the graph is B =16A. 1 x4(1−x)4 22 − 9. Show that 0 1+x2 dx = 7 π. 440 Calculus problems

28.2 Maxima and minima without calculus

1. We have 1000 feet of fencing and wish to make with it a rectangular pen, at one side of a long wall. How can we arrange to surround the maximum area? 1000 − 2x

x x 28.2 Maxima and minima without calculus 441

2. A coffee filter is formed by gluing two radii of a sector cut out from a circle. For what angle of the sector does the coffee filter have largest capacity? Solution. Suppose the circle has radius . If the coffee filter has 2 2 2 1 2 1 2 base radius r and height h, r + h = . Write this as 2 r + 2 r + h2 = 2. The capacity V of the coffee filter is given by π2 4π2 r2 r2 V 2 = r4h2 = · · · h2 9 9 2 2 2 2 2 r + r + h2 3 ≤ 4π · 2 2 9 3 3 4π2 2 = · 9 3 4π26 = . 243

2 2 This means V ≤ 2√π 3. This occurs when r = h2 = ,or 9 3 $ 2 √ 3 r2 = 2 2. The radius of the cone is 2 = 1 6 of that of the 3 3 3 √ · 1 circle. The angle of the sector is therefore 2π 3 6 radians. This is approximately 294 degrees. 442 Calculus problems

3. A Norman window has a fixed perimeter a. Find the largest possi- ble area.

r

h

2r 28.2 Maxima and minima without calculus 443

4. A right pyramid has a square base and a given surface area A. What is the largest possible volume?

l h

2b 444 Calculus problems

5. A tray is constructed from a square metal sheet by a × a by cutting squares of the same size from the four corners and folding up the sides. What is the largest possible capacity of the tray?

6. The perimeter of a triangle is a constant 2s. What is the largest possible area of the triangle? 28.2 Maxima and minima without calculus 445

7. The volume of a cylindrical can is given by V = πr2l and the surface area by A =2πr(l + r). If the volume is a constant V , what is the least possible surface area?

8. Inscribe in a given cone a cylinder whose volume is largest possi- ble.

2r

h r 446 Calculus problems

9. Find the largest cylinder contained in a sphere of radius R.

R

h r 28.2 Maxima and minima without calculus 447

10. Find the largest right circular cone contained in a sphere of radius R.

h

R r 448 Calculus problems

11. Two corridors of widths a and b meet at a right-angled corner. What is the length of the longest ladder which may be carried round the corner? Assume the workman sufficiently unimaginative to keep the ladder horizontal).

v

b

a u Chapter 29

29.1 Quartic polynomials and the golden ratio

Suppose the graph of a quartic polynomial f(x) has two points of inflec- tions A and B. If the line AB intersects the graph of f(x) at P and Q (in the order P , Q, B, Q), then A divides BP and B divides AQ in the golden ratio.

P

A Q B

Proof. Without loss of generality we may assume f(x) is monic, with f(0) = 0, and the x-coordinates of the points of inflections equal to ±a for some a. We write f (x) = 12(x2 − a2). Integrating, we obtain

f(x)=x2(x2 − 6a2)+bx for some constant b. 450

Since f(a)= b · a − 5a4, f(−a)= b(−a) − 5a4, the line containing the points of inflection is clearly y = bx − 5a4. This line intersects the graph of f(x) at four points given by x2(x2 − 6a2)+bx = bx − 5a4, or x2(x2 − 6a2)+5a4 =0 =⇒ (x2 − a2)(x2 − 5a2)=0. Two of these roots are ±a√, corresponding to the two points of inflection. The other two roots are ± 5a. These are the x-coordinates of P and Q. It follows that A divides BP and B divides AQ in the golden ratio. (1) There are three points on the graph y = f(x) where the tangents are parallel to the line AB. √ 3 2 These are given by 4x − 12√a x + b = b, i.e., x =0, x = ± 3a. 4 √(i) The tangents√ at x = ε 3a, ε = ±1, are the same line y +9a + − 4 ε 3ab = b(x + ε 3a), i.e., √y = bx 9a . 8 3 5 The area of the hump is 5 a , independent of b.

P

A Q B

(ii) The tangent√ at x =0is the line y = bx. It intersects the graph ± again at x = 6a. √ 2 6 5 The area of the double hump is 5 a . The two parts are equal in area. 29.1 Quartic polynomials and the golden ratio 451

P

A Q B

The area bounded by the graph of y = f(x) and the line AB (i) between A and P is equal that between B and Q, (ii) between A and B is equal to the sum of the areas between A and P , and between B and Q.

P

A Q B 452 Chapter 30

Infinite Series

30.1 Power series  n Theorem 30.1 (Abel’s limit theorem). Suppose a power series anx has finite radius of convergence r>0, and for x = r (or −r) converges to s. Then the function f(x) represented by the series for |x|

Examples 1. Differentiating (†), we have

∞ 1 k xk x x2 ··· k xk ··· , |x| < . − 2 = ( +1) =1+2 +3 + +( +1) + 1 (1 x) k=0

Further differentiations give the binomial expansion of (1 − x)n for negative exponents:

∞ ∞ 1 (n +1)···(n + k) n + k = xk = xk − n (1 x) k=0 k! k=0 k

all valid in the interval (−1, 1). 2. Integrating (†), we obtain

∞ xn x2 x3 xn − log(1 − x)= = x + + + ···+ + ··· . n=1 n 2 3 n 454 Infinite Series

This is valid for |x| < 1. Replacing x by −x,wehave

∞ (−1)n−1xn x2 x3 (−1)nxn log(1+x)= = x− + +···+ +··· , n=1 n 2 3 n again valid for |x| < 1. Combining the two series, we have n 2n+1 1+x x ∞ x log − =2 =2 1 x n odd n n=0 2n +1 | | 1+x valid for x < 1. Since every real number y can be written as 1−x for some |x| < 1, this can be used to compute logarithms of real numbers.  † − 2 1 ∞ − n 2n 3. Replacing x in ( )by x ,wehave1+x2 = n=0( 1) x = 1 − x2 + x4 −···+(−1)nx2n + ···, |x| < 1. Integrating, we obtain x3 x5 (−1)nx2n+1 arctan x = x − + −···+ + ··· 3 5 2n +1 again valid for |x| < 1. By Abel’s limit theorem, π 1 1 (−1)n =1− + −···+ + ··· . 4 3 5 2n +1 30.2 The Bernoulli numbers and the tangent function 455

30.2 The Bernoulli numbers and the tangent function

The coefficients Bn in the expansion of

∞ x Bn = xn, |x| < 2π, x − e 1 n=0 n! are called the Bernoulli numbers. They can be determined recursively as follows.

n−1 −1 n +1 Bn = Bk,B0 =1. n +1 k=0 k

− 1 It can be shown that B1 = 2 and other odd Bernoulli numbers are zero. The even Bernoulli numbers can be determined by the following relations due to S. Ramanujan:

n−1 −1 2n B2n = B2kB2n−2k. 2n +1 k=1 2k

Here are the first few (even) Bernoulli numbers:

1 − 1 1 B2 = 6 ,B4 = 30 ,B6 = 42 , − 1 5 − 691 B8 = 30 ,B10 = 66 ,B12 = 2730 , 7 − 3617 43867 B14 = 6 ,B16 = 510 ,B18 = 798 , − 174611 854513 − 236364091 B20 = 330 ,B22 = 138 ,B24 = 2730 , 8553103 − 23749461029 8615841276005 B26 = 6 ,B28 = 870 ,B30 = 14322 , − 7709321041217 2577687858367 − 26315271553053477373 B32 = 510 ,B34 = 6 ,B36 = 1919190 , 2929993913841559 − 261082718496449122051 B38 = 6 ,B40 = 13530 , 456 Infinite Series

In terms of the Bernoulli numbers, we have the series expansions

∞ n 2n (−1) 2 B2n x cot x =1 + x2n, |x| <π; n=1 (2n)! ∞ n−1 2n 2n (−1) 2 (2 − 1)B2n π tan x = x2n−1, |x| < ; n=1 (2n)! 2 ∞ n−1 2n (−1) (2 )B2n x csc x =1 + 2 x2n, |x| <π. n=1 (2n)! 30.3 The Euler numbers and the secant function 457

30.3 The Euler numbers and the secant function

The Euler numbers En are the coefficients in the expansion of the secant function: ∞ n (−1) E2n π sec x = x2n, |x| < . n=0 (2n)! 2 They are integers calculated recursively from

n−1 2n E2n = − E2k,E0 =1. k=0 2k Here are the first few Euler numbers:

E0 =1, E2 = − 1, E4 =5, E6 = − 61, E8 =1385, E10 = − 50521, E12 =2702765, E14 = − 199360981, E16 =19391512145, E18 = − 2404879675441, E20 =370371188237525, . . 458 Infinite Series

30.4 Summation of finite series

Find the sum of

1 + 22 + 333 + ···+ n(1 ··· 1 ). n Solution.

1 + 22 + 333 + ···+ n(1 ··· 1 ) n n k = (10k − 1) 9 k=1 n n 1 = k · 10k − k 9 k=1 k=1 n 1 1 = kxk − n(n +1) 9 2 k=1 x=10 n 1 1 = x kxk−1 − n(n +1) 9 2 k=1 x=10 n 1 d 1 = x xk − n(n +1) 9 dx 2  k=1 x=10' n − 1 d x(x 1) − 1 = x − n(n +1) 9  dx x 1 x=10 ' 2 1 x(nxn+1 − (n +1)x +1) 1 − n n = − 2 ( +1) 9 (x 1) x=10 2 n+1 − 1 10(n10 10(n +1)+1)− 1 = 2 n(n +1) 9 9 2 1 10(10n(10n − 1) − 9) 1 = − n(n +1) 9 92 2 30.4 Summation of finite series 459

A cornerstone of the theory of infinite series Summation of geometric progression: a(1 − rn) a + ar + ar2 + ···+ arn−1 = . 1 − r Theorem 30.2. The infinite geometric series with first term a and com- a − mon ratio r is convergent to 1−r if and only if 1

The art of integration

31.1 Indefinite integrals

If P (x) is a polynomial, & ax ax e − P (x) P (x) −··· P (x)e dx = P (x) + 2 + ; & a a a sin ax P (x) P (x)cosaxdx = P (x) − + −··· a a2 (3) cos ax P (x) − P (x) −··· + 3 + ; & a a a cos ax P (x) P (x)sinaxdx = − P (x) − + −··· a a2 sin ax P (x) P (3)(x) + − + −··· . a a a3 462 The art of integration

Examples dx 1. (1+ex)2 . x x ⇒ dy Put y = e . dy = e dx = ydx = dx = y . & & dx dy x 2 = 2 (1 + e ) & y(1 + y) 1 1 1 = − − dy y 1+y (1 + y)2 1 =logy − log(1 + y)+ + C 1+y 1 = x − log(1 + ex)+ + C. 1+ex √ 2 2. cos √xdx. Let y = x. x = y2; dx =2ydy. & & √ cos2 xdx = 2y cos2 ydy & = y(1 + cos 2y)dy 1 1 1 = y2 + y sin 2y + cos 2y + C 2 2 4 1 1√ √ 1 √ = x + x sin 2 x + cos 2 x + C. 2 2 4 dx 3. e2x+ex−2 . & & dx dx 2x x − = x − x e + e 2 &(e 1)(e +2) 1 1 1 = − dx x − x 3 & e 1 e +2 1 ex 1 ex − − − dx = x − 1 1 x 3 & e 1 2 e +2 1 3 ex 1 ex = − + + · dx 3 2 ex − 1 2 ex +2 x 1 1 = − + log(ex − 1) + log(ex +2)+C. 2 3 6 31.2 An iterated integral and a generalization 463 √ dx 4. ex−1 .

& & − x dx e 2 √ = √ dx x − −x e 1 &1 − e dy − x = −2 " with y = e 2 1 − y2 = −2arcsiny + C − x = −2arcsine 2 + C.

31.2 An iterated integral and a generalization

31.2.1 Crux Math. 3913 Here is Problem 3913 of Crux Mathematicorum (February 2015): Calculate & & ∞ ∞ dxdy x y 2 . 0 0 (e + e ) (1) For every a>0, & x=∞ & x=∞ −x dx −x · e dx x 2 = e −x 2 x=0 (a + e ) x=0 (ae +1)' x=∞ & x=∞ −x −x · 1 e dx = e −x + −x a(ae +1) x=0 x=0 a(ae +1)  'x=∞ − 1 − 1 −x = + 2 log(ae +1) a(a +1) a x=0 1 1 = − + log(a +1). a(a +1) a2 (2) Putting a = ey,wehave & y=∞ & x=∞ & y=∞ dxdy − 1 1 y x y 2 = y y + 2y log(e +1) dy y=0 x=0 (e + e ) y=0 e (e +1) e  'y=∞ & y=∞ − 1 y − 1 1 = 2y log(e +1) y y dy 2e y=0 2 y=0 e (e +1) 1 1  y=∞ = log 2 − −e−y +log(1+e−y) 2 2 y=0 1 1 1 = log 2 − (1 − log 2) = log 2 − . 2 2 2 464 The art of integration ∞ ∞ dxdy Remark. A similar calculation shows that 0 0 (ex+ey)2 =log4. (1) For every a>0, & & x=∞ dx x=∞ e−xdx x = −x x=0 a + e x=0 ae +1  'x=∞ 1 = − log(ae−x +1) a x=0 1 = log(a +1). a (2) Putting a = ey,wehave & & & y=∞ x=∞ dxdy y=∞ log(ey +1) x y = y dy y=0 x=0 e + e y=0 e  'y=∞ & log(ey +1) y=∞ 1 = − + dy ey ey +1 y=0 y=0 & y=∞ y − e =log2+ 1 y dy y=0 e +1 y y=∞ =log2+[y − log(e +1)]y=0  'y=∞ ey =log2+ log y e +1 y=0 1 =log2− log =2log2. 2

31.2.2 A generalization We calculate more generally && 1 In := x y n dA R (e + e ) for all positive integers n. The transformation of coordinates 1 1 x = (u − v),y= (u + v) 2 2 maps the first quadrant of the xy-plane onto the region E := {(u, v): −u ≤ v ≤ u, u ≥ 0} 31.2 An iterated integral and a generalization 465

∂(x,y) 1 with Jacobian ∂(u,v) = 2 . Further, by symmetry in v,wehave && 1 1 In =      n dvdu nu v − v 2 E exp 2 exp 2 +exp 2 & & v=∞ u=∞ du dv =       n nu v − v v=0 u=v exp 2 exp 2 +exp 2 & v=∞ 2 1  ·    dv   = nv v v n n v=0 exp − & 2 exp 2 +exp 2 2 v=∞ dv = v n n v=0 (e +1)

We consider more generally & v=∞ dv Jn(t):= v n v=0 (e + t)

2 for t>0. With this, In = n Jn(1). Note that & v=∞ & v=∞ v dv 1 − e J1(t)= v = 1 v dv v=0 e + t t v=0  e + t ' v v=∞ 1 − v v=∞ 1 e log(1 + t) = [v log(e + t)]v=0 = log v = . t t e + t v=0 t

Differentiation with respect to t gives & d d v=∞ 1 Jn(t)= v n dt dt &dt v=0 (e + t) v=∞ d 1 = v n dt &v=0 dt (e + t) v=∞ −n = v n+1 dt v=0 (e + t) = −nJn+1(t). 466 The art of integration

From this, −1 d −1 −1 −1 −1 dn Jn+1(t)= Jn(t)=···= · ··· J1(t) n dt n n − 1 2 1 dtn − n n   ( 1) d −1 · = n t log(1 + t) n! dt − n n n−k −1 k ( 1) n d (t ) · d (log(1 + t) = n−k k n! k=0 k dt dt − n n −1 n n−k −1 k ( 1) d (t ) · n d (t ) · d (log(1 + t) = n log(1 + t)+ n−k k n! dt k=1 k dt dt (−1)n = ((−1)nn!log(1+t) n! n − n−k − − − · − − n ( 1) (n k)! · ( 1)( 2) ( (k 1)) + n−k+1 k k=1 k t (1 + t) − n n − − ( 1) − n − n−1 n (n k)!(k 1)! = ( 1) n!log(1+t)+( 1) n−k+1 k n! k=1 k t (1 + t) n − 1 =log(1+t) n−k+1 k k=1 kt (1 + t)

Therefore, for n ≥ 2, n−1 2 2 − 1 In = Jn(1) = log 2 k . n n k=1 k2

nIn 12log2 − 1 2log22 2 − 5 3 3 log 2 12 1 − 1 4 2 log 2 3 2 − 131 5 5 log 2 480 1 − 661 6 3 log 2 2880 2 − 1327 7 7 log 2 6720 1 − 1163 8 4 log 2 6720 2 − 148969 9 9 log 2 967680 1 − 447047 10 5 log 2 3225600 Chapter 32

Rearrangements of the alternating harmonic series

32.1 Riemann’s theorem on conditionally convergent se- ries

  A convergent series an is absolutely convergent if |an| is also con- vergent. It is conditionally convergent if |an| diverges. The alternat- ing harmonic series

(−1)n−1 1 1 1 (−1)n−1 =1− + − + ···+ + ··· n 2 3 4 n is conditionally convergent since it converges to log 2 but its absolute value series, being the harmonic series, is divergent. While a convergent series remains convergent under every rearrange- ment if and only if it is absolutely convergent, and the sum is unchanged for every rearrangement, the situation is completely different for condi- tionally convergent series.

Theorem 32.1 (Riemann). A conditionally convergent series can be re- arranged suitably to converge to any prescribed real number including ±∞. 468 Rearrangements of the alternating harmonic series

32.2 Rearrangements of the alternating harmonic se- ries

Example 32.1. Rearrange the alternating harmonic series by writing al- ternately two positive terms in their natural order, followed by one neg- ative term: 1 1 1 1 1 1 1 1 1+ − + + − + + − ++−··· . 3 2 5 7 4 9 11 6 Denote by sn the n-th partial sum of the series. We shall express this in terms of the partial sums Sn of the alternating harmonic series. Specifi- cally, we compute s3n: 1 − 1 1 1 − 1 ··· 1 1 − 1 s3n = 1+ + + + + − + − 3 2 5 7 4 4n 3 4n 1 2n 1 1 1 = A4n + + + ···+ 2n +2 2n +4 4n 1 1 1 1 = A4n + + + ···+ . 2 n +1 n +2 n + n Now, clearly, (i) limn→∞ A4n =log2. On the other hand, (ii) the limit 1 1 1 lim + + ···+ n→∞ n +1 n +2 n + n can be computed as an integral. We shall show that this is also log 2. From these it follows that 1 3 lim s3n =log2+ log 2 = log 2. n→∞ 2 2 1 To prove (ii), consider the function f(x)= 1+x on the interval [0, 1]. By subdividing the interval into n equal parts and choosing right hand endpoints of each part, we have the Riemann sum 1 1 1 1 1 1 1 1 + 2 + ···+ n = + + ···+ . n 1+ n 1+ n 1+ n n +1 n +2 n + n Therefore, & 1 1 1 1 1 lim + + ···+ = dx =log2. n→∞ n +1 n +2 n + n 0 1+x 32.2 Rearrangements of the alternating harmonic series 469

More generally, if we rearrange the alternating harmonic series by writing alternately p positive terms in their natural order, followed by q minus terms. The sum of the resulting series is 1 p 1 4p log 2 + log = log . 2 q 2 q In particular, 1 1 1 1 1 1 1 1 1 1 − − − − + − − − − + −−−−+ ···=0. 2 4 6 8 3 10 12 14 16

Example 32.2. Find a necessary and sufficient condition on (a1,a2,a3,a4) for the series ∞ a1 a2 a3 a4 + + + n=0 4n +1 4n +2 4n +3 4n +4 to converge, and determine the sum of the series when this condition is satisfied. − π − ln 2 Answer. a1 + a2 + a3 + a4 =0. Sum = (a1 a3) 8 (a2 +3a4) 4 . Solution. Necessary and sufficient condition: a1 + a2 + a3 + a4 =0. (1) (a1,a2,a3,a4)=(1, −1, 1, −1): ∞ (−1)n 1 1 1 =1− + − + − + −···=log2. n=0 n +1 2 3 4

(2) (a1,a2,a3,a4)=(1, 0, −1, 0): ∞ (−1)n 1 1 1 π =1− + − + − + −···= . n=0 2n +1 3 5 7 4

(3) (a1,a2,a3,a4)=(1, 1, 1, −3): ∞ 1 1 1 1+ + − +++−···= (H4k+4 − Hk+1)=2log2. 2 3 4 k=0 (4) Therefore if the condition is satisfied, from

4(a1,a2,a3,a4) =(a1 − 2a2 + a3)(1, −1, 1, −1) + 2(a1 − a2)(1, 0, −1, 0) +(a1 +2a2 + a3)(1, 1, 1, −3), 470 Rearrangements of the alternating harmonic series the sum is   1 π (a1 − 2a2 + a3) log 2 + 2(a1 − a2) +2(a1 +2a2 + a3)log2 4  4  1 π = (a1 − a3) · +(3a1 +2a2 +3a3)log2 4  2  1 π = (a1 − a3) · − (a2 +3a4)log2 . 4 2 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, ,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. 502 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 trian- gles 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 503

[28] F. Burk, Natural 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://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] F. W. Cheney, Heronian triangles, AMERICAN MATH. MONTHLY, 36 (1929) 22Ð28.

[38] P. L. Chessin and W. B. Carver, Problem E 1111, AMERICAN MATH.MONTHLY, 61 (1954) 258; solution 712. [39] 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. [40] D. B. Coleman, Sketch, a geoboard game, Math. Mag., 51 (1978) 49Ð54. [41] J. H. Conway and R. K. Guy, The Book of Numbers, Springer, 1996. [42] R. J. Covill and T. O’Keeffe, Problem 679, Journal of Recre- ational Math., 10 (1977Ð1978) 285; solution, 11 (1978Ð1979) 312. 504 BIBLIOGRAPHY

[43] H. S. M. Coxeter, The golden section, phyllotaxis, and Wythoff’s game, Scripta Mathematica, 19 (1953) 135Ð143. [44] K. David, Rencontres reencountered, College Math. Journal,19 (1988) 139Ð148. [45] T. R. Dawson, Ornamental squares and triangles, Math. Gazette, 30 (1946) 19Ð21. [46] M. N. Desphande, An unexpected encounter with the Fibonacci numbers, Fibonacci Quarterly, 32 (1994) 108 Ð 109. [47] D. W. DeTemple, The triangle of smallest perimeter which cir- cumscribes a semicircle, Fibonacci Quarterly, 30 (1992) 274. [48] C. Dodge, T. Schoch, P. Y. Woo, and P. Yiu, Those ubiquitous circles, Math. Mag., 72 (1999) 202Ð213. [49] H. G. Dworschak and L. Sauve,« Problem 19, Crux Math., 1 (1975) 8; solution, 1 (1975) 32Ð33. [50] H. Dubner, Recursive prime generating sequences, Journal of Recreational Math., 29 (1998) 170Ð175. [51] H. E. Dudeney, Amusements in Mathematics, 1919, Dover reprint, 1958. [52] H. E. Dudeney, 536 Curious Problems and Puzzles, edited by M. Gardner, Barnes and Noble reprint, 1995. [53] H. E. Dudeney, Canterbury Puzzles, 1919, Dover reprint, 2002. [54] U. Dudley, Mathematical Cranks, Math. Assoc. America, 1992. [55] H. G. Dworschak and L. Sauve, Problem 19, Crux Math., 1 (1975) 8; solution 32. [56] E. J. Eckert, Primitive Pythaogrean triples, College Math. Journal, 23 (1992) 413Ð417. [57] E. J. Eckert and H. Haagensen, A Pythagorean tiling of the plane, Math. Mag., 62 (1989) 175. [58] R. E. Edwards et al., Problem 889, Math. Mag., 47 (1974) 46Ð47; solution 289Ð292. BIBLIOGRAPHY 505

[59] R. B. Ely, III, Magic designs, Journal of Recreational Math.,1 (1968) 5Ð17. [60] A. Engel, Problem Solving Strategies, Springer, 1998. [61] R. Epp and T. Furguson, A note on takeaway games, Fibonacci Quarterly, 18 (1980) 300Ð303. [62] P. Erdos˝ and G. Szekeres, Some number theoretic problems on binomial coefficients, Australian Math. Soc. Gazette, 5 (1978) 97Ð 99. [63] S. Forman, A serendipitous application of the Pythagorean triplets, College Math. Journal, 23 (1992) 312Ð314. [64] R. L. Francis, Mathematical haystacks: another look at repunit numbers, College Math. Journal, 19 (1988) 240Ð246. [65] A. S. Fraenkel and H. Herda, Never rush to be first in playing nimbi, Math. Mag., 53 (1980) 21Ð26. [66] H. Fukagawa and D. Pedoe, Japanese Temple Geometry, Charles Babbage Research Centre, Wennipeg, 1989. [67] H. Fukagawa and J. F. Rigby, Traditional Japanese Mathematical Problems, 2002, SCT Publishing, Singapore.

[68] H. Furstenberg,¬ On the infinitude of primes, AMERICAN MATH. MONTHLY, 62 (1955) 353. [69] J. Gallego-Diaz and D. L. Silverman, Problem 1453 (corrected), AMERICAN MATH.MONTHLY, 68 (1961) 177; correction, 572; solution 69 (1962) 166. [70] J. A. Gallian, The mathematics of identification numbers, College Math. Journal, 22 (1991) 194Ð202. [71] M. Gardner, Mathematical card tricks, Scripta Math., 14 (1948) 99Ð111. [72] M. Gardner, Hexaflexagons and Other Mathematical Diversions, The First Scientific American Book of Mathematical Puzzles and Diversions, University of Chicago Press, 1988. [73] M. Gardner, The Second Scientific American Book of Mathemati- cal Puzzles and Diversions, University of Chicago Press, 1987. 506 BIBLIOGRAPHY

[74] M. Gardner, The Colossal Book of Mathematics, Norton, 2001. √ [75] R. Gauntt and G. Rabson, The irrationality of 2,AMERICAN MATH.MONTHLY, 63 (1956) 247. [76] I. Gessel, Problem H-187, Fibonacci Quarterly, 10 (1972) 417Ð 419. [77] R. A. Gibbs, M. Chamberlain, and R. Lyons, Problem 1031, Math. Mag., 51 (1978) 69; solution, 52 (1979) 116. [78] S. Golomb, Permutations by cutting and shuffling, SIAM Review, 3 (1961) 114Ð118.

[79] S. Golomb, Iterated binomial coefficients, AMERICAN MATH. MONTHLY, 87 (1980) 719 - 727. [80] S. Golomb, Problem 477, Pi Mu Epsilon Journal, 7.3 (1980) 187; solution, 8.5 (1981) 348Ð349. [81] S. Golomb and M. S. Klamkin, Problem 232, Pi Mu Epsilon Jour- nal, 5.2 (1970) 87; solution, 5.4 (1971) 208. [82] R. Goormaghtigh, Lemoyne’s theorem, Scripta Math., 18 (1953) 182Ð184. [83] H. D. Grossman, Ternary epitaph on coin problems, Scripta Math., 14 (1948) 69Ð71. [84] R. K. Guy, Problem 1153, Crux Math., 12 (1986) 139; solution, 13 (1987) 286Ð287. [85] R. K. Guy, Problem 1220, Crux Math., 13 (1987) 54; solution, 14 (1988) 125Ð126. [86] R. K. Guy, The strong law of small numbers, Amer. Math. Monthly, 95 (1988) 697Ð712. [87] R. K. Guy and M. E. Marcin, Problem 1915, Crux Math.,,20 (1994) 48; solution, 21 (1995) 30. [88] R. K. Guy and C. Springer, Problem 1367, Crux Math., 14 (1988) 202; solution, 15 (1989) 278Ð279. [89] R. K. Guy, The second strong law of small numbers, Math. Mag., 63 (1990) 3Ð20. BIBLIOGRAPHY 507

[90] R. K. Guy, Unsolved Problems in , 2nd edition, Springer, 1994. [91] R. K. Guy and R. E. Woodrow, The Lighter Side of Mathematics, MAA, 1994. [92] A. Hall, Genealogy of Pythagorean triples, Math. Gazette,54 (1970) 377Ð379. [93] C. L. Hamberg and R. A. Gibbs, Problem 975, Math. Mag.,49 (1976) 96; solution, 50 (1977) 266. [94] G. H. Hardy, A Mathematician’s Apology, Cambridge Univesity Press, 1940. [95] G. H. Hardy, A Course in Pure Mathematics, 10th edition, 1952, Cambridge; reprint 1963. [96] A.P. Hatzipolakis and P. Yiu, The Lucas circles of a triangle, Amer. Math. Monthly, 108 (2001) 444 Ð 446. [97] O. Higgins, Another long string of primes, Journal of Recre- ational Math., 14 (1981-82) 185. [98] A. M. Hinz, Pascal’s triangle and the tower of Hanoi, Amer. Math. Monthly, 99 (1992) 538Ð544.

[99] V. Hoggatt and L. Moser, Problem E 861, AMERICAN MATH. MONTHLY, 56 (1949) 262; solution 57 (1950) 35. [100] A. Holshouser and H. Reiter, One pile nim with arbitrary move function, Electronic Journal of , 10 (2003) #N7. [101] R. Honsberger, Semi-regular lattice polygons, College Math. Journal, 13 (1982) 36Ð44. [102] R. Honsberger, In Polya’s« Footsteps, Math. Assoc. America, 1997. [103] A. F. Horadam, Fibonacci sequences and a geometric paradox, Math. Mag. 35 (1962) 1Ð11. [104] L. S. Johnson, Denumerability of the rational number system, amm 55 (1948) 65Ð70. 508 BIBLIOGRAPHY

[105] J. H. Jordan, R. Walsh, and R. J. Wisner, Triangles with integer sides, AMERICAN MATH.MONTHLY, 86 (1979) 686Ð688. [106] S. Kahan, s-transposable integers, Math. Mag., 49 (1976) 27Ð28. [107] D. Kalman and R. Mena, The Fibonacci numbers Ð exposed, Math. Mag., 76 (2003) 167Ð181. [108] H. Kestelman, On arithmetic and geometric means, Math. Gazette, 46 (1962) 130.

[109] C. Kicey and S. Goel, A series for ln k,AMERICAN MATH. MONTHLY, 105 (1998). [110] M. S. Klamkin and P. Watson, Triangulations and Pick’s theorem, Math. Mag., 49 (1976) 35Ð37. [111] D. A. Klarner, Mathematical Recreations, A Collection in Honor of Martin Gardner, Dover, 1998, originally published as Mathe- matical Gardner, Wadsworth International, CA, 1981. [112] M. Kleber, The best card trick, Math. Intelligencer, 24 (2002) 1:9Ð 11. [113] D. E. Knuth, Fundamental Algorithms, 2nd edition, Addison- Wesley, 1973. [114] T. Koshy, The of a , Journal of Recre- ational Math., 31 (2002Ð2003) 112Ð113. [115] M. Kraitchik, Mathematical Recreations, 2nd edition, 1942; Dover reprint, 1953. [116] N. Krier and B. Manvel, Counting integer triangles, Math. Mag., 71 (1998) 291Ð295. [117] S. Kumar, On Fibonacci sequences and a geometric paradox, Math. Mag., 37 (1964) 221Ð223. [118] V. S. Kumar, On the digital root series, Journal of Recreational Math., 12 (1979Ð80) 267Ð270. [119] M. E. Larson, The eternal triangle Ð a history of a counting prob- lem, College Math. Journal, 20 (1989) 370Ð384. BIBLIOGRAPHY 509

[120] H. Larson and V. G. Feser, Problem 566, Journal of Recreational Math., 9 (1976) 298; solution, 10 (1977Ð78) 311Ð313. [121] W. G. Leavitt, Repeating , College Math. Journal,15 (1984) 299Ð308. [122] D. N. Lehmer, Asymptotic evaluation of certain totient sums, Amer. J. Math. 22 (1900) 293Ð335. [123] R. B. Leigh and R. T. Ng, Minimizing aroma loss, College Math. Journal, 30 (1999) 356Ð358. [124] J. Lesko, A series for ln k, College Math. Journal, 32 (2001) 119Ð 122. [125] R. E. Lester, The malititudes of a cyclic quadrilateral, Math. Gazette, 46 (1962) 147. [126] A. Liu, A direct proof of Pick’s theorem, Crux Math., 4 (1978) 242Ð244. [127] E. Lucas, Recreations« Mathematiques« , 4 tomes, Gauthier Villars, Paris, 1891, 1896, 1893, 1894. [128] A. Machado, Nineteenth problems on elementary geometry, Math. Intelligencer, 17:1 (1995) 17Ð19. [129] G. Markowsky, Misconceptions about the golden ratio, College Math. Journal, 23 (1992) 2Ð19. [130] L. Marvin and F. H. Kierstead, Problem 315, Journal of Recre- ational Math., 7 (1974) 62; solution 9 (1976Ð77) 307.

[131] S. W. McInnis, Magic circles, AMERICAN MATH.MONTHLY,60 (1953) 347Ð351. [132] D .S. Mitrinovic,« An inequality concerning the arithmetic and ge- ometric means, Math. Gazette, 50 (1966) 310Ð311.

[133] R. K. Morley and P. Schub, Problem E24, AMERICAN MATH. MONTHLY, 40 (1933) 111; solution, 425Ð426. [134] S. B. Morris, Faro shuffling and card placement, Journal of Recre- ational Math., 8 (1975) 1Ð7. 510 BIBLIOGRAPHY

[135] S. B. Morris, The basic mathematics of the faro shuffle, Pu Mu Epsilon Journal, 6.2 (1975) 85Ð92. [136] W. Moser, It is elementary (combinatorics), Crux Math.,18 (1992) 257Ð262; 289Ð295; 19 (1993) 1Ð2. [137] D. Nelson, A regular pentagon construction, Math. Gazette,61 (1977) 215Ð216. [138] I. Niven, Note on a paper by L. S. Johnson, Amer. Math. Monthly, 55 (1948) 358. [139] L. C. Noll and D. I. Bell, n-clusters for 1

[140] A. Porges, A set of Eight Numbers, AMERICAN MATH. MONTHLY, 52 (1945) 379 - 384. [141] A. S. Posamentier and C. T. Salkind, Challenging Problems in Geometry, Dover, 1988. [142] C. S. Queen, Palindromes, Fibonacci Quarterly, 31 (1993) 216Ð 226. [143] S. Rabinowitz, Problem 1299, Journal of Recreational Math.,16 (1983Ð1984) 139.

[144] Note on magic circles, AMERICAN MATH.MONTHLY, 60 (1953) 640. [145] V. Revennaugh and R. W. Buckley, Problem 385, Journal of Recreational Math., 8 (1975Ð76) 137; solution, 10 (1977Ð78) 288Ð289. [146] P. Ribenboim, The New Book of Prime Number Records, Springer, 1996. [147] J. Roberts, Elementary Number Theory, A Problem Oriented Ap- proach, MIT, 1975. [148] R. R. Rowe, Carroll’s paper folding pillow problem, Journal of Recreational Math., 4 (1971) 192Ð198. [149] D. L. Silverman, R. R. Robinson and R. L. Patton, Problems 141, 142, Journal of Recreational Math., 3 (1970) 237; solution, 4 (1971) 222Ð223. BIBLIOGRAPHY 511

[150] F. Rubin and V. G. Feser, Problem 1078, Journal of Recreational Math., 14 (1981) 141Ð142; solution, 15 (1982Ð1983) 155Ð156. [151] K. R. S. Sastry and J. H. Steelman, Problem 647, College Math. Journal, 30 (1999) 143; solution, 31 (2000) 139Ð140. [152] N. Sato, An ambivalent sum, Crux Math., 23 (1997) 290Ð293. [153] D. Schattschneider, Counting it twice, College Math. Journal,22 (1991) 203Ð211. [154] J. Schram, A string of 176 primes, Journal of Recreational Math., 15 (1982Ð83) 168Ð169. [155] J. Schram, A recurrence relation for Fermat numbers, Journal of Recreational Math., 16 (1983Ð84) 195Ð197. [156] A. J. Schwenk, Take-away games, Fibonacci Quarterly, 8 (1970) 225Ð234. [157] H. Shapiro, An arising from the φ function, Amer. Math. Monthly, 50 (1943) 18Ð30. [158] D. L. Silverman and D. Singmaster, Problem 1017, Journal of Recreational Math., 13 (1980) 298; solution, 14 (1981Ð1982) 313. [159] D. Singmaster, Problem 267, Journal of Recreational Math.,6 (1973) 152Ð153. [160] D. Singmaster and B. Barwell, Problem 812, Journal of Recre- ational Math., 13 (1980Ð1981) 62Ð63. [161] D. Singmaster, Triangles with integer sides and sharing barrels, College Math. Journal, 21 (1990) 278Ð285. [162] J. St. C. L. Sinnadurai, A well-known geometrical problem, Math. Gazette, 46 (1962) 143Ð144. [163] J. Slocum, The Tangram Book, Sterling, New York, 2003. [164] , L. M. Smiley, A quick solution of triangle counting, Math. Mag., 66 (1995) 40. [165] C. A. B. Smith, Compound games with counters, Journal of Recreational Math., 1 (1968) 67Ð77. 512 BIBLIOGRAPHY

[166] M. Somos and R. Haas, A linked pair of sequences implies the primes are infinite, AMERICAN MATH.MONTHLY, 110 (2003) 539Ð540. [167] J. A. Spencer and H. Ahlburg, Problem 428, Crux Math., 5 (1979) 77; solution, 6 (1980) 50.

[168] J. E. Trevor and W. E. Buker, Problem 178, AMERICAN MATH. MONTHLY, 43 (1937) 104; solution, 499Ð500. [169] C. W. Trigg, Eight digits on a cube’s vertices, Journal of Recre- ational Math., 7 (1974) 49Ð55. [170] C. W. Trigg, Tetrahedral models from envelopes, Math. Mag.,51 (1978) 66Ð67. [171] C. W. Trigg, Some curiosa involving the first ten perfect numbers, Journal of Recreational Math., 23 (1991) 286. [172] T. Trotter, Perimeter-magic polygons, Journal of Recreational Math., 7 (1974) 14Ð20. [173] M. Wald, Solution to Problem 1664, Journal of Recreational Math., 21 (1989) 236Ð237.

[174] F. T. Wang and C. C. Hsiung, A theorem on the tangram, AMER- ICAN MATH.MONTHLY, 49 (1942) 596Ð599. [175] S. R. Wassel, Rediscovering a family of means, Math. Intelli- gencer, 24.2 (2002) 58Ð65. [176] C. Waiveris and Y. Chen, Folding stars, College Math. Journal,30 (1999) 370Ð378. [177] M. Wald, Solution to Problem 1664, Journal of Recreational Math., 21 (1989) 236Ð237. [178] J. E. Waltrom and M. Berg, Prime primes, Math. Mag., 42 (1969) 232. [179] E. T. H. Wang and J. I. Levy, Problem 1001, Math. Mag.,49 (1976) 253; solution, 51 (1978) 246. [180] W. C. Waterhouse, Continued fractions and Pythagorean triples, Fibonacci Quarterly, 30 (1992) 144Ð147. BIBLIOGRAPHY 513

[181] A. Wayne, A genealogy of 120◦ and 60◦ natural triangles, Math. Mag., 55 (1982) 157Ð162. [182] C. S. Weaver, Geoboard triangles with one interior point, Math. Mag., 50 (1977) 92Ð94. [183] D. Wells, Beauty in mathematics, Math. Intelligencer, 10:4 (1988) 31. [184] D. T. Whiteside, The Mathematical Papers of Issac Newton, vol. V, Cambridge University Press, 1976.

[185] A. W. Willcox and L. A. Ringenberg, Problem 971, AMERICAN MATH.MONTHLY, 58 (1951) 417; solution 59 (1952) 105Ð106. [186] P. Woo, Simple constructions of the incircle of an arbelos, Forum Geometricorum, 1 (2001) 133Ð136. [187] M. Wunderlich, Another proof of the infinite primes theorem, AMERICAN MATH.MONTHLY, 72 (1965) 305. [188] S. Yates, The mystique of repunits, Math. Mag., 51 (1978) 22Ð28. [189] S. Yates, Periods of unique primes, Math. Mag., 53 (1980) 314. [190] S. Yates, Repunits and Repetends, privately published, Delray Beach, FL, 1982. [191] P. Yiu, Construction of indecomposable Heronian triangles, Rocky Mountain Journal of Mathematics, 28 (1998) 1189 Ð 1202. [192] P. Yiu and J. Young, Problem 2406, Crux Math., 25 (1999) 48; solution, 26 (2000) 53Ð54. [193] P. Yiu, Mixtilinear incircles, Amer. Math. Monthly, 106 (1999) 952 Ð 955. [194] P. Yiu, The uses of homogeneous barycentric coordinates in plane , Int. J. Math. Educ. Sci. Technol, 31 (2000) 569 Ð 578. [195] P. Yiu, Heronian triangles are lattice triangles, Amer. Math. Monthly, 108 (2001) 261 Ð 263. [196] P. Yiu, The volume of an isosceles tetrahedron and the Euler line, Mathematics & Informatics Quarterly, 11 (2001) 15Ð19. 514 BIBLIOGRAPHY

[197] N. Yoshigahara, Card-return numbers, Journal of Recreational Math., 5 (1972) 36Ð38.