recreational mathematicsmath.fau.edu/yiu/oldwebsites/rm2006/rm2006.pdf · 2006. 7. 26. ·...

176
Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University Summer 2006 Chapters 1–36 Wednesday, July 26 Monday *** 7/3 7/10 7/17 7/24 Wednesday *** 7/5 7/12 7/19 7/26 Friday 6/30 7/7 7/14 7/21 7/28

Upload: others

Post on 06-Mar-2021

21 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Recreational Mathematics

Paul Yiu

Department of MathematicsFlorida Atlantic University

Summer 2006

Chapters 1–36

Wednesday, July 26

Monday *** 7/3 7/10 7/17 7/24Wednesday *** 7/5 7/12 7/19 7/26Friday 6/30 7/7 7/14 7/21 7/28

Page 2: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

ii

Page 3: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Contents

1 The Nim game 1011.1 Euclidean algorithm . . . . . . . . . . . . . . . . . . . 1011.2 Binary representation of a number . . . . . . . . . . . 101

1.2.1 A number from its binary representation . . . . . 1021.3 The nim sum . . . . . . . . . . . . . . . . . . . . . . . 1021.4 The game Nim . . . . . . . . . . . . . . . . . . . . . . 103

2 The Josephus problem and its generalization 1052.1 The Josephus problem . . . . . . . . . . . . . . . . . . 1052.2 The generalized Josephus problem J(n, k) . . . . . . . 107

3 Representation of a number in different bases 1093.1 Base b-representation of a number . . . . . . . . . . . . 109

3.1.1 A number from its base b-representation . . . . . 1103.2 Balanced division by an odd number . . . . . . . . . . 1113.3 Balanced base b representation of a number . . . . . . . 1123.4 Arithmetic in balanced base 3 representations . . . . . 113

4 A card trick 201

5 Cheney’s card trick 2055.1 Three basic principles . . . . . . . . . . . . . . . . . . 205

5.1.1 The pigeonhole principle . . . . . . . . . . . . . 2055.1.2 Arithmetic modulo 13 . . . . . . . . . . . . . . 2055.1.3 Permutations of three objects . . . . . . . . . . . 206

6 Coin weighing 2096.1 Coin weighing with 3 standard weights . . . . . . . . . 2096.2 A twelve coin problem . . . . . . . . . . . . . . . . . . 209

Page 4: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

iv CONTENTS

7 Greatest common divisor 3017.1 gcd(a, b) from the Euclidean algorithm . . . . . . . . . 301

7.1.1 gcd(a, b) as an integer combination of a and b . . 3027.2 gcd(a, b) by counting interior points of a lattice triangle 302

7.2.1 Calculation of gcd . . . . . . . . . . . . . . . . 3037.3 Fibonacci numbers . . . . . . . . . . . . . . . . . . . . 304

8 Lattice polygons 3078.1 Pick’s Theorem: area of lattice polygon . . . . . . . . . 3078.2 Counting primitive triangles . . . . . . . . . . . . . . . 308

8.2.1 The number of primitive triangles in a latticepolygon . . . . . . . . . . . . . . . . . . . . . . 308

9 The Farey sequences 3119.1 The Farey sequence . . . . . . . . . . . . . . . . . . . 3119.2 Primitive lattice triangles . . . . . . . . . . . . . . . . 312

10 Irrationality of√

n 40110.1 Irrationality of

√2 . . . . . . . . . . . . . . . . . . . . 401

10.1.1 Reasoning with units digits . . . . . . . . . . . . 40110.1.2 Reasoning with even and odd . . . . . . . . . . 40110.1.3 Reasoning in a base 3 . . . . . . . . . . . . . . . 40210.1.4 Geometric proof . . . . . . . . . . . . . . . . . 402

10.2 Irrationality of√

n . . . . . . . . . . . . . . . . . . . . 40210.2.1 N. J. Fine’s proof . . . . . . . . . . . . . . . . . 40210.2.2 P. Ungar’s proof . . . . . . . . . . . . . . . . . 403

10.3 Nonexistence of regular lattice polygon . . . . . . . . . 403

11 Continued fractions 40511.1 Simple continued fractions . . . . . . . . . . . . . . . 40511.2 Finite simple continued fractions . . . . . . . . . . . . 40511.3 Convergents . . . . . . . . . . . . . . . . . . . . . . . 40611.4 Continued fraction expansion of

√d . . . . . . . . . . 407

12 The integer equations x2 − dy2 = ±1 40912.1 Integer solutions of x2 − dy2 = 1 . . . . . . . . . . . . 40912.2 Integer solutions of x2 − dy2 = −1 . . . . . . . . . . . 41012.3 The equation x2 − 2y2 = 1 . . . . . . . . . . . . . . . 41112.4 Applications . . . . . . . . . . . . . . . . . . . . . . . 411

12.4.1 Triangular numbers which are squares . . . . . . 411

Page 5: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

CONTENTS v

12.4.2 Pythagorean triangles with consecutive legs . . . 41112.4.3 . . . . . . . . . . . . . . . . . . . . . . . . . . 412

13 Pythagorean triangles 50113.1 Primitive Pythagorean triples . . . . . . . . . . . . . . 501

13.1.1 Rational angles . . . . . . . . . . . . . . . . . . 50213.1.2 Some basic properties of primitive Pythagorean

triples . . . . . . . . . . . . . . . . . . . . . . . 50313.2 Pythagorean triangles with given sides . . . . . . . . . 50313.3 Enumeration of primitive Pythagorean triangles . . . . 50313.4 A Pythagorean triangle with an inscribed square . . . . 50413.5 When are x2 − px ± q both factorable? . . . . . . . . . 50513.6 Dissection of a square into Pythagorean triangles . . . . 506

14 3-4-5 triangles in the square 507

15 Dissections 50915.1 The tangram . . . . . . . . . . . . . . . . . . . . . . . 50915.2 Dissection of the square . . . . . . . . . . . . . . . . . 510

15.2.1 Dissection of the square into 8 parts in arith-metic progression . . . . . . . . . . . . . . . . . 510

15.2.2 Dissection of a square into 7 rectangles . . . . . 510

16 The classical triangle centers 60116.1 The centroid . . . . . . . . . . . . . . . . . . . . . . . 60116.2 The circumcircle . . . . . . . . . . . . . . . . . . . . . 60216.3 The incenter and the incircle . . . . . . . . . . . . . . 60316.4 The orthocenter and the Euler line . . . . . . . . . . . . 60416.5 The excenters and the excircles . . . . . . . . . . . . . 605

17 Medians and angle bisectors 60717.1 Stewart’s theorem . . . . . . . . . . . . . . . . . . . . 60717.2 The medians . . . . . . . . . . . . . . . . . . . . . . . 60717.3 The angle bisectors . . . . . . . . . . . . . . . . . . . 60817.4 The problem of three angle bisectors . . . . . . . . . . 609

18 Isosceles triangles equal in perimeter and area 611

Page 6: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

vi CONTENTS

19 The area of a triangle 70119.1 Heron’s formula for the area of a triangle . . . . . . . . 70119.2 Heron triangles . . . . . . . . . . . . . . . . . . . . . . 70219.3 Heron triangles with consecutive sides . . . . . . . . . 70219.4 Heron triangles with sides in arithmetic progression . . 70419.5 Heron triangles with integer medians . . . . . . . . . . 705

20 Heron triangles and incircles 70720.1 Enumeration of Heron triangles by inradii . . . . . . . 70720.2 Inradii in arithmetic progression . . . . . . . . . . . . . 70820.3 Division of a triangle into two subtriangles with equal

incircles . . . . . . . . . . . . . . . . . . . . . . . . . 709

21 More about Heron triangles 71121.1 Heron triangle as lattice triangle . . . . . . . . . . . . . 71121.2 The circumcircle of a Heron triangle . . . . . . . . . . 71121.3 Heron triangles with square areas . . . . . . . . . . . . 712

22 The regular pentagon 80122.1 The golden ratio . . . . . . . . . . . . . . . . . . . . . 80122.2 The diagonal-side ratio of a regular pentagon . . . . . . 80222.3 Construction of a regular pentagon with a given diagonal 80322.4 Some interesting constructions of the golden ratio . . . 804

22.4.1 Construction of 36◦, 54◦, and 72◦ angles . . . . . 80422.4.2 Odom’s construction . . . . . . . . . . . . . . . 80422.4.3 ϕ and arctan 2 . . . . . . . . . . . . . . . . . . 805

23 Construction of regular polygons 80723.1 The regular hexagon . . . . . . . . . . . . . . . . . . . 80723.2 The regular octagon . . . . . . . . . . . . . . . . . . . 80823.3 The regular dodecagon . . . . . . . . . . . . . . . . . 80923.4 Construction of a regular 15-gon . . . . . . . . . . . . 81023.5 Construction of a regular 17-gon . . . . . . . . . . . . 811

24 Hofstetter’s constructions on the golden section 81324.1 A simple construction of the golden section . . . . . . 81324.2 A 5-step division of a segment in the golden section . . 81524.3 Another 5-step division of a segment in the golden sec-

tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816

Page 7: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

CONTENTS vii

24.4 Divison of a segment in the golden sectionwith ruler and rusty compass . . . . . . . . . . . . . . 818

24.5 A 4-step construction of the golden ratio . . . . . . . . 820

25 Prime and perfect numbers 90125.1 Infinitude of prime numbers . . . . . . . . . . . . . . . 901

25.1.1 Euclid’s proof . . . . . . . . . . . . . . . . . . . 90125.1.2 Fermat numbers . . . . . . . . . . . . . . . . . 90125.1.3 Fibonacci numbers . . . . . . . . . . . . . . . . 902

25.2 The prime numbers below 20000 . . . . . . . . . . . . 90225.3 Primes in arithmetic progression . . . . . . . . . . . . 90325.4 The prime number spirals . . . . . . . . . . . . . . . . 903

25.4.1 The prime number spiral beginning with 17 . . . 90425.4.2 The prime number spiral beginning with 41 . . . 905

25.5 Perfect numbers . . . . . . . . . . . . . . . . . . . . . 90725.6 Charles Twigg on the first 10 perfect numbers . . . . . 90825.7 Mersenne primes . . . . . . . . . . . . . . . . . . . . . 909

26 Digit problems 91126.1 Some intriguing division problems . . . . . . . . . . . 911

26.1.1 Problem E1 of the MONTHLY . . . . . . . . . . 91126.1.2 Problem E10 of the MONTHLY . . . . . . . . . . 912

26.2 Problem E1111 of the MONTHLY . . . . . . . . . . . . 91326.3 k-right-transposable integers . . . . . . . . . . . . . . 91426.4 k-left-transposable integers . . . . . . . . . . . . . . . 914

27 The repunits 91727.1 Recurring decimals . . . . . . . . . . . . . . . . . . . 91727.2 The period length of a prime . . . . . . . . . . . . . . 918

27.2.1 Decimal expansions of 1pn . . . . . . . . . . . . 919

28 Routh and Ceva theorems 100128.1 A worked example on homogeneous barycentric coor-

dinates . . . . . . . . . . . . . . . . . . . . . . . . . . 100128.2 Routh theorem . . . . . . . . . . . . . . . . . . . . . . 100228.3 Ceva Theorem . . . . . . . . . . . . . . . . . . . . . . 1003

29 Equilateral triangle in a rectangle 100529.1 Equilateral triangle inscribed in a rectangle . . . . . . . 1005

Page 8: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

viii CONTENTS

29.2 Construction of equilateral triangle inscribed in a rect-angle . . . . . . . . . . . . . . . . . . . . . . . . . . . 1006

30 The shoemaker’s knife 100730.1 Archimedes’ twin circles . . . . . . . . . . . . . . . . 100730.2 Incircle of the shoemaker’s knife . . . . . . . . . . . . 1008

30.2.1 Archimedes’ construction . . . . . . . . . . . . 100830.2.2 Bankoff’s constructions . . . . . . . . . . . . . 100930.2.3 Woo’s three constructions . . . . . . . . . . . . 1010

30.3 More Archimedean circles . . . . . . . . . . . . . . . . 1010

31 Permutations 110131.1 The universal sequence of permutations . . . . . . . . . 110131.2 The position of a permutation in the universal sequence 1102

32 Cycle decompositions 110532.1 The disjoint cycle decomposition of a permutation . . . 110532.2 Dudeney’s puzzle . . . . . . . . . . . . . . . . . . . . 110632.3 Dudeney’s Canterbury puzzle 3 . . . . . . . . . . . . . 1107

33 More card Games 110933.1 Perfect shuffles . . . . . . . . . . . . . . . . . . . . . . 1109

33.1.1 In-shuffles . . . . . . . . . . . . . . . . . . . . 111033.1.2 Out-shuffles . . . . . . . . . . . . . . . . . . . . 1111

33.2 Monge’s shuffle . . . . . . . . . . . . . . . . . . . . . 1113

34 Figurate numbers 120134.1 Triangular numbers . . . . . . . . . . . . . . . . . . . 1201

34.1.1 Palindromic triangular numbers . . . . . . . . . 120134.2 Pentagonal numbers . . . . . . . . . . . . . . . . . . . 1202

34.2.1 Palindromic pentagonal numbers . . . . . . . . . 120234.3 The polygonal numbers Pk,n . . . . . . . . . . . . . . . 120234.4 Sums of powers of consecutive integes . . . . . . . . . 1203

35 Sums of consecutive squares 120535.1 The odd number case . . . . . . . . . . . . . . . . . . 120535.2 The even number case . . . . . . . . . . . . . . . . . . 1207

Page 9: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

CONTENTS ix

36 Polygonal triples 120936.1 Double ruling of S . . . . . . . . . . . . . . . . . . . . 121036.2 Primitive Pythagorean triple associated with a k-gonal

triple . . . . . . . . . . . . . . . . . . . . . . . . . . . 121136.3 Triples of triangular numbers . . . . . . . . . . . . . . 121136.4 k-gonal triples determined by a Pythagorean triple . . . 121236.5 Correspondence between (2h + 1)-gonal and 4h-gonal

triples . . . . . . . . . . . . . . . . . . . . . . . . . . 1214

Page 10: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University
Page 11: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 1

The Nim game

1.1 Euclidean algorithm

The euclidean algorithm is the basis of everything in arithmetic. Givenintegers a and b > 0, there are unique integers q and r so that

a = bq + r, 0 ≤ r < b.

The integer q is the quotient of the division of a by b, and r is theremainder. The quotient is sometimes written as � a

b�. It is the floor

of ab. More generally, the ceiling and the floor of a real number α are

defined as follows.

�x� := max{n ∈ Z : n ≥ x},�x� := min{n ∈ Z : n ≤ x}.

1.2 Binary representation of a number

Given an integer n (in decimal form), to rewrite it in a different base b,keeping on dividing the number by 2, and record the remainders, whichare 0 or 1, from right to left. The resulting sequence, which alwaysbegins with a nonzero leftmost digit, is the binary representation of n.

Page 12: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

102 The Nim game

Example 1.1. 123 = [1111011]2

divisor quotient remainder2 123 1

61 130 015 17 13 11

The binary representation of a number expresses the number as a sumof distinct powers of 2.

Example 1.2. 145 = 128 + 16 + 1 = [10010001]2.

1.2.1 A number from its binary representation

Given the binary representation of an integer:

n = [a0a1 · · ·ak−1ak]2,

to find the integer in its decimal form, calculate a sequence of numbersn0, n1, . . . , nk as follows:(i) n0 = a0,(ii) for i = 1, 2, . . . , k, ni = ai + 2 · ni−1.

Then, n = nk.

Example 1.3. [1111011]2 = 123.

1 1 1 1 0 1 12 2 6 14 30 60 122

1 3 7 15 30 61 123

1.3 The nim sum

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

0 � 0 = 0, 0 � 1 = 1 � 0 = 1, 1 � 1 = 0,

Page 13: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1.4 The game Nim 103

then in terms of the binary representations of a and b,

a � b =[a1a2 · · ·an]2 � [b1b2 · · · bn]2

=[(a1 � b1)(a2 � b2) · · · (an � bn)]2.

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

Example 1.4. 123�145 = [1111011]2 � [10010001]2 = [11101010]2 =234.

Here are the nim sums of numbers ≤ 7:

� 0 1 2 3 4 5 6 70 0 1 2 3 4 5 6 71 1 0 3 2 5 4 7 62 2 3 0 1 6 7 4 53 3 2 1 0 7 6 5 44 4 5 6 7 0 1 2 35 5 4 7 6 1 0 3 26 6 7 4 5 2 3 0 17 7 6 5 4 3 2 1 0

1.4 The game Nim

Given three piles of marbles, with a, b, c marbles respectively, playersA and B alternately remove a positive amount of marbles from any pile.The player who makes the last move wins.

Theorem 1.1. In the game nim, the player who can balance the nim sumequation has a winning strategy.

Therefore, provided that the initial position (a, b, c) does not satisfya � 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 firstplayer can remove 2 marbles from the second pile to maintain a balanceof the nim sum equation,

12 � 5 � 9 = 0

thereby securing a winning position.

This theorem indeed generalizes to an arbitrary number of piles.

Page 14: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

104 The Nim game

Page 15: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 2

The Josephus problem and itsgeneralization

2.1 The Josephus problem

There are n people forming a circle. In succession, every second personis escorted out from the circle, and the last one is awarded a prize. Whois the prize winner?

Examples

(1) n = 10:

1

2

34

5

6

7

8 9

10

8

1

62

*

3

7

4 9

5

(2) n = 21. After the removal of the 10 even numbered ones and then

Page 16: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

106 The Josephus problem and its generalization

the first, there are the 10 odd numbers 3, 5, . . . , 19, 21. The survivor isthe 5-th of this list, which is 11.

Theorem 2.1. Let J(n) be the “prize winner” in the Josephus problemfor n people.

J(2n) =2J(n) − 1,

J(2n + 1) =2J(n) + 1.

Example 2.1.

J(100) =2J(50) − 1

=2(2J(25) − 1) − 1 = 4J(25) − 3

=4(2J(12) + 1) − 3 = 8J(12) + 1

=8(2J(6) − 1) + 1 = 16J(6) − 7

=16(2J(3) − 1) − 7 = 32J(3) − 23

=32(2J(1) + 1) − 23 = 64J(1) + 9

=73.

There is an almost explicit expression for J(n): if 2m is the largestpower of 2 ≤ n, then

J(n) = 2(n − 2m) + 1.

Corollary 2.2. The binary expansion of J(n) is obtained by transferringthe leftmost digit 1 of the binary expansion of n to the rightmost.

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

Exercise

1. For what values of n is J(n) = n?

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

Page 17: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

2.2 The generalized Josephus problem J(n, k) 107

2.2 The generalized Josephus problem J(n, k)

The generalized Josephus problem J(n, k) asks for the “prize winner”J(n, k) when beginning with 1, every k-th member (counting cyclically)is escorted out from the circle originally formed by n people.

Example 2.2. J(10, 3): J(10, 3) = 4.

1

2

34

5

6

7

8 9

10

6

4

1*

8

2

5

7 3

9

For n = 10, here are the sequences of elimination depending on thevalues of k. The last column gives the prize winners.

k J(10, k)1 1 2 3 4 5 6 7 8 9 102 2 4 6 8 10 3 7 1 9 53 3 6 9 2 7 1 8 5 10 44 4 8 2 7 3 10 9 1 6 55 5 10 6 2 9 8 1 4 7 36 6 2 9 7 5 8 1 10 4 37 7 4 2 1 3 6 10 5 8 98 8 6 5 7 10 3 2 9 4 19 9 8 10 2 5 3 4 1 6 710 10 1 3 6 2 9 5 7 4 8

Positions 2 and 6 are no-luck positions for the Josephus problem of10 people and random choice of k.

Page 18: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

108 The Josephus problem and its generalization

Exercise

1. Make a list of the no-luck positions of the Josephus problem forn = 4, 5, . . . , 9.

2. For n = 7, there is only one no-luck position 1. This means thatone other position is most likely to receive a prize? Which one isit?

Page 19: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 3

Representation of a number indifferent bases

3.1 Base b-representation of a number

Let b be a fixed positive integer. To write an integer n (in decimal form)in base b, keep on dividing the number by b, and record the remainders,which are integers between 0 and b − 1, from right to left. The result-ing sequence, which always begins with a nonzero leftmost digit, is therepresentation of n in base b.

Examples

(1) 123 = [1111011]2

divisor quotient remainder2 123 1

61 130 015 17 13 11

Page 20: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

110 Representation of a number in different bases

(2) 123 = [11120]3

divisor quotient remainder3 123 0

41 213 14 11

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 numbersn0, n1, . . . , nk as follows:(i) n0 = a0,(ii) for i = 1, 2, . . . , k, ni = ai + b · ni−1.

Then, n = nk.

Examples

(1) [1111011]2 = 123.

1 1 1 1 0 1 12 2 6 14 30 60 122

1 3 7 15 30 61 123

(2) [23147]11 = 33447.

2 3 1 4 711 22 275 3036 33440

2 25 276 3040 33447

Page 21: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

3.2 Balanced division by an odd number 111

Exercise

1. Complete the multiplication table in base 7.

1 2 3 4 5 6

1 1 2 3 4 5 62 23 3 124 45 56 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 nonnegativeinteger coefficients. Ask her for the value of f(1). She returns7. Ask her for the value of f(8). She returns 4305. What is thepolynomial?

3.2 Balanced division by an odd number

Given a positive integer b and a string of b consecutive integers, for everyinteger 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 ofremainders to be

−c, −(c − 1), . . . , −1, 0, 1, . . . , c − 1, c.

Page 22: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

112 Representation of a number in different bases

If we writea = bq + r, −c ≤ r ≤ c,

we say that this is the balanced division of a by the odd number b.

3.3 Balanced base b representation of a number

Let b be a positive odd number. The balanced base b representation ofan integer n is obtained by repeatedly performing balanced divisions byb and recording, from right to left, the remainders, which are integers inthe range − b−1

2, · · · ,−1, 0, 1, . . . , b−1

2.

We shall write�, �, �, �, . . .

in place of the negative remainders

−1, −2, −3, −4, . . . .

Examples

(1) 123 = 〈1����0〉3

divisor quotient remainder3 123 0

41 �

14 �

5 �

2 �

1

The balanced ternary form of a number expresses it as a sum and/ordifferences of distinct powers of 3:

123 = 35 − 34 − 33 − 32 − 3.

(2) 〈1��〉5 = 52 + (−2) · 5 + (−3) = 12.

Page 23: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

3.4 Arithmetic in balanced base 3 representations 113

3.4 Arithmetic in balanced base 3 representations

+ � 0 1� �1 � 00 � 0 11 0 1 1�

× � 0 1� 1 0 �

0 0 0 01 � 0 1

Example 3.1. 〈1���1〉3 × 〈11�1〉3 = 〈1�000011〉3.1 � � � 1

× 1 1 � 11 � � � 1

� 1 1 1 �

1 � � � 11 � � � 11 � 0 0 0 0 1 1

Page 24: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 4

A card trick

Let p and q be given odd numbers, say p = 2h + 1 and q = 2k + 1.Arrange pq cards in the form of a p× q matrix. Ask a spectator to selectone secret card and name the column containing the secret card. Thenthe cards are(i) picked up along columns in any order, except that the named one isthe middle one, being preceded by k arbitrary columns and followed bythe remaining k columns arbitrarily,(ii) rearranged into the p × q matrix along rows.

Repeat a number of times, each time asking for the column whichcontains the secret card. The secret card will eventually appear exactlyin the middle of the matrix.

If p ≤ q, you can tell what the secret is after the first step. It is in themiddle row.

We shall henceforth assume p > q so that there are more rows thancolumns.

Example 4.1. In the arrangement below, the spectator chooses ♦2 andtells 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 thirdcolumns, and deal the cards in rows:

Page 25: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

202 A card trick

♣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. Shewill answer the first column. Then you pick up, in order, the third, thefirst, and the second column, and deal the cards in rows:

♥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 thirdcolumn. You immediately know that the card is ♦2.

How many times do you need to rearrange the cards before you cantell what the secret card is? This is what G. R. Sanchis [?]1 shows. Weanalyze this in a somewhat different notation.

Label the rows −h, −(h − 1), . . . , 0, . . . , h − 1, h so that the middlerow is row 0. An application of (i) and (ii) will bring the i-th card inthe column containing the secret card into row g(i), where g(i) is thequotient 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, ifg(i) = 0, then all subsequent iterates by g are stationary at 0. Therefore,if we write p = 2 + 1, then the number of times to guarantee the secretcard in the middle row is

min{� : g�(h) = 0}.

The function g on positive integers can be easily described in termsof the base q representations of numbers.

1G. R. Sanchis, A card trick and the mathematics behind it, College Math. Journal, 37 (2006) 103–109.

Page 26: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

203

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 tothe middle row is not more than the length of the balanced base q-representation of the integer p−1

2.

Examples

(1) 51 cards in 3 columns: p = 17, q = 3. Since 8 = 〈10�〉3, threeoperations suffice.

(2) 35 cards in 5 columns: p = 7, q = 5. Since 3 = 〈1�〉5, twooperations suffice.

Exercise

Find the number of operations required to move the secret card to themiddle row for

1. 45 cards in 5 columns;

2. 39 cards in three columns.

Page 27: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

204 A card trick

Page 28: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 5

Cheney’s card trick

You are the magician’s assistant. What he will do is to ask a spectator togive 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 coursedepends on you, and you have to do things properly by making use ofthe 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 themagician 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 whichto 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. Fromone of these, going clockwise, you get to the other by traveling this dis-tance on the 13-hour clock. Keep the latter as the secret card.

Page 29: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

206 Cheney’s card trick

hours distance clockwise2 and 7 5 2 to 7

3 and 10 6 10 to 32 and J 4 J to 2A and 8 6 8 to A

The following diagram shows that the distance between ♣3 and ♥10is 6, not 7.

♣3

♣2

♦A♠K♣Q

♥J

♥10

♦9

♣8

♦7 ♣6♥5

♦4

6

5.1.3 Permutations of three objects

There are 6 arrangements of three objects The remaining three cardscan be ordered as small, medium, and large. 1 Now rearrange themproperly to tell the magician what number he should add (clockwise) tothe first card to get the number on the secret card. Let’s agree on this:

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

If you, the assistant, want to tell the magician that he should add 4 tothe number (clockwise) on the first card, deal the medium as the secondcard, 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: ♣ < ♦ < ♥ < ♠.

Page 30: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

5.1 Three basic principles 207

Example 5.1. Suppose you have ♠5, ♣7, ♦J, ♣4, and ♠Q, and youdecide to use the ♣ cards for the first and the secret ones. The distancebetween ♣7 and ♣4 is of course 3, clockwise from ♣4 to ♣7. Youtherefore show ♣4 as the first card, and arrange the other three cards,♠5, ♦J, and ♠Q, in the order medium, small, large. The second cardis ♦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 youthese four cards in order:

Q♠ J

♦ 7♣ 4

♣ ??

Then you know that the secret card is a ♠, and you get the number byadding 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.

Page 31: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

208 Cheney’s card trick

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

5♠ 7

♠ 6♦ 5

♣ ??

2♥ J

♠ 2♣ 8

♠ ??

Page 32: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 6

Coin weighing

6.1 Coin weighing with 3 standard weights

Given three weights of 1, 3, and 9 units, it is possible to weigh up to 13units in a beam balance.

Left Right Left Right1 1 2, 1 33 3 4 1, 3

5, 1, 3 9 6, 3 97, 3 1, 9 8, 1 9

9 9 10 1, 911, 1 3, 9 12 3, 9

13 1, 3, 9

6.2 A twelve coin problem

Given twelve coins, one of which is defective, how can the defectivecoin be found out in three weighings in a beam balance, and be decidedas overweight or underweight? 1

1H. D. Grossman, Ternary epitaph on coin problems, Scripta Math., 14 (1948) 69–71.

Page 33: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

210 Coin weighing

+1 −1 +3 −3 +9 −9

1 2 2 3 6 55 4 5 4 8 710 7 7 6 10 911 8 12 11 12 11

Tell your temptor that if you touch the coins you will certainly know.You, the magician, do not even have to look at them to find out the falseone. Tell him to label the coins arbitrarily 1, 2, . . . , 12, and follow yourinstructions.

Start with a number W = 0.

(1) Put coins 1, 5, 10, 11 on the left pan and coins 2, 4, 7, 8 on theright pan, and tell which side is heavier.

If the left pan is heavier, add 1 to W .If the right pan is heavier, add −1 to W .If they balance, keep the same W .

(2) Put coins 2, 5, 7, 12 on the left pan and coins 3, 4, 6, 11 on theright pan, and tell which side is heavier.

If the left pan is heavier, add 3 to W .If the right pan is heavier, add −3 to W .If they balance, keep the same W .

(3) Put coins 6, 8, 10, 12 on the left pan and coins 5, 7, 9, 11 on theright pan, and tell which side is heavier.

If the left pan is heavier, add 9 to W .If the right pan is heavier, add −9 to W .If they balance, keep the same W .

Now, the numerical value of W is the label of the false coin.

W positive negativeeven overweight underweightodd underweight overweight

Page 34: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 7

Greatest common divisor

7.1 gcd(a, b) from the Euclidean algorithm

It is well known that the gcd of two (positive) integers a and b can becalculated efficiently by repeated divisions. Assume a > b. We formtwo sequences rk and qk as follows. Beginning with r−1 = a and r0 = b,for k ≥ 0, let

qk =

⌊rk−1

rk

⌋, rk+1 = mod(rk−1, rk) := rk−1 − qkrk.

These divisions eventually terminate when some rn divides rn−1. In thatcase, gcd(a, b) = rn.

Examples

(1) The repunit Rn is the numbers whose decimal representation con-sists of n ones: Rn = 1n.

gcd(Rm, Rn) = Rgcd(m,n).

This is easily explained by two parallel sequences of divisions:

m = qn + r,n = q′r + s,

...

Rm = Q · Rn + Rr,Rn = Q′ · Rr + Rs,

...

(2) gcd(2m − 1, 2n − 1) = 2gcd(m,n) − 1.

Page 35: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

302 Greatest common divisor

Proof. The binary expansion of 2m − 1 consists of m ones. Thus,

gcd(2m − 1, 2n − 1) = gcd([1m]2, [1n]2) = [1gcd(m,n)]2 = 2gcd(m,n) − 1.

7.1.1 gcd(a, b) as an integer combination of a and b

If, along with these divisions, we introduce two more sequences (xk)and (yk) with the same rule but specific initial values, namely,

xk+1 =xk−1 − qkxk, x−1 = 1, x0 = 0;

yk+1 =yk−1 − qkyk, y−1 = 0, y0 = 1.

then we obtain gcd(a, b) as an integer combination of a and b: 1

gcd(a, b) = rn = axn + byn.

k rk qk xk yk

−1 a ∗ ∗ ∗ 1 00 b �a

b� 0 1

1 a − �ab�b � b

r1� x1 y1

...n − 1 rn−1 qn−1 xn−1 yn−1

n rn qn xn yn

n + 1 0

It can be proved that |xn| < b and |yn| < a.

Theorem 7.1. Given relatively prime integers a > b, there are uniqueintegers h, k < a such that ak − bh = 1.

Corollary 7.2. Let p be a prime number. For every integer a not divisibleby p, there exists a positive integer b < p such that ab − 1 is divisible byp.

7.2 gcd(a, b) by counting interior points of a lattice tri-angle

A lattice triangle has vertices at (0, 0), (a, 0), and (a, b).1In each of these steps, rk = axk + byk .

Page 36: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

7.2 gcd(a, b) by counting interior points of a lattice triangle 303

a

b

a

Counting in two ways, we obtain as

a−1∑n=1

⌊nb

a

⌋=

b−1∑m=1

⌊ma

b

⌋.

Note that each of these is the total number of interior points and those onthe hypotenuse (except the two vertices). There are gcd(a, b) − 1 pointsin the latter group.

If we put these two copies together to form a rectangle, we see that theinterior points along the diagonal are counted twice. Since the rectanglehas (a − 1)(b − 1) interior points, we have exactly

(a − 1)(b − 1) − gcd(a, b) + 1

2

lattice points in the interior of the triangle.

a

b

In particular, if gcd(a, b) = 1, then the triangle has 12(a − 1)(b − 1)

interior points.

7.2.1 Calculation of gcd

Note that we have an algorithm for computing the gcd of two integers:

gcd(a, b) = 2

b−1∑m=1

⌊ma

b

⌋− (a − 1)(b − 1) + 1.

Page 37: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

304 Greatest common divisor

7.3 Fibonacci numbers

The Fibonacci numbers Fn are defined recursively by

Fn+1 = Fn + Fn−1, F0 = 0, F1 = 1.

The first few Fibonacci numbers are

n 0 1 2 3 4 5 6 7 8 9 10 11 12 . . .Fn 0 1 1 2 3 5 8 13 21 34 55 89 144 . . .

It is easy to see that consecutive Fibonacci numbers are relatively prime.

gcd(Fn+1, Fn) = gcd(Fn, Fn−1)

= gcd(Fn−1, Fn−2)

...

=gcd(F2, F1) = 1.

If we follow the Euclidean algorithm to compute gcd(Fn+1, Fn), weobtain the Cassini formula

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

k rk qk xk yk

−1 Fn+1 ∗ ∗ ∗ 1 00 Fn 1 0 11 Fn−1 1 F1 −F2

2 Fn−2 1 −F2 F3

3 Fn−3 1 F3 −F4...

n − 3 F3 1 (−1)n−2Fn−3 (−1)n−1Fn−2

n − 2 F2 1 (−1)n−1Fn−2 (−1)nFn−1

n − 1 F1 1 (−1)nFn−1 (−1)n+1Fn

n 0 ∗ ∗ ∗

Page 38: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

7.3 Fibonacci numbers 305

Exercise

Find the gcd of the following pairs of numbers by completing the sec-ond column of each table. In each case, express the gcd as an integercombination of the given numbers by completing the last two columns.

1.

rk qk xk yk

54321 ∗ ∗ ∗ 1 012345 0 1

2.

rk qk xk yk

267914296 ∗ ∗ ∗ 1 0196418 0 1

Page 39: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

306 Greatest common divisor

Page 40: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 8

Lattice polygons

8.1 Pick’s Theorem: area of lattice polygon

A lattice point is a point with integer coordinates. A lattice polygon isone whose vertices are lattice points (and whose sides are straight linesegments). For a lattice polygon, letI = the number of interior points, andB = the number of boundary points.

Theorem 8.1 (Pick). The area of a lattice polygon is I + B2− 1.

If the polygon is a triangle, there is a simple formula to find its areain terms of the coordinates of its vertices. If the vertices are at the points

Page 41: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

308 Lattice polygons

(x1, y1), (x2, y2), (x3, y3), then the area is 1

1

2

∣∣∣∣∣∣x1 y1 1x2 y2 1x3 y3 1

∣∣∣∣∣∣ .

In particular, if one of the vertices is at the origin (0, 0), and the othertwo have coordinates (x1, y1), (x2, y2), then the area is 1

2|x1y2 − x2y1|.

Given a lattice polygon, we can partition it into primitive lattice tri-angles, i.e., each triangle contains no lattice point apart from its threevertices. Two wonderful things happen that make it easy to find the areaof the polygon as given by Pick’s theorem.

(1) There are exactly 2I + B − 2 such primitive lattice triangles nomatter how the lattice points are joined. This is an application of Euler’spolyhedral formula.

(2) The area of a primitive lattice triangle is always 12. This follows

from a study of the Farey sequences.

8.2 Counting primitive triangles

We shall make use of the famous Euler polyhedron formula.

Theorem 8.2. If a closed polyhedron has V vertices, E edges and Ffaces, then V − E + F = 2.

8.2.1 The number of primitive triangles in a lattice polygon

Given a lattice polygon with a partition into primitive lattice triangles,we take two identical copies and glue them along their common bound-ary. Imagine the 2-sheet polygon blown into a closed polyhedron. Thenumber of vertices is V = 2I + B. Suppose there are T primitive tri-angles in each sheet. Then there are F = 2T faces of the polyhedron.Since every face is a triangle, and each edge is contained in exactly twofaces, we have 2E = 3F . It follows that E = 3T . Now, Euler’s poly-hedron formula gives (2I + B) − 3T + 2T = 2. From this, we haveT = 2I + B − 2.

1This formula is valid for arbitrary vertices. It is positive if the vertices are traversed counterclockwise,otherwise negative. If it is zero, then the points are collinear.

Page 42: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

8.2 Counting primitive triangles 309

Exercise

1. Consider the lattice triangle ABC with A = (0, 0), B = (36, 15)and C = (16, 30). Calculate the lengths of the sides of the triangle.What is the area of the triangle? How many boundary and interiorpoints does it have?

2. Repeat the same for the lattice triangle ABC with A = (0, 0), B =(24, 45) and C = (48, 55).

3. Give an example of a lattice triangle whose side lengths are 13, 14,15. What is the area? How many interior and boundary points doesthe triangle have?

4. For B = 3, 4, 6, 8, 9, give an example of a lattice triangle withexactly one interior point and B boundary points. 2

5. Give an example of an equilateral lattice hexagon.

2In [Weaver], it is shown that these are the only possible values of B if I = 1.

Page 43: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

310 Lattice polygons

Page 44: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 9

The Farey sequences

9.1 The Farey sequence

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

1and 1 = 1

1.

F1 : 01, 1

1.

F2 : 01, 1

2, 1

1.

F3 : 01, 1

3, 1

2, 2

3, 1

1.

F4 : 01, 1

4, 1

3, 1

2, 2

3, 3

4, 1

1.

F5 : 01, 1

5, 1

4, 1

3, 2

5, 1

2, 3

5, 2

3, 3

4, 4

5, 1

1.

F6 : 01, 1

6, 1

5, 1

4, 1

3, 2

5, 1

2, 3

5, 2

3, 3

4, 4

5, 5

6, 1

1.

F7 : 01, 1

7, 1

6, 1

5, 1

4, 2

7, 1

3, 2

5, 3

7, 1

2, 4

7, 3

5, 2

3, 5

7, 3

4, 4

5, 5

6, 6

7, 1

1.

Theorem 9.1. 1. If hk

and h′k′ are successive terms of Fn, then

kh′ − hk′ = 1 and k + k′ > n.

2. If hk

, h′k′ , and h′′

k′′ are three successive terms of Fn, then

h′

k′ =h + h′′

k + k′′ .

Page 45: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

312 The Farey sequences

The rational numbers in [0, 1] can be represented by lattice points inthe first quadrant (below the line y = x). Restricting to the left sideof the vertical line x = n, we can record the successive terms of theFarey sequence Fn by rotating a ruler about 0 counterclockwise from thepositive x-axis. The sequence of “visible” lattice points swept throughcorresponds to Fn. If P and Q are two lattice points such that triangleOPQ contains no other lattice points in its interior or boundary, then therational numbers corresponding to P and Q are successive terms in aFarey sequence (of order ≤ their denominators).

9.2 Primitive lattice triangles

A lattice triangle is one whose vertices are lattice points, i.e., points withinteger coordinates. It is primitive if there are no lattice point inside oron the triangle except these vertices.

Theorem 9.2. A primitive lattice triangle has area 12.

Page 46: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 10

Irrationality of√

n

10.1 Irrationality of√

2

Suppose√

2 is a rational number. We write it in lowest terms as ab. Here,

a and b are positive integers without common divisor. Then

a2 = 2b2.

10.1.1 Reasoning with units digits

Examine the units digits of the numbers a2 and 2b2. Now, the units digitof a square is one of 0, 1, 4, 5, 6, or 9.

The units digit of 2b2 must be one of 0, 2, 8. Therefore, if a2 = 2b2,its units digit must be 0. This means that(i) the units digit of a must be 0, and a is divisible by 10, and(ii) the units digit of 2b2 being 0, that of b must be 0 or 5. This meansthat b must be divisible by 5.

This is a contradiction since a and b are both divisible by 5.

10.1.2 Reasoning with even and odd

If a2 = 2b2, then a2 is even, and a must be even. If we write a = 2c,then 2b2 = a2 = 4c2 and b2 = 2c2. The same reasoning shows that b isalso even, a contradiction.

Page 47: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

402 Irrationality of√

n

10.1.3 Reasoning in a base 3

a2 = 2b2 cannot have a nonzero solution in integers because the lastnonzero digit of a square, written in base 3, must be 1, whereas the lastnonzero digit of twice a square is 2.

10.1.4 Geometric proof

If√

2 were rational, there are smallest positive integers a and b so that asquare of side a has the same area as two squares of side b. The diagrambelow shows two squares of side b inside a square of side a. The overlapof the yellow square has the same area as the two white squares in thecorner. This then is a smaller square of integer side 2b−a which has thesame area as two squares of side a − b. This contradicts the minimalityof a and b.

10.2 Irrationality of√

n

10.2.1 N. J. Fine’s proof

Suppose√

n = xy, with x, y positive integers, x smallest possible. Since√

n is not an integer, there is an integer k such that k − 1 < xy

< k.Define

x′ =

(k − x

y

)x, y′ =

(k − x

y

)y.

Then x′y′ = x

y=

√n. Moreover, x′kx − x2

y− kx − ny, and y = ky − x

are both integers, both positive. But k − xy

< 1, implying x′ < x. This

Page 48: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

10.3 Nonexistence of regular lattice polygon 403

contradicts the minimality of x and completes the proof.

10.2.2 P. Ungar’s proof

Lemma 10.1. A real number α is irrational if there are arbitrarly smallpositive numbers of the form m + nα for integers m and n.

Proof. If α = ab

for b > 0, then m + nα = cb

for some integer c. Itsdistance from 0 is at least 1

b.

Proposition 10.2. If d is not the square of an integer, then√

d is irra-tional.

Proof. The positive number α = d−�√d� is strictly smaller than 1. Forarbitrary ε > 0, there is an integer k such that αk = (d − �√d�)k < ε.Now, αn is a number of the form m + n

√d for integers m and n. It

follows that√

d is irrational.

10.3 Nonexistence of regular lattice polygon

Proposition 10.3. There is no equilateral lattice triangle.

Proof. If a lattice triangle is equilateral, with side length a, then a2 isan integer, and its area is given by 1

2a2 sin π

3= a2

4· √3, an irrational

number. This is a contradiction since the area of a lattice triangle mustbe rational.

Indeed, the same proof can be extended to show that there is no regu-lar lattice polygon of n ≥ 5 sides, by making use of the famous but deepresult that the only values of n for which sin π

nis rational is n = 6. We

present here a simple proof without invoking this nontrivial result on therationality of sin 2π

n, given by David Radcliffe of Purdue University.

Theorem 10.4. There is no regular lattice n-gon for n �= 4.

We shall assume n > 3. Suppose there is a regular lattice polygon Pwith vertices A1, A2, . . . , An and center O. Reflect each vertex about thediagonal joining its two neighbours. Thus,

A′i = Ai−1 + Ai+1 − Ai,

for i = 1, 2, . . . , n. Here, the indices are taken modulo n, so that An+1 =A1. See Figure 1. Note that for each i = 1, 2, . . . , n,

Page 49: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

404 Irrationality of√

n

(i) A′i is a lattice point on the line OAi;

(ii) it coincides with one of the vertices of P (other than Ai−1, Ai, Ai+1)if and only if n = 4;(iii) it coincides with O if and only if n = 6. See Figure 2.

O

Ai−1

Ai

Ai+1

A′i

(e) Figure 1

O

Ai−1

Ai

Ai+1

(f) Figure 2

Therefore, for n > 4, each A′i is a point in the interior of P, and

OA′1 = OA′

2 = · · · = OA′n.

It follows that A′1A

′2 · · ·A′

n is a smaller regular lattice polygon of nsides. For n �= 6, this has nonzero area which is an integer or a half-integer. This is a contradiction by infinite descent.

Page 50: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 11

Continued fractions

11.1 Simple continued fractions

A simple continued fraction is one of the form

a1 +1

a2 +1

a3 +1

. . . +1

an

or a1 +1

a2 +1

a3 +1

a4 +1

. . .

.

For typographical convenience, we shall write these continued frac-tions as

[a1, a2, . . . , an] or [a1, a2, a3, a4, . . . ].

11.2 Finite simple continued fractions

Finite continued fractions are rational numbers. Every rational num-ber p

qcan be uniquely represented as a finite simple continued fraction

[a1, a2, . . . , an] with a2, . . . , an positive, and an > 1. These are the

Page 51: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

406 Continued fractions

quotients in the sequence of divisions beginning with p1 = p, p2 = q,

p1 = a1 × p2 + p3, 0 < p3 < p2,p2 = a2 × p3 + p4, 0 < p4 < p3,

...pn−1 = an−1 × pn + pn+1, 0 < pn+1 < pn,

pn = an × pn+1.

The rational number pq

is equal to the finite simple continued fraction

[a1, a2, . . . , an]. The convergents Pk

Qkare such that Pn

Qn= p

q. Furthermore,

for k = 0, 1, . . . , n − 1,

PkQk+1 − Pk+1Qk = (−1)k.

11.3 Convergents

The convergents of an infinite (simple) continued fraction [a0, a1, a2, . . . ]are the finite continued fractions

cn = [a0, . . . , an]

for n = 0, 1, 2, . . . . Each of these is a rational number cn = Pn

Qn. These

numerators and denominators can be computed recursively as follows.

Pn =Pn−1 + anPn−1, P−1 = 0, P0 = 1;

Qn =Qn−2 + anQn−1, Q−1 = 1, Q0 = 0.

a1 a2 · · · an · · ·0 1 P1 P2 · · · Pn · · ·1 0 Q1 Q2 · · · Qn · · ·

Examples

(1) The simplest continued fraction [1, 1, 1 . . . ] has convergents Pn

Qngiven

by

Pn =Pn−1 + Pn−1, P−1 = 0, P0 = 1;

Qn =Qn−2 + Qn−1, Q−1 = 1, Q0 = 0.

Page 52: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

11.4 Continued fraction expansion of√

d 407

It is clear that Qn = Fn, and Pn = Fn+1 from the Fibonacci sequence(Fn). Thus,

[1, 1, 1, · · · ] = limn �� ∞

Fn+1

Fn

= ϕ,

the golden ratio.(2) The continued fraction [1, 2, 3, 4, . . . , n, . . . ] has convergents Pn

Qn

given by

n Pn QnPnQn

1 1 1 12 3 2 1.513 10 7 1.428571428571428571 · · ·4 43 30 1.433333333333333333 · · ·5 225 157 1.433121019108280254 · · ·6 1393 972 1.433127572016460905 · · ·7 9976 6961 1.433127424220657951 · · ·8 81201 56660 1.433127426756088951 · · ·9 740785 516901 1.433127426721944821 · · ·10 7489051 5225670 1.433127426722315033 · · ·11 83120346 57999271 1.433127426722311733 · · ·12 1004933203 701216922 1.433127426722311758 · · ·13 13147251985 9173819257 1.433127426722311758 · · ·14 185066460993 129134686520 1.433127426722311758 · · ·...

11.4 Continued fraction expansion of√

d

Let d be a positive, non-square integer, and√

d = [a0, a1, a2, . . . , al−2, al−1, al].

• a0 = �√d� and al = 2a0.

• The sequence a1, a2, . . . , al−2, al−1 is palindromic, i.e., ak = al−k

for each k = 1, 2, . . . , l − 1.

Page 53: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

408 Continued fractions

Continued fraction expansion of√

d for small d

√2∗ = [1, 2];

√3 = [1, 1, 2];√

5∗ = [2, 4];√

6 = [2, 2, 4];√7 = [2, 1, 1, 1, 4];

√8 = [2, 1, 4];√

10∗ = [3, 6];√

11 = [3, 3, 6];√12 = [3, 2, 6];

√13∗ = [3, 1, 1, 1, 1, 6];√

14 = [3, 1, 2, 1, 6];√

15 = [3, 1, 6];√17∗ = [4, 8];

√18 = [4, 4, 8];√

19 = [4, 2, 1, 3, 1, 2, 8];√

20 = [4, 2, 8];√21 = [4, 1, 1, 2, 1, 1, 8];

√22 = [4, 1, 2, 4, 2, 1, 8].

Those with ∗ have odd period lengths.

Page 54: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 12

The integer equationsx2 − dy2 = ±1

12.1 Integer solutions of x2 − dy2 = 1

Let d be a positive, non-square integer, and√

d = [a0, a1, a2, . . . , al−2, al−1, al].

All positive solutions of the Pell equation

x2 − dy2 = 1

form a sequence (xk, yk) which can be obtained recursively by 1

(xk+1

yk+1

)=

(a dbb a

) (xk

yk

),

(x1

y1

)=

(ab

),

where

(a, b) =

⎧⎪⎨⎪⎩

(Pl−1, Ql−1), if√

d has even period length,

(P2l−1, Q2l−1), if√

d has odd period length,

is the fundamental solution.

1These are also given by (xk, yk) = (Pkl−1, Qkl−1).

Page 55: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

410 The integer equations x2 − dy2 = ±1

Fundamental solution (a, b) of x2 − dy2 = 1 for small d

d a b d a b d a b2 3 2 3 2 1 5 9 46 5 2 7 8 3 8 3 110 19 6 11 10 3 12 7 213 649 180 14 15 4 15 4 117 33 8 18 17 4 19 170 3920 9 2 21 55 12 22 197 42

12.2 Integer solutions of x2 − dy2 = −1

The equation x2 − dy2 = −1 has integer solutions if and only if√

d hasodd period length. The solutions are given recursively(

xk+1

yk+1

)=

(a dbb a

)(xk

yk

),

(x1

y1

)=

(Pl−1

Ql−1

).

Smallest positive solution (a, b) of x2 − dy2 = −1

d a b d a b d a b2 1 1 5 2 1 10 3 113 18 5 17 4 1 26 5 129 70 13 37 6 1 41 32 5

Page 56: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

12.3 The equation x2 − 2y2 = 1 411

12.3 The equation x2 − 2y2 = 1

The fundamental solution of the Pell equation x2−2y2 = 1 is (3, 2). Thisgenerates an infinite sequence of nonnegative solutions (xn, yn) definedby

xn+1 = 3xn + 4yn, yn+1 = 2xn + 3yn; x0 = 1, y0 = 0.

The beginning terms are

n 1 2 3 4 5 6 7 8 9 10 . . .xn 3 17 99 577 3363 19601 114243 665857 3880899 22619537 . . .yn 2 12 70 408 2378 13860 80782 470832 2744210 15994428 . . .

12.4 Applications

12.4.1 Triangular numbers which are squares

Suppose the k−th triangular number Tk = 12k(k + 1) is the square of n.

n2 = 12k(k + 1); 4k2 + 4k + 1 = 8n2 + 1; (2k + 1)2 − 8n2 = 1. The

smallest positive solution of the Pell equation x2 − 8y2 = 1 being (3, 1),we have the solutions (ki, ni) of the equation given by

2ki+1 + 1 = 3(2ki + 1) + 8ni,ni+1 = (2ki + 1) + 3ni, k0 = 1, n0 = 1.

This means

ki+1 = 3ki + 4ni + 1,ni+1 = 2ki + 3ni + 1, k0 = 1, n0 = 1.

The beginning values of k and n are as follows.

i 0 1 2 3 4 5 6 7 8 9 10 . . .ki 1 8 49 288 1681 9800 57121 332928 1940449 11309768 65918161 . . .ni 1 6 35 204 1189 6930 40391 235416 1372105 7997214 46611179 . . .

12.4.2 Pythagorean triangles with consecutive legs

Let x and x + 1 be the two shorter sides of a Pythagorean triangle, withhypotenuse y. Then y2 = x2 + (x + 1)2 = 2x2 + 2x + 1. From this,2y2 = (2x + 1)2 + 1. The equation With z = 2x + 1, this reduces to

Page 57: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

412 The integer equations x2 − dy2 = ±1

the Pell equation z2 − 2y2 = −1, which we know has solutions, withthe of this equations are (zn, yn) given recursively by smallest positiveone (1, 1), and the equation z2 − 2y2 = 1 has smallest positive solution(3, 2). It follows that the solutions are given recursively by

zn+1 = 3zn + 4yn,yn+1 = 2zn + 3yn, z0 = 1, y0 = 1.

If we write zn = 2xn + 1, these become

xn+1 = 3xn + 2yn + 1,yn+1 = 4xn + 3yn + 2, x0 = 0, y0 = 1.

The beginning values of xn and yn are as follows.

n 1 2 3 4 5 6 7 8 9 10 . . .xn 3 20 119 696 4059 23660 137903 803760 4684659 27304196 . . .yn 5 29 169 985 5741 33461 195025 1136689 6625109 38613965 . . .

12.4.3

Find all integers n so that the mean and the standard deviation of n con-secutive integers are both integers.

If the mean of n consecutive integers is an integer, n must be odd. Wemay therefore assume the numbers to be −m ,−(m − 1), . . . , −1, 0, 1,

. . . , m−1, m. The standard deviation of these number is√

13m(m + 1).

For this to be an integer, we must have 13m(m+1) = k2 for some integer

k. m2 = m = 3k2; n2 = (2m + 1)2 = 12k2 + 1. The smallest positivesolution of the Pell equation n2 − 12k2 = 1 being (7,2), the solutions ofthis equations are given by (ni, ki), where

ni+1 = 7ni + 24ki,ki+1 = 2ni + 7ki, n0 = 1, k0 = 0.

The beginning values of n and k arei 1 2 3 4 5 6 7 8 . . .

ni 7 97 1351 18817 262087 3650401 50843527 708158977 . . .ki 2 28 390 5432 75658 1053780 14677262 204427888 . . .

Page 58: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 13

Pythagorean triangles

13.1 Primitive Pythagorean triples

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

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

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

B

CA

m2 − n2

2mn

m2 +

n2

A Pythagorean triple (a, b, c) is primitive if a, b, c do not have acommon divisor (greater than 1). Every primitive Pythagorean tripleis constructed by choosing m, n to be relatively prime and of oppositeparity. Here are the smallest primitive Pythagorean triangles.

Page 59: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

502 Pythagorean triangles

m, n a, b, c m, n a, b, c m, n a, b, c

2, 1 4, 3, 5 3, 2 12, 5, 13 4, 1 8, 15, 174, 3 24, 7, 25 5, 2 20, 21, 29 5, 4 40, 9, 41

13.1.1 Rational angles

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

sin cos tan

A 2mnm2+n2

m2−n2

m2+n22mn

m2−n2

B m2−n2

m2+n22mn

m2+n2m2−n2

2mn

More basic than these is the fact that tan A2

and tan B2

are rational:

tanA

2=

n

m, tan

B

2=

m − n

m + n.

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

B

CA

I

m(m − n) (m − n)n

(m + n)n

(m − n)nm(m

−n)

(m+

n)n

r

r

Page 60: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

13.2 Pythagorean triangles with given sides 503

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

Theorem 13.1 (Fermat). The area of a Pythagorean triangle cannot bea square (number).

13.2 Pythagorean triangles with given sides

Proposition 13.2. Every integer≥ 3 is the length of a side of a Pythagoreantriangle.

Theorem 13.3. A positive integer n is the length of the hypotenuse ofa Pythagorean triangle if and only if it contains a prime divisor of theform 4k + 1.

Proof. (1) Every prime number of the form 4k+1 is a sum of two squaresin a unique way. In particular, a prime number of the form 4k + 1 is thehypotenuse of a unique Pythagorean triangle.

(2) If a number is a sum of two squares, it contains a prime divisor ofthe form 4k + 1.

13.3 Enumeration of primitive Pythagorean triangles

Given a positive integer r which contains k distinct odd prime divisors,there are exactly 2k primitive Pythagorean triangles with inradius r. Thisfollows from r = (m− n)n, in which m− n and n are relatively prime,and m − n must be odd. There are precisely 2k choices of m − n,each determining the pair (n, m) and hence the primitive Pythagoreantriangle.

Here is an enumeration of the primitive Pythagorean triangles withr ≤ 15:

Page 61: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

504 Pythagorean triangles

r (n, m) (a, b, c) r (n, m) (a, b, c)

1 (1, 2) (4, 3, 5) 2 (2, 3) (12, 5, 13)3 (1, 4) (8, 15, 17) 3 (3, 4) (24, 7, 25)4 (4, 5) (40, 9, 41) 5 (1, 6) (12, 35, 37)5 (5, 6) (60, 11, 61) 6 (2, 5) (20, 21, 29)6 (6, 7) (84, 13, 85) 7 (1, 8) (16, 63, 65)7 (7, 8) (112, 15, 113) 8 (8, 9) (144, 17, 145)9 (1, 10) (20, 99, 101) 9 (9, 10) (180, 19, 181)10 (2, 7) (28, 45, 53) 10 (10, 11) (220, 21, 221)11 (1, 12) (24, 143, 145) 11 (11, 12) (264, 23, 265)12 (4, 7) (56, 33, 65) 12 (12, 13) (312, 25, 313)13 (1, 14) (28, 195, 197) 13 (13, 14) (364, 27, 365)14 (2, 9) (36, 77, 85) 14 (14, 15) (420, 29, 421)15 (1, 16) (32, 255, 257) 15 (3, 8) (48, 55, 73)15 (5, 8) (80, 39, 89) 15 (15, 16) (480, 31, 481)

13.4 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 Pythagoreantriple (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 onesuch configuration consisting of(i) two Pythagorean triangles obtained by magnifying (a, b, c) a and btimes,(ii) a square of side ab.

The total number of matches is

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

Page 62: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

13.5 When are x2 − px ± q both factorable? 505

The smallest one is realized by taking (a, b, c) = (3, 4, 5). It requires108 matches.

How many matches are required in the next smallest configuration?

13.5 When are x2 − px ± q both factorable?

For integers p and q, the quadratic polynomials x2−px+q and x2−px−qboth factorable (over integers) if and only if p2−4q and p2 +4q are bothsquares. Thus, p and q are respectively the hypotenuse and area of aPythagorean triangle.

b a

b

a

q

p

b − a

b − aq

p

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 ares − c and −s. Here, s is the semiperimeter of the Pythagorean triangle.

Page 63: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

506 Pythagorean triangles

13.6 Dissection of a square into Pythagorean triangles

Here is the smallest square which can be dissected into three Pythagoreantriangles and one with integer sides and integer area.

360

360

255 105

224

136289

375424

Page 64: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 14

3-4-5 triangles in the square

Page 65: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

508 3-4-5 triangles in the square

Page 66: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 15

Dissections

15.1 The tangram

It is known that exactly 13 convex polygons can be formed from thetangram. 1 Show them. 2

Challenging problem

Show how to dissect a 3-4-5 triangle into 4 pieces that may be rearrangedinto a square. 3

1F. T. Wang and C. C. Hsiung, A theorem on the tangram, American Math. Monthly, 49 (1942) 596–599.2There are 1 triangle, 6 quadrilaterals, 2 pentagons, and 4 hexagons.3S. Rabinowitz, Problem 1299, Journal Recreational Math., 16 (1983–1984) 139.

Page 67: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

510 Dissections

15.2 Dissection of the square

15.2.1 Dissection of the square into 8 parts in arithmetic progres-sion

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

1. 5 cuts by. 4

2. 4 straight cuts. How should we choose the point A precisely?

A

B

3. 5 straight cuts. How should we choose the point B precisely?

15.2.2 Dissection of a square into 7 rectangles

Dissect a square into seven rectangles of different shapes but all havingthe same area. 5

4Problem 2565, Journal of Recreational Math., 30 (2002) 310.5Problem 2567, Journal of Recreational Math., . A dissection into seven rectangles was given by Hess

and Ibstedt. Markus Gotz showed that no solution with n rectangles exists for 2 ≤ n ≤ 6.

Page 68: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

15.2 Dissection of the square 511

R1

R2R3

R4

R6

R5

R7

Suppose each side of the square has length 7, and the rectangles havedimensions ai×bi for i = 1, 2, . . . , 7. Setting a1 = r, we compute easilyin succession, b1, b2, a2, a3, b3, b4, a4, a5, b5, using aibi = 7. Now,

a6 =7 − a2 − a3,

b6 =7 − b1 − b5,

a7 =7 − a2 − a3 − a5,

b7 =7 − b1 − b4 − b6.

rectangle ai bi

R1 r 7r

R2r

r−17(r−1)

r

R3 7 − r 77−r

R47−r6−r

7(6−r)7−r

R55(7r−7−r2)(6−r)(r−1)

7(6−r)(r−1)35(7r−7−r2

R6r(r−2)

r−17(r−1)(29r−35−4r2)

5r(7r−7−r2)

R7(7−r)(6−r)(28−27r+4r2)

5−r7(6−r)

5(7−r)(7r−7−r2)

The relations a6b6 = 7 and a7b7 = 7 both reduce to

(2r − 7)(2r2 − 14r + 15) = 0.

Page 69: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

512 Dissections

Since r = 72

or 7−√19

2would make a7, b7 negative, we must have r =

7+√

192

. The dimensions of the rectangles are as follows.

rectangle ai bi

R17+

√19

277−√

1915

R27(8+

√19)

158−√

193

R37(7+

√19)

157−√

192

R48+

√19

37(8−√

19)15

R553

215

R65(1+

√19)

67(−1+

√19)

15

R75(−1+

√19)

67(1+

√19)

15

Page 70: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 16

The classical triangle centers

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

16.1 The centroid

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

C

A

B

D

EF

G

The triangle DEF is called the medial triangle of ABC. It is theimage of ABC under the homothety h(G,− 1

2).

The lengths of the medians are given by Apollonius’ theorem:

m2a =

1

4(2b2 + 2c2 − a2),

etc.

Page 71: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

602 The classical triangle centers

16.2 The circumcircle

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

O

C

A

B

D

EF O

C

A

B

D

Theorem 16.1 (The law of sines). Let R denote the circumradius of atriangle ABC with sides a, b, c opposite to the angles A, B, C respec-tively.

a

sin A=

b

sin B=

c

sin C= 2R.

Since the area of a triangle is given by � = 12bc sin A, the circumra-

dius can be written as

R =abc

4� .

Page 72: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

16.3 The incenter and the incircle 603

16.3 The incenter and the incircle

The internal angle bisectors of a triangle are concurrent at the incenterof the triangle. This is the center of the incircle, the circle tangent to thethree sides of the triangle.

If the incircle touches the sides BC, CA and AB respectively at X ,Y , and Z,

AY = AZ = s− a, BX = BZ = s− b, CX = CY = s− c.

s − b

s − b

s − c

s − c

s − a

s − a

Z

X

Y

I

C

A

B

Denote by r the inradius of the triangle ABC.

r =2�

a + b + c=

�s

.

Page 73: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

604 The classical triangle centers

16.4 The orthocenter and the Euler line

The orthocenter H is the intersection of the three altitudes of triangleABC. These altitudes can be seen as the perpendicular bisectors of theantimedial triangle XY Z of ABC, which is bounded by the three lineseach passing through A, B, C parallel to their respective opposite sides.

O

C

A

B

X

Z

Y

H G

XY Z is the image of triangle ABC under the homothety h(G,−2).It follows that H is the image of O under the same homothety. Weconclude that O, G, and H are collinear, and OG : GH = 1 : 2.

The line containing O, G, H is the famous Euler line of triangleABC.

Page 74: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

16.5 The excenters and the excircles 605

16.5 The excenters and the excircles

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

Z

X

Y

Ic

Ib

Ia

C

A

B

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

ra =�

s − a, rb =

�s − b

, rc =�

s − c.

Page 75: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

606 The classical triangle centers

Page 76: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 17

Medians and angle bisectors

17.1 Stewart’s theorem

Let A, B, C be three collinear points, and P a point outside the linecontaining them. With signed distances of points on the line,

PA2 · BC + PB2 · CA + PC2 · AB + BC · CA · AB = 0.

A B C

P

17.2 The medians

Given a triangle with sides a, b, c, the triangle formed by the mediansma, mb. mc has medians 3a

4, 3b

4, 3c

4.

Theorem 17.1 (Apollonius). The lengths of the medians are given by

m2a =

1

4(2b2 + 2c2 − a2),

etc.

The triangle with sides 136, 170, 174 have integer medians ,, .

Page 77: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

608 Medians and angle bisectors

ma

A

B CD

C

A

BD

EF

G

K

17.3 The angle bisectors

The length of the internal bisector of angle A is

wa =2bc

b + ccos

A

2,

wa

w′a

PQ

A

B C

and that of the external bisector of angle A is

w′a =

2bc

|b − c| sinA

2.

Example 17.1. The triangle (a, b, c) = (125, 154, 169) is a Heron tri-angle with rational angle bisectors. Its area is 9240. The lengths of thebisectors are , , and .

The famous Steiner-Lehmus theorem asserts that a triangle is isosce-les if it has two equal internal angle bisectors. However, if two external

Page 78: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

17.4 The problem of three angle bisectors 609

bisectors have equal lengths, the triangle may not be isosceles. 1

17.4 The problem of three angle bisectors

The formula for the angle bisector wa can be rewritten, solely in termsof lengths, as

wa =2bc

b + c

√s(s − a)

bc.

It follows easily from this that

b + c =√

w2a + (s − b)2 +

√w2

a + (s − c)2.

Writingu = s − a, v = s − b, w = s − c,

we translate (ii) into

u =

√w2

a + v2 − v

2+

√w2

a + w2 − w

2. (17.1)

If we define f(u, v) :=√

u2+v2−u2

, 2 (17.1) becomes

x = f(y, wa) + f(z, wa).

Now given three numbers ua, wb, wc > 0, let

F (x, y, z) = (f(y, wa)+f(z, wa), f(z, wb)+f(x, wb), f(x, wc)+f(y, wc)).(17.2)

This mapping F happens to be a contraction mapping of a compactmetric space. It has a unique fixed point, which can be obtained byiterating from any triple of values of (x, y, z), say (0, 0, 0).

Theorem 17.2 (Mironescu and Panaitopol). Given three positive num-bers wa, wb, wc, there is a triangle whose angle bisectors has lengthswa, wb, wc. More precisely, if (u, v, w) is the fixed point of the mappingF , then (a, b, c) = (v + w, w + u, u + v).

1w′a = w′

c if and only if s−aa

, s−bb

, and s−cc

are in geometric progression.2Note that f(u, v) > 0 unless v = 0.

Page 79: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

610 Medians and angle bisectors

Examples

(1) With (wa, wb, wc) = (1, 2, 3), we obtain in 12 iterations, the fixedpoint (u, v, w) = (0.27804, 1.23595, 2.37174), which gives the triangle

(a, b, c) = (3.60769, 2.64978, 1.51399).

(2) With (wa, wb, wc) = (3, 4, 5), we obtain in 18 iterations, the fixedpoint (u, v, w) = (1.27985, 2.36338, 3.5242), which gives the triangle

(a, b, c) = (5.88757, 4.80405, 3.64322).

A few more examples:

(wa, wb, wc) steps (u, v, w) (a, b, c)

(1, 2, 4) 12 (0.259097, 1.15252, 3.37975) (4.53227, 3.63884, 1.41162)

(1, 3, 9) 11 (0.167698, 1.68573, 8.15232) (9.83805, 8.32002, 1.85343)

(2, 3, 4) 16 (0.75241, 1.7986, 2.95245) (4.75105, 3.70486, 2.55101)

(13, 14, 15) 22 (6.95846, 8.09993, 9.26214) (17.3621, 16.2206, 15.0584)

(1, ϕ, ϕ2) 12 (0.330632, 0.938517, 2.07543) (3.01394, 2.40606, 1.26915)

In the last example, ϕ =√

5+12

is the golden ratio.

Page 80: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 18

Isosceles triangles equal inperimeter and area

Isaac Newton 1 has given an elegant solution to the so-called Robervalproblem: To find two (rational) isosceles triangles which shall be equalin area and perimeter.

Let the triangles be ABC, DEF ; their bases AB = 2p,DE = 2x; their slant sides AC = q, DF = y. Thenp+q = x+y and p

√q2 − p2 = x

√y2 − x2, that is p2q2−p4 =

x2y2−x4. Divide by the equals p+ q and x+ y and there willbe p2q − p3 = x2y − y3. In place of y write p + q − x andthere follows

p2q − p3 = px2 + qx2 − 2x3 and so q =p3 + px2 − 2x3

p2 − x2.

Divide through by p − x and there comes q = p2+px+2x2

p+x.

Since this solution gives q in terms of p and x, it does not constructan isosceles triangle equal in perimeter and area to a given one. The lastexpression for q, however, can be construed as an equation in x:

2x2 − (q − p)x − p(q − p) = 0.

Since q > p, it is clear that this quadratic equation has exactly onepositive root given by

x =1

4

((q − p) +

√(q − p)(q + 7p)

). (18.1)

1D.T.Whiteside, The Mathematical Papers of Issac Newton, vol. IV, pp. 105 – 107, Cambridge UniversityPress, 1971.

Page 81: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

612 Isosceles triangles equal in perimeter and area

Note that this positive root is p if and only if q = 2p, i.e., the giventriangle is equilateral. On the other hand, since

√(q − p)(q + 7p) <

q + 3p, we have

y = p + q − x > p + q − 1

4((q − p) + (q + 3p)) =

1

2(p + q) > 0.

We conclude, therefore, that to every non-equilateral, isosceles triangle,there corresponds a unique, non-congruent isosceles triangle equal inperimeter and area.

We shall construct pairs of such isosceles triangles with integer sides.Suppose, then, that in (18.1) above, p and q are integers. The base 2x ofthe second isosceles triangle is an integer if and only if (q − p)(q + 7p)is a square integer. Writing q − p = dh2 and q + 7p = dk2 for integersd, h, k, with gcd(h, k) = 1, we have

p =d

8(k2 − h2), q =

d

8(k2 + 7h2).

Note that

gcd(2p, q) =d

8· gcd(2(k2 − h2), k2 + 7h2)

=d

8· gcd(k2 + 7h2, 16h2)

=d

8· gcd(k2 + 7h2, 16)

=

{d, if k and h are both odd,d8, if k and h are of different parity.

For the second isosceles triangle, we have, from (18.1) and the rela-tion y = p + q − x,

x =d

4· h(h + k), y =

d

4· (k2 − hk + 2h2).

Note also that

gcd(2x, y) =d

4· gcd(2h(h + k), k2 − hk + 2h2)

=d

4· gcd(2(h + k), k2 − hk + 2h2)

Page 82: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

613

=

{ 1, k odd and h even,2, k even and h odd, or k − h ≡ 0 (mod 4),4, k − h ≡ 2 (mod 4).

To obtain a pair of isosceles triangles of integer sides without com-mon divisors, we choose, for given relatively prime integers h < k,

d =

{ 1, k − h ≡ 2 (mod 4),2, k − h ≡ 0 (mod 4),8, k − h ≡ 1 (mod 2).

Consider two isosceles triangles

• �(h, k) := (d8(k2 + 7h2), d

8(k2 + 7h2), d

4(k2 − h2)), and

• �′(h, k) := (d4(k2 − hk + 2h2), d

4(k2 − hk + 2h2), d

2h(h + k)).

Each of these two isosceles triangles has perimeter d2(k2 + 3h2) and

area d2

16h(k2 − h2)

√k2 + 3h2.

Note that the second triangle �′(h, k) is the same as �( k−hg

, k+3hg

),where g = gcd(k − h, k + 3h).

Example. With h+k ≤ 10, we obtain the following pairs of isoscelestriangles equal in perimeter and area.

(h, k) (h′, k′) �(h, k) �(h′, k′) perimeter area

(1, 2) (1, 5) (11, 11, 6) (8, 8, 12) 28 12√

7

(1, 4) (3, 7) (23, 23, 30) (28, 28, 20) 76 60√

19

(2, 3) (1, 9) (37, 37, 10) (22, 22, 40) 84 40√

21

(1, 6) (5, 9) (43, 43, 70) (64, 64, 28) 156 140√

39

(2, 5) (3, 11) (53, 53, 42) (46, 46, 56) 148 168√

37

(3, 4) (1, 13) (79, 79, 14) (44, 44, 84) 172 84√

43

(1, 7) (3, 5) (7, 7, 12) (11, 11, 4) 26 6√

13

(1, 8) (7, 11) (71, 71, 126) (116, 116, 36) 268 252√

67

(2, 7) (5, 13) (77, 77, 90) (86, 86, 72) 244 360√

61

(4, 5) (1, 17) (137, 137, 18) (74, 74, 144) 292 144√

73

It is interesting to note that none of these “beginning” examples haveinteger area for the triangles. Indeed, Newton went on to find trianglessubject to the same conditions so that their perpendiculars also are ra-tional, ([2; pp. 106 – 107]). He gave two solutions, the first of which issimilar to the solution by Schooten reported in Dickson’s History of theTheory of Numbers, vol. II, [1; p.201]. In the second solution, for givenrational numbers b and t, Newton chooses s = b2−t2

2t−b. This will make

b2 + bs + s2 = a2 for a rational number a. Then, the isosceles triangles

Page 83: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

614 Isosceles triangles equal in perimeter and area

with sides (a2+b2, a2+b2, 2(a2−b2)) and (a2+s2, a2+s2, 2(a2−s2)) areequal in perimeter and area. Newton did not give numerical examples.

To obtain pairs of such triangles with integer sides (without commondivisor), it is enough, by the above analysis, to choose h and k so thatk2 + 3h2 is the square or an integer. It is well known that k and h mustbe of the form

k =m2 − 3n2

g, h =

2mn

g

for relatively prime integers m and n, and g = gcd(m2 − 3n2, 2mn).

With m+n ≤ 10, we obtain the following pairs of isosceles triangleswith integer sides and integer areas, equal in perimeter and area.

(m, n) (h, k) (h′, k′) �(h, k) �(h′, k′) perimeter area(4, 1) (8, 13) (5, 37) (617, 617, 210) (386, 386, 672) 1444 63840(6, 1) (4, 11) (7, 23) (233, 233, 210) (218, 218, 240) 676 21840(8, 1) (16, 61) (45, 109) (5513, 5513, 6930) (6514, 6514, 4928) 17956 14857920(7, 2) (28, 37) (9, 121) (6857, 6857, 1170) (3802, 3802, 7280) 14884 3996720(9, 1) (3, 13) (5, 11) (29, 29, 40) (37, 37, 24) 98 420

Page 84: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 19

The area of a triangle

19.1 Heron’s formula for the area of a triangle

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

� =√

s(s − a)(s − b)(s − c),

where s = 12(a + b + c).

Ia

YY ′

I

A

B

C

r

ra

s − cs − b 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

ra=

s − a

s.

From the similarity of triangles CIY and I ′CY ′,

r · ra = (s − b)(s − c).

Page 85: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

702 The area of a triangle

From these,

r =

√(s − a)(s − b)(s − c)

s,

and the area of the triangle is

� = rs =√

s(s − a)(s − b)(s − c).

19.2 Heron triangles

A Heron triangle is one whose sidelengths and area are both integers. Itcan be constructed by joining two integer right triangles along a commonleg. For example, by joining the two Pythagorean triangles (9, 12, 15)and (5, 12, 13), we obtain the Heron triangle (13, 14, 15) with area 84.

5

13 15

9

12

Some properties of Heron triangles

1. The semiperimeter is an integer.

2. The area is always a multiple of 6.

19.3 Heron triangles with consecutive sides

If (b− 1, b, b + 1,�) is a Heron triangle, then b must be an even integer.We write b = 2m. Then s = 3m, and �2 = 3m2(m − 1)(m + 1). Thisrequires m2 − 1 = 3k2 for an integer k, and � = 3km. The solutions ofm2 − 3k2 = 1 can be arranged in a sequence(

mn+1

kn+1

)=

(2 31 2

) (mn

kn

),

(m1

k1

)=

(21

).

Page 86: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

19.3 Heron triangles with consecutive sides 703

From these, we obtain the side lengths and the area.The middle sides form a sequence (bn) given by

bn+2 = 4bn+1 − bn, b0 = 2, b1 = 4.

The areas of the triangles form a sequence

�n+2 = 14�n+1 −�n, T0 = 0, T1 = 6.

n bn Tn Heron triangle

0 2 0 (1, 2, 3, 0)1 4 6 (3, 4, 5, 6)2 14 84 (13, 14, 15, 84)345

Page 87: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

704 The area of a triangle

19.4 Heron triangles with sides in arithmetic progres-sion

We write s − a = u, s − b = v, and s − c = w.a, b, c are in A.P. if and only if u, v, w are in A.P. Let u = v − d and

w = v + d. Then we require 3v2(v − d)(v + d) to be a square. Thismeans v2 − d2 = 3t2 for some integer t.

Proposition 19.2. Let d be a squarefree integer. If gcd(x, y, z) = 1 andx2+dy2 = z2, then there are integers m and n satisfying gcd(dm, n) = 1such that (i)

x = m2 − dn2, y = 2mn, z = m2 + dn2

if m and dn are of different parity, or(ii)

x =m2 − dn2

2, y = mn, z =

m2 + n2

2,

if m and dn are both odd.

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

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

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

m n a − d a a + d area1 2 15 14 13 841 4 51 38 25 4562 1 15 26 37 1562 5 87 74 61 22203 2 39 62 85 11163 4 75 86 97 30964 1 51 98 145 11764 5 123 146 169 87605 2 87 158 229 47405 4 123 182 241 10920

If m and n are both odd, we obtain

Page 88: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

19.5 Heron triangles with integer medians 705

m n a − d a a + d area1 1 3 4 5 61 5 39 28 17 2103 1 15 28 41 1263 5 51 52 53 11705 1 39 76 113 570

19.5 Heron triangles with integer medians

It is an unsolved problem to find Heron triangles with integer medians.The triangle (a, b, c) = (136, 170, 174) has three integer medians. But itis not a Heron triangle. It has an area .

Buchholz and Rathbun have found an infinite set of Heron triangleswith two integer medians. Here is the first one.

Let a = 52, b = 102, c = 146. This is a Heron triangle with areaand two integer medians mb = and mc =. The third one, however, has irrational length: ma =.

Page 89: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

706 The area of a triangle

Appendix: 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)

Page 90: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 20

Heron triangles and incircles

20.1 Enumeration of Heron triangles by inradii

Let r be the inradius of a triangle with w = s− a, v = s− b, u = s− c.

r2 =uvw

u + v + w.

From this,

w =r2(u + v)

uv − r2.

Note that uv > r2.We shall assume u ≤ v ≤ w. Note that C ≥ B ≥ A, and C ≥ π

3.

It follows that ru

= tan C2≥ 1√

3, and u ≤ √

3r. Also, ur

= cot C2

=

tan A+B2

≤ tan 2 · B2

= 2rvv2−r2 . From this, u(v2 − r2) ≤ 2r2v, and

v ≤ r2 + r√

r2 + u2

u.

If T (r) denotes the number of distinct Heron triangles with inradiusr, the beginning values of T (r) are as follows.

r 1 2 3 4 5 6 7 8 9 10 11 12T (r) 1 5 13 18 15 45 24 45 51 52 26 139

Page 91: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

708 Heron triangles and incircles

r (a, b, c) � (u, v, w) r (a, b, c) � (u, v, w)

1 (3, 4, 5) 6 (1, 2, 3) 2 (6, 25, 29) 60 (1, 5, 24)2 (7, 15, 20) 42 (1, 6, 14) 2 (9, 10, 17) 36 (1, 8, 9)2 (5, 12, 13) 30 (2, 3, 10) 2 (6, 8, 10) 24 (2, 4, 6)3 (11, 100, 109) 330 (1, 10, 99) 3 (12, 55, 65) 198 (1, 11, 54)3 (13, 40, 51) 156 (1, 12, 39) 3 (15, 28, 41) 126 (1, 14, 27)3 (16, 25, 39) 120 (1, 15, 24) 3 (19, 20, 37) 114 (1, 18, 19)3 (7, 65, 68) 210 (2, 5, 63) 3 (8, 26, 30) 96 (2, 6, 24)3 (11, 13, 20) 66 (2, 9, 11) 3 (7, 24, 25) 84 (3, 4, 21)3 (8, 15, 17) 60 (3, 5, 12) 3 (9, 12, 15) 54 (3, 6, 9)3 (10, 10, 12) 48 (4, 6, 6) 4 (18, 289, 305) 1224 (1, 17, 288)4 (19, 153, 170) 684 (1, 18, 152) 4 (21, 85, 104) 420 (1, 20, 84)4 (25, 51, 74) 300 (1, 24, 50) 4 (33, 34, 65) 264 (1, 32, 33)4 (11, 90, 97) 396 (2, 9, 88) 4 (12, 50, 58) 240 (2, 10, 48)4 (14, 30, 40) 168 (2, 12, 28) 4 (15, 26, 37) 156 (2, 13, 24)4 (18, 20, 34) 144 (2, 16, 18) 4 (9, 75, 78) 324 (3, 6, 72)4 (10, 35, 39) 168 (3, 7, 32) 4 (11, 25, 30) 132 (3, 8, 22)4 (15, 15, 24) 108 (3, 12, 12) 4 (9, 40, 41) 180 (4, 5, 36)4 (10, 24, 26) 120 (4, 6, 20) 4 (12, 16, 20) 96 (4, 8, 12)4 (13, 14, 15) 84 (6, 7, 8) 5 (27, 676, 701) 3510 (1, 26, 675)5 (28, 351, 377) 1890 (1, 27, 350) 5 (31, 156, 185) 930 (1, 30, 155)5 (36, 91, 125) 630 (1, 35, 90) 5 (39, 76, 113) 570 (1, 38, 75)5 (51, 52, 101) 510 (1, 50, 51) 5 (15, 377, 388) 1950 (2, 13, 375)5 (17, 87, 100) 510 (2, 15, 85) 5 (27, 29, 52) 270 (2, 25, 27)5 (12, 153, 159) 810 (3, 9, 150) 5 (13, 68, 75) 390 (3, 10, 65)5 (17, 28, 39) 210 (3, 14, 25) 5 (11, 60, 61) 330 (5, 6, 55)5 (12, 35, 37) 210 (5, 7, 30) 5 (15, 20, 25) 150 (5, 10, 15)

20.2 Inradii in arithmetic progression

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

A

B

C

D

Page 92: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

20.3 Division of a triangle into two subtriangles with equal incircles 709

(2) The following four inradii are in arithmetic progression. What isthe shape of the large triangle?

20.3 Division of a triangle into two subtriangles withequal incircles

Let P be a point on the side BC of triangle ABC. If the inradii oftriangles ABP and ACP are equal, then(i) AP 2 = s(s − a);

(ii) BP =c2+a2−b2±2(b−c)

√s(s−a)

2afor an appropriate choice of sign.

Here are two examples of Heron triangles with subdivision into twoHeron triangles with equal inradii.

(1) (a, b, c) = (15, 17, 8); BP = 6, CP = 15. AP = 10. The twosmall triangles have the same inradius 2.

A

B CP

Page 93: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

710 Heron triangles and incircles

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

A

B CP

Page 94: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 21

More about Heron triangles

21.1 Heron triangle as lattice triangle

A Heron triangle is decomposable if it can be decomposable into (theunion or difference of) two Pythagorean triangles. It is decomposableif one or more heights are integers. A decomposable Heron trianglecan clearly be realized as a lattice triangle. It turns out that this isalso true of the indecomposable one. For example, the Heron triangle(25, 34, 39; 420) is indecomposable, but can be realized at vertices (0, 0),(−20, 15), (16, 30).

Theorem 21.1. Every Heron triangle can be realized as a lattice trian-gle.

21.2 The circumcircle of a Heron triangle

The circumradius of a Heron triangle is in general not an integer. If pis a prime of the form 4k + 1, then there are unique integers m > nsatisfying p = m2 + n2. The Pythagorean triangle

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

clearly has circumradius p. The converse is also true.

Proposition 21.2. If the circumradius of a Heron triangle is a primenumber p, then p ≡ 1 mod 4, and the triangle is congruent to thePythagorean triangle above.

Page 95: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

712 More about Heron triangles

21.3 Heron triangles with square areas

Fermat has shown that there does not exist a Pythagorean triangle whosearea is a perfect square. However, the triangle with sides 9, 10, 17 hasarea 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

ak = 20k4 + 4k2 + 1,bk = 8k6 − 4k4 − 2k2 + 1,ck = 8k6 + 8k4 + 10k2.

Here, ak, bk < ck < ak + bk. The triangle with sides (ak, bk, ck) hasarea (

(2k)(2k2 − 1)(2k2 + 1))2

.

N. D. Elkies has constructed 2 an infinite sequence of solutions of theDiophantine equation

A4 + B4 + C4 = D4,

with gcd(A, B, C, D) = 1. The triangle with

a = B4 + C4, b = C4 + A4, c = A4 + B4

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

A =2682440,

B =15365639,

C =18796760,

D =20615673.

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

Page 96: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 22

The regular pentagon

22.1 The golden ratio

The construction of the regular pentagon is based on the division of asegment in the golden ratio. 1 Given a segment AB, to divide it in thegolden ratio is to construct a point P on it so that the area of the squareon AP is the same as that of the rectangle with sides PB and AB, i.e.,

AP 2 = AB · PB.

A construction of P is shown in the second diagram.

A BP BA

M

P

Suppose PB has unit length. The length ϕ of AP satisfies

ϕ2 = ϕ + 1.

1In Euclid’s Elements, this is called division into the extreme and mean ratio.

Page 97: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

802 The regular pentagon

This equation can be rearranged as(ϕ − 1

2

)2

=5

4.

Since ϕ > 1, we have

ϕ =1

2

(√5 + 1

).

Note that

AP

AB=

ϕ

ϕ + 1=

1

ϕ=

2√5 + 1

=

√5 − 1

2.

This explains the construction above.

22.2 The diagonal-side ratio of a regular pentagon

Consider a regular pentagon ACBDE. It is clear that the five diagonalsall 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.

A

E D

BP

C

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.

Page 98: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

22.3 Construction of a regular pentagon with a given diagonal 803

Note that triangle ACP is also isosceles since(7) ∠ACP = ∠APC = 72◦. This means that AP = AC.

Now, from the similarity of CAB and PBC, we have AB : AC =BC : PB. In other words AB · AP = AP · PB, or AP 2 = AB · PB.This means that P divides AB in the golden ratio.

22.3 Construction of a regular pentagon with a givendiagonal

Given a segment AB, we construct a regular pentagon ACBDE withAB as a diagonal.(1) Divide AB in the golden ratio at P .(2) Construct the circles A(P ) and P (B), and let C be an intersection ofthese two circles.(3) Construct the circles A(AB) and B(C) to intersect at a point D onthe same side of BC as A.(4) Construct the circles A(P ) and D(P ) to intersect at E.

Then ACBDE is a regular pentagon with AB as a diameter.

A

E D

BP

C

Page 99: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

804 The regular pentagon

22.4 Some interesting constructions of the golden ratio

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

Each of the following constructions begins with the division of a segmentAB in the golden ratio at P .

36◦A

B

C

P

36◦ 36◦

36◦A

B

C

D

P

54◦

54◦

AB

C

P

72◦

72◦

22.4.2 Odom’s construction

Let D and E be the midpoints of the sides AB and AC of an equilateraltriangle ABC. If the line DE intersects the circumcircle of ABC at F ,then E divides DF in the golden ratio.

A

B

D

C

EF

Page 100: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

22.4 Some interesting constructions of the golden ratio 805

22.4.3 ϕ and arctan 2

Given a segment AB, erect a square on it, and an adjacent one with baseBC. If D is the vertex above A, construct the bisector of angle ADC tointersect AB at P . Then P divides AB in the golden ratio.

A B C

D

P

Proof. If AB = 1, then

AP : PC =1 :√

5,

AP : AC =1 :√

5 + 1

AC : 2AB =1 :√

5 + 1

AB : AP =√

5 + 1 : 2

=ϕ : 1.

This means that P divides AB in the golden ratio.

Page 101: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

806 The regular pentagon

Page 102: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 23

Construction of regularpolygons

A regular polygon of n sides can be constructed (with ruler and compass)if it is possible to divides the circle into n equal parts by dividing the 360◦

at the center into the same number of equal parts. This can be easily donefor n = 6 (hexagon) and 8 (octagon). 1 We give some easy alternativesfor the regular hexagon, octagon and dodecagon.

23.1 The regular hexagon

A regular hexagon can be easily constructed by successively cutting outchords of length equal to the radius of a given circle.

1Note that if a regular n-gon can be constructed by ruler and compass, then a regular 2n-gon can also beeasily constructed.

Page 103: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

808 Construction of regular polygons

23.2 The regular octagon

(1) Successive completion of rhombi beginning with three adjacent 45◦-rhombi.

(2) We construct a regular octagon by cutting from each corner of agiven square (of side length 2) an isosceles right triangle of (shorter) sidex. This means 2− 2x : x =

√2 : 1, and 2− 2x =

√2x; (2 +

√2)x = 2,

x =2

2 +√

2=

2(2 −√2)

(2 +√

2)(2 −√2)

= 2 −√

2.

P

Q

A B

CD

x 2 − 2x x

x

O

P

Q

A B

CD

Therefore AP = 2 − x =√

2, which is half of the diagonal of thesquare. The point P , and the other vertices, can be easily constructed byintersecting the sides of the square with quadrants of circles with centersat the vertices of the square and passing through the center O.

Page 104: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

23.3 The regular dodecagon 809

23.3 The regular dodecagon

(1) Trisection of right angles.

(2) A regular dodecagon can be formed from 4 equilateral trianglesinside a square. 8 of its vertices are the intersections of the sides of theseequilateral triangles, while the remaining 4 are the midpoints of the sidesof the squares formed by the vertices of the equilateral triangles insidethe square.

An easy dissection shows that the area of the regular dodecagon is 34

of that of the (smaller) square containing it.

Page 105: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

810 Construction of regular polygons

(3) Successive completion of rhombi beginning with five adjacent30◦-rhombi.

This construction can be extended to other regular polygons. If an an-gle of measure θ := 360

2n

◦can be constructed with ruler and compass, be-

ginning with n−1 adjacent θ-rhombi, by succesively completing rhombi,we obtain a regular 2n-gons tesellated by

(n − 1) + (n − 2) + · · · + 2 + 1 =1

2n(n − 1)

rhombi.

23.4 Construction of a regular 15-gon

Let A1A2A3A4A5 be a regular pentagon inscribed in a circle (O). Con-struct equilateral triangles A1A2B5, A2A3B5, A3A4B1, A4A5B2, A5A1B3

with the extra vertices inside the circle. Extend the sides of these equilat-eral triangles to intersect the circle again. The 10 intersections, togetherthe vertices of the regular pentagon, form the vertices of a regular 15-goninscribed in the circle.

Page 106: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

23.5 Construction of a regular 17-gon 811

A1

A2

A3

A4

A5

B4

B5

O B1

B2

B3

23.5 Construction of a regular 17-gon

The following construction 2 of a regular 17-gon makes use of Gauss’computation

cos360◦

17=

1

16

(√17 − 1 +

√34 − 2

√17

)

+1

8

√17 + 3

√17 −

√34 − 2

√17 − 2

√34 + 2

√17.

Consider a circle (O) with two perpendicular diameters PQ and RS.(1) On the radius OR, mark a point A such that OA = 1

4OP .

(2) Construct the internal and external bisectors of angle OAP to inter-sect the line OP at B and C respectively.(3) Mark D and E on PQ such that CD = CA and BE = BA.(4) Mark the midpoint M of QD.(5) Mark F on OS such MF = MQ.(6) Construct the semicircle on OE and mark a point G on it such that

2J. J. Callagy, The central angle of the regular 17-gon, Math. Gaz., 67 (1983) 290–292.

Page 107: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

812 Construction of regular polygons

OG = OF .(7) Mark H on OP such that EH = EG, and construct the perpendicu-lar to OP at H to intersect the circle at P1.

Then ∠POP1 = 360◦17

, and P1 is a vertex of the regular 17-gon adja-cent to P on the circle.

A

BC OPQ

D EM

S

FG

H

P1

R

Page 108: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 24

Hofstetter’s constructions on thegolden section

This chapter collects some short papers by Kurt Hofstetter in Forum Ge-ometricorum on the golden section.

24.1 A simple construction of the golden section

We construct the golden section by drawing 5 circular arcs. 1

We denote by P (Q) the circle with P as center and PQ as radius.Figure 24.1 shows two circles A(B) and B(A) intersecting at C and D.The line AB intersects the circles again at E and F . The circles A(F )and B(E) intersect at two points X and Y . It is clear that C, D, X ,Y are on a line. It is much more interesting to note that D divides thesegment CX in the golden ratio, i.e.,

CD

CX=

√5 − 1

2.

This is easy to verify. If we assume AB of length 2, then CD = 2√

3and CX =

√15 +

√3. From these,

CD

CX=

2√

3√15 +

√3

=2√

5 + 1=

√5 − 1

2.

1Forum Geom., 2 (2002) 65–66.

Page 109: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

814 Hofstetter’s constructions on the golden section

X

D

C

BA FE

Y

Figure 24.1:

This shows that to construct three collinear points in golden section,we need four circles and one line. It is possible, however, to replacethe line AB by a circle, say C(D). See Figure 24.2. Thus, the goldensection can be constructed with compass only, in 5 steps.

X

D

C

BAFE

Y

Figure 24.2:

It is interesting to compare this with Figure 24.3 which also displaysthe golden section. 2 Here, ABC is an equilateral triangle. The linejoining the midpoints D, E of two sides intersects the circumcircle at F .

2See D. H. Fowler, The Mathematics of Plato’s Academy, Oxford University Press, 1988, p.105, note on3.5(b); and G. Odom and J. van de Craats, Elementary Problem 3007, American Math. Monthly, 90 (1983)482; solution, 93 (1986) 572. I am indebted to a referee for these references.

Page 110: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

24.2 A 5-step division of a segment in the golden section 815

Then E divides DF in the golden section, i.e.,

DE

DF=

√5 − 1

2.

However, it is unlikely that this diagram can be constructed in fewerthan 5 steps, using ruler and compass, or compass alone.

D

CB

A

FE

Figure 24.3:

24.2 A 5-step division of a segment in the golden sec-tion

Using ruler and compass only in five steps, we divide a given segment inthe golden section. 3

Inasmuch as we have given in §24.1 a construction of the golden sec-tion by drawing 5 circular arcs, we present here a very simple division ofa given segment in the golden section, in 5 euclidean steps, using rulerand compass only. For two points P and Q, we denote by P (Q) thecircle with P as center and PQ as radius.

Construction 24.1. Given a segment AB, construct

1. C1 = A(B),

2. C2 = B(A), intersecting C1 at C and D,

3. C3 = C(A), intersecting C1 again at E,

4. the segment CD to intersect C3 at F ,

5. C4 = E(F ) to intersect AB at G.3Forum Geom., 3 (2003) 205–206.

Page 111: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

816 Hofstetter’s constructions on the golden section

A B

C

D

E

F

G

H

G′

C1C2

C3

C4

Figure 24.4:

The point G divides the segment AB in the golden section.

Proof. Suppose AB has unit length. Then CD =√

3 and EG = EF =√2. Let H be the orthogonal projection of E on the line AB. Since

HA = 12, and HG2 = EG2 − EH2 = 2 − 3

4= 5

4, we have AG =

HG − HA = 12(√

5 − 1). This shows that G divides AB in the goldensection.

Remark. The other intersection G′ of C4 and the line AB is such thatG′A : AB = 1

2(√

5 + 1) : 1.

24.3 Another 5-step division of a segment in the goldensection

We give one more 5-step division of a segment into golden section, usingruler and compass only. 4

4Forum Geom., 4(2004) 21–22.

Page 112: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

24.3 Another 5-step division of a segment in the golden section 817

Inasmuch as we have given in §§24.1,24.2 5-step constructions of thegolden section we present here another very simple method using rulerand compass only. It is fascinating to discover how simple the goldensection appears. For two points P and Q, we denote by P (Q) the circlewith P as center and PQ as radius.

A B

C

D

E

F

G

C1

C2

C3

Figure 24.5:

Construction 24.2. Given a segment AB, construct

1. C1 = A(B),

2. C2 = B(A), intersecting C1 at C and D,

3. the line AB to intersect C1 at E (apart from B),

4. C3 = E(B) to intersect C2 at F (so that C and F are on oppositesides of AB),

5. the segment CF to intersect AB at G.

The point G divides the segment AB in the golden section.

Proof. Suppose AB has unit length. It is enough to show that AG =12(√

5 − 1).Extend BA to intersect C3 at H . Let CD intersect AB at I , and let

J be the orthogonal projection of F on AB. In the right triangle HFB,BH = 4, BF = 1. Since BF 2 = BJ × BH , BJ = 1

4. Therefore,

IJ = 14. It also follows that JF = 1

4

√15.

Page 113: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

818 Hofstetter’s constructions on the golden section

A B

C

D

E

F

G

H I JG′

Figure 24.6:

Now, IGGJ

= ICJF

=12

√3

14

√15

= 2√5. It follows that IG = 2√

5+2· IJ =

√5−22

, and AG = 12

+ IG =√

5−12

. This shows that G divides AB in thegolden section.

Remark. If FD is extended to intersect AH at G′, then G′ is such thatG′A : AB = 1

2(√

5 + 1) : 1.

After the publication of §24.2, Dick Klingens and Marcello Tarquinihave kindly written to point out that the same construction had appearedalmost one century ago in the following references.(i) E. Lemoine, Geometrographie ou Art des Constructions Geometriques,C. Naud, Paris, 1902; p.51.(ii) J. Reusch, Planimetricsche Konstruktionen in GeometrographischerAusfuhrung, Teubner, Leipzig, 1904; S.37.

24.4 Divison of a segment in the golden sectionwith ruler and rusty compass

We give a simple 5-step division of a segment into golden section, usingruler and rusty compass. 5

5Forum Geom., 5 (2005) 135–136.

Page 114: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

24.4 Divison of a segment in the golden sectionwith ruler and rusty compass 819

In §24.3 we have given a 5-step division of a segment in the goldensection with ruler and compass. We modify the construction by using arusty compass, i.e., one when set at a particular opening, is not permittedto change. For a point P and a segment AB, we denote by P (AB) thecircle with P as center and AB as radius.

A B

C

D

M

F

G

C1C2

C3

Figure 24.7:

Construction 24.3. Given a segment AB, construct

1. C1 = A(AB),

2. C2 = B(AB), intersecting C1 at C and D,

3. the line CD to intersect AB at its midpoint M ,

4. C3 = M(AB) to intersect C2 at F (so that C and D are on oppositesides of AB),

5. the segment CF to intersect AB at G.

The point G divides the segment AB in the golden section.

Proof. Extend BA to intersect C1 at E. According to §24.3, it is enoughto show that EF = 2 · AB. Let F ′ be the orthogonal projection of F onAB. It is the midpoint of MB. Without loss of generality, assume AB =4, so that MF ′ = F ′B = 1 and EF ′ = 2 ·AB−F ′B = 7. Applying thePythagorean theorem to the right triangles EFF ′ and MFF ′, we have

Page 115: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

820 Hofstetter’s constructions on the golden section

A B

C

D

M

E

F

G

F ′

C1C2

C3

Figure 24.8:

EF 2 =EF ′2 + FF ′2

=EF ′2 + MF 2 − MF ′2

=72 + 42 − 12

=64.

This shows that EF = 8 = 2 · AB.

24.5 A 4-step construction of the golden ratio

We construct, in 4 steps using ruler and compass, three points two of thedistances among which bear the golden ratio. 6

We present here a 4-step construction of the golden ratio using rulerand compass only. More precisely, we construct, in 4 steps using rulerand compass, three points two of the distances among which bear thegolden ratio. It is fascinating to discover how simple the golden ratioappears. We denote by P (Q) the circle with center P , passing throughQ, and by P (XY ) that with center P and radius XY .

Construction 24.4. Given two points A and B, construct6Forum Geom., 6 (2006) 179–180.

Page 116: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

24.5 A 4-step construction of the golden ratio 821

A BC DE

H

F

G

C1C2C3

Figure 24.9:

1. the circle C1 = A(B),

2. the line AB to intersect C1 again at C and extend it long enough tointersect

3. the circle C2 = A(BC) at D and E,

4. the circle C3 = E(BC) to intersect C1 at F and G, and C2 at H andI .

Then GHCH

=√

5+12

.

Proof. Without loss of generality let AB = 1, so that BC = AE =AH = EH = 2. Triangle AEH is equilateral. Let C4 = H(A), in-tersecting C1 at J . By symmetry, AGJ is an equilateral triangle. LetC5 = J(A) = J(AG) = J(AB), intersecting C1 at K. Finally, letC6 = J(H) = J(BC). See Figure 24.10.

With C1, C5, C2, C6, following [1], K divides GH in the golden sec-tion. It suffices to prove CH = GK =

√3. This is clear for GK since

the equilateral triangles AGK and AJK have sides of length 1. On theother hand, in the right triangle ACH , AC = 1 and AH = 2. By thePythogorean theorem CH =

√3.

Page 117: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

822 Hofstetter’s constructions on the golden section

A B

CD

E

J

H

F

G

K

C1

C2C3

C4

C5C6

Figure 24.10:

Remark. CGCH

=√

22

.

Page 118: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 25

Prime and perfect numbers

25.1 Infinitude of prime numbers

25.1.1 Euclid’s proof

If there were only finitely many primes:

2, 3, 5, 7, . . . , P,

and no more, consider the number

Q = (2 · 3 · 5 · · ·P ) + 1.

Clearly it is divisible by any of the primes 2, 3, . . . , P , it must be itself aprime, or be divisible by some prime not in the list. This contradicts theassumption that all primes are among 2, 3, 5, . . . , P .

25.1.2 Fermat numbers

The Fermat numbers are Fn := 22n+ 1. Note that

Fn − 2 = 22n − 1 =(22n−1

+ 1)(

22n−1 − 1)

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

By induction,

Fn = Fn−1Fn−2 · · ·F1 · F0 + 2, n ≥ 1.

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

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

Page 119: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

902 Prime and perfect numbers

25.1.3 Fibonacci numbers

Since gcd(Fm, Fn) = Fgcd(m,n), if there are only finitely many primes p1,. . . , pk, then the primes in Fp1 , . . . , Fpk

are distinct, and each one of themhas only one prime divisors. This contradicts F19 = 4181 = 37 × 113.

25.2 The prime numbers below 20000

The first 2262 prime numbers:

100

200

300

400

500

600

700

800

900

1000

1100

1200

1300

1400

1500

1600

1700

1800

1900

10 20 30 40 50 60 70 80 90 100� � � � � � � � � � �

� � � � � � � � � �� � � � � � � �

� � � � � � � �� � � � � � �

� � � � � � �� � � � � � � �� � � � � � � �

� � � � � � �� � � � � �

� � � � � � � � �� � � � � �

� � � � � � � � �� � � � �

� � � � � � �� � �

� � � � � � � � �� � � � � � �

� � � � �� � � � � � �

� � � � � �� � � � � �� � � � � � � �

� � � � � � � �� � � � �

� � � �� � � � � � � �

� � � � � � � �� � � � � �

� � � � �� � � � � �

� � � � �� � � � � �

� � � � � �� � � � � �

� � � � � � �� � � � � �

� � � � � � �� � � � � �

� � �� � � � � � �

� � � � �� � � � � � � � �

� � � � �� � � � � �

� � � � �� � � � �� � � � �

� � � � � �� � � � � � �� � � �

� � � � �� � � � � � �� � � �

� � � � � �� � � � � �

� � � � � �� � � � �� � � � � � � � �

� �� � � � �

� � � � � �� � � � � �

� � � � � � � � �� � � � �� � � � � �

� � � � �� � � � � � �

� � � � �� � � � �

� � � �� � � � �

� � � � �� � � � � �

� � � � � �� � � � � � � � �

� � � � �� � � � � �� � � � � �

� � � � �� � � � � � �

� � �� � � � � � � �

� � � � � �� �

� � � � � � �� � � � � � � �

� � � � �� � � � �

� � � �� � � � �

� � � � � � �� � � � � � �

� � � � �� � � � � � �

� �� � � � � � � �

� � � � �� � � �

� � � � �� � � � �

� � � � � �� � �

� � � � � � �� � � � �

� � � � �� � �

� � � � � �� � � �

� � � � � �� � �

� � � � � � �� � � �

� � � � � �� � �

� � �� � � � � � �

� � � �� � � � �

� � � � � �� � � � �

� � � � � � �� � � � � �

� � � �� � � � � � � � �

� � � � � �� � � � � � �

� � � �� � � � � � �

� � � �� � � � � �

� � �� � � � �

� � � � �� � � � � �

� � � � �� � � � � � �

� � � � � �� � � �

� � � � �� � � � �

� � � � �� � � �� � � �

� � � � �� � � � � �

� � � � � �� � � � � �� � � �

� � �� � � � � �

� � � � � � �� � � � � �

� � � � � �� � � � � �

� � �� � � � �

� � � � � �� � � � �

� � � �� � � � � � �

� � �� � � � �

� � � � � �� � � � � � �

� � � �� � � � � �

� �� �

� � � � �� � � � � � �

� � �� � �

� � � � � � �� � � � � �

� � � � �� � � �

� � � � � �� �

� � � � � � �� � � � � � �

� � � � �� � � � � � �

� � � � � �� � � � � � �

� � � � �� � �

� � � � � � ��

� � �� � � � � � �

� � � �� � � � �

� � � � �� � � � � � � � �

� � � � �� � � �� � � � �

� � � � � �� � � � � � �

� � � � � � � � � � � � �� � � � � � � � � � �

� � � � � � � �� � � � � � � �

� � � � � � � � � �� � � � � � �

� � � � � � � �� � � � � �

� � � � � � � �� � � � � � � �

� � � � � � �� � � � � �

� � � � � �� � � � � �

� � � � � � � � � �� � � � � � � � �

� � � � � �� � � � �

� � � � � � �� � � � � �

� � � � � � � �� � � �

� � � � � � �� � � � � � �� � � � �

� � � � � � �� � � � � � �

� � � � � �� � � � � �� � � � � �

� � � � � �� � � � �

� � � � �� � � � � � � � �� � � � �

� � � � � � �� � � � � � �

� � � � �� � � � �

� � � � � � � �� � � � � � � �

� � � �� � � � � � �

� � � �� � � � �

� � � � � � �� � � � � � �� � � � � � �

� �� � � � � � � �� � � � � � � �

� � � � � �� � �

� � � � � �� � � � � � �

� � � � � � �� � � � � �

� � � � �� � � � � � �

� � � � �� � � � � � �

� � � � �� � � � � � �

� � � � � �� � �

� � � � �� � � � �

� � � � �� � � � � � �

� � � � � � � �� � � � �

� � � � �� � � � � �� � �

� � � � �� � � � � �

� � � � � � �� � � �

� � � �� � � � �

� � � �� � � � � � �

� � � � � �� � �

� � � � � �� � � � �

� � � � �� � � � � �

� � � � � � � �� � � � �

� � � � � �� � � � �� � � �

� � � � � �� � � � � � � �

� � � � �� � � � �� � � � � �

� � � � � � � �� � � �� � � � � �

� � � � � �� � � � � � �

� � � � �� � � � �

� � �� � � � � � � � �

� � � � �� � � � � �

� � � �� � � � � � �

� � � �� � � � � �

� � � �� � � � � � � �

� � � � � ��

� � � � �� � � � � � �

� � � � � � �� � � �� � � �

� � � � � �� � � � �

� � � �� � � � � �

� � � � �� � � � � �

� �� � � � � � � �

� � � � �� � � � � � � � �

� � � �� � � � �

� � � � �� � �

� � � � �� � � � � �

� � � � �� � � � � �

� � � � �� � �� � �

� � � � �� � � � � � �

� � � � � �� � � �

� � � � � � � �� � � � � � � �

� � � � �� � �

� � � � �� � � � � �

� � � � � �� � � � �

� � � � �� � � � � � � �

� � � � � �� � � �

� � � � � �� � � � �

� � � � � �� � �

� � �� � � � �

� � �� � � � � � �� � � � �

� � � � � � �� � � � � � �

� � � �� � � � � �

� � � � � �� � � � �

� � � � � � �� � � � �

� � � �� � � �� � � � � �

� � � � � � �� � �

� � � � � �� � � �

� � � � �� � � �

� � � � �� � �

� � � �� � � �

� � � � �� � � �

� � �� � � � � �

� � � �� � � � � � �

� � � � � �� � �

� � � � �� � � �� � � � �

Page 120: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

25.3 Primes in arithmetic progression 903

25.3 Primes in arithmetic progression

B. Green and T. Tao (2004) have proved that there are arbitrarily longarithmetic progressions of prime numbers. For k = 0, 1, 2, . . . , 21, thenumbers

376859931192959 + 18549279769020k

are all primes.

25.4 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

Page 121: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

904 Prime and perfect numbers

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

n f(n) n f(n) n f(n) n f(n)0 17 1 19 2 23 3 294 37 5 47 6 59 7 738 89 9 107 10 127 11 14912 173 13 199 14 227 15 257

Page 122: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

25.4 The prime number spirals 905

25.4.2 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 + 41 is prime for 0 ≤ n ≤ 39.

n f(n) n f(n) n f(n) n f(n) n f(n)0 41 1 43 2 47 3 53 4 615 71 6 83 7 97 8 113 9 13110 151 11 173 12 197 13 223 14 25115 281 16 313 17 347 18 383 19 42120 461 21 503 22 547 23 593 24 64125 691 26 743 27 797 28 853 29 91130 971 31 1033 32 1097 33 1163 34 123135 1301 36 1373 37 1447 38 1523 39 1601

Page 123: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

906 Prime and perfect numbers

Prime number spiral beginning with 41: A closer look

��

��

��

��

� �

��

� � �

��

��

� �

����

� � �

��

� � �

���

� � � �

���

� �

���

� � � �

��

� �

��

� � �

��

� �

�����

� � � �

���

� � � �

���

� �

�����

� � �

����

� � � �

� � � � �

����

� � � �

����

� � � �

���

� �

���

� �

�����

� � � �

����

� �

����

� � � � � �

�����

� � � �

�����

� � � �

�����

� � �

����

� � �

���

� � �

����

� �

������

� � � � � �

�����

� � � � � �

������

� � �

���

� � � � �

����

� � � � � � � �

����

� � � � � �

�������

� � � � � � �

���

� � � � � � � �

����

� � � � �

�������

� � � � � �

���

� � � � � �

�����

� � � � �

����

� � � �

��

��

��

��

��

��

� �

��

��

��

� � �

��

� ��

��

� � �

� �

��

� ��

��

� � �

���

� �

���

� �

����

�����

� � � �

���

��

��

� � � �

� � �

���

� � � ��

��

� � �

���

�����

� � ��

���

� � ��

��

� � �

����

� � � � �

����

� � �

����

� � � �

�����

� � � � �

���

� � � � �

�����

� � � � �

����

� � � � �

���

� � � �

������

� � � � � �

�����

� � � �

����

� � � � �

���

� � � � �

����

� � � � � �

�����

� � � � � �

��

� � � � � � �

�����

� � � � � ��

����

� � � � � �

������

� � � � �

��������

� � � � � ��

�����

� � � � � �

�������

� � � � � � �

���

� � � � ��

����

� � � � � ��

41

Page 124: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

25.5 Perfect numbers 907

25.5 Perfect numbers

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

Theorem 25.1 (Euclid). If 1 + 2 + 22 + · · ·+ 2k−1 = 2k − 1 is a primenumber, then 2k−1(2k − 1) is a perfect number.

Note: 2k −1 is usually called the k-th Mersenne number and denotedby Mk. If Mk is prime, then k must be prime.

Theorem 25.2 (Euler). Every even perfect number is of the form givenby Euclid.

Open problem

Does there exist an odd perfect number?

Theorem-joke 25.1 (Hendrik Lenstra). Perfect squares do not exist. 2

Proof. Suppose n is a perfect square. Look at the odd divisors of n.They all divide the largest of them, which is itself a square, say d2. Thisshows that the odd divisors of n come in pairs a, b where a ·b = d2. Onlyd is paired to itself. Therefore the number of odd divisors of n is alsoodd. In particular, it is not 2n. Hence n is not perfect, a contradiction:perfect squares don’t exist.

2Math. Intelligencer, 13 (1991) 40.

Page 125: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

908 Prime and perfect numbers

25.6 Charles Twigg on the first 10 perfect numbers

There are only 39 known Mersenne primes, and therefore 39 known per-fect numbers. See Appendix. Let Pn be the n-th perfect number.

n k Mk Pn = 2k−1Mk

1 2 3 62 3 7 283 5 31 4964 7 127 81285 13 8191 335503366 17 131071 85898690567 19 524287 1374386913288 31 2147483647 23058430081399521289 61 2305843009213693951 26584559915698317446

5469261595384217610 89 61897001964269013744 19156194260823610729

9562111 4793378084303638130997321548169216

• P1 is the difference of the digits of P2. In P2, the units digit is thecube of the of tens digit.

• P3 and P4 are the first two perfect numbers prefaced by squares.The first two digits of P3 are consecutive squares. The first and lastdigits of P4 are like cubes. The sums of the digits of P3 and P4 arethe same, namely, the prime 19.

• P4 terminates both P11 and P14. 3

• Three repdigits are imbedded in P5.

• P7 contains each of the ten decimal digits except 0 and 5.

• P9 is the smallest perfect number to contain each of the nine nonzerodigits at least once. It is zerofree.

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

3These contain respectively 65 and 366 digits.

Page 126: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

25.7 Mersenne primes 909

25.7 Mersenne primes

Primes of the form Mk = 2k − 1 are called Mersenne prime. The onlyknown Mersenne primes are listed below.

k Year Discoverer k Year Discoverer

17 1588 P.A.Cataldi 19 1588 P.A.Cataldi31 1750 L.Euler 61 1883 I.M.Pervushin89 1911 R.E.Powers 107 1913 E.Fauquembergue127 1876 E.Lucas 521 1952 R.M.Robinson607 1952 R.M.Robinson 1279 1952 R.M.Robinson

2203 1952 R.M.Robinson 2281 1952 R.M.Robinson3217 1957 H.Riesel 4253 1961 A.Hurwitz4423 1961 A.Hurwitz 9689 1963 D.B.Gillies9941 1963 D.B.Gillies 11213 1963 D.B.Gillies

19937 1971 B.Tuckerman 21701 1978 C.Noll, L.Nickel23209 1979 C.Noll 44497 1979 H.Nelson, D.Slowinski86243 1982 D.Slowinski 110503 1988 W.N.Colquitt, L.Welsch132049 1983 D.Slowinski 216091 1985 D.Slowinski756839 1992 D.Slowinski,P.Gage 859433 1993 D.Slowinski

1257787 1996 Slowinski and Gage 1398269 1996 Armengaud, Woltman et al.2976221 1997 Spence, Woltman, et.al. 3021377 1998 Clarkson, Woltman,

Kurowski et. al.6972593 1999 Hajratwala, Woltman, 13466917 2001 Cameron, Woltman,

Kurowski et. al. Kurowski et. al.20996011 2003 Michael Shafer 24036583 2004 Findlay25964951 2005 Nowak 30402457 2005 Cooper, Boone et al

M30402457 has 9152052 digits and is the largest known prime.

Page 127: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

910 Prime and perfect numbers

Page 128: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 26

Digit problems

26.1 Some intriguing division problems

26.1.1 Problem E1 of the MONTHLY

x 7 x x xx x x) x x x x x x x x

x x x xx x xx x xx x x x

x x xx x x xx x x x

Clearly, the last second digit of the quotient is 0.Let the divisor be the 3-digit number d.Consider the 3-digit number in the seventh line, which is a multiple ofd. Its difference from the 4-digit number in the sixth line is a 2-digitnumber. This must be 9xx.This cannot be the same as the 3-digit number in the fifth line, since thedifference between the 3-digit numbers in the fourth and fifth lines is a3-digit number.Therefore, in the quotient, the digit after 7 is a larger one, which must besmaller than the first and the last digits, since these give 4-digit multiplesof d.It follows that the quotient is 97809.Since 8d is a 3-digit number 9xx, the 4-digit number in the third and

Page 129: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

912 Digit problems

bottom lines is 9d = 10xx or 11xx.From this 8d must be 99x, and therefore 992 = 8 × 124.

9 7 8 0 91 2 4) 1 2 1 2 8 3 1 6

1 1 1 69 6 88 6 81 0 0 3

9 9 21 1 1 61 1 1 6

26.1.2 Problem E10 of the MONTHLY

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

x x x x x xx x x) x x x x x x x x

x x xx x x x

x x xx x x x

x x xx x x xx x x x

Page 130: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

26.2 Problem E1111 of the MONTHLY 913

26.2 Problem E1111 of the MONTHLY

This is said to be the most popular Monthly problem. It appeared in theApril issue of 1954.

Our good friend and eminent numerologist, Professor EuclideParacelso Bombasto Umbugio, has been busily engaged test-ing on his desk calculator the 81 · 109 possible solutions to theproblem of reconstructing the following exact long divisionin which the digits indiscriminately were each replaced by xsave in the quotient where they were almost entirely omitted.

x x 8 x xx x x) x x x x x x x x

x x xx x x x

x x xx x x xx x x x

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

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

Page 131: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

914 Digit problems

26.3 k-right-transposable integers

Let k be a given positive integer. A positive integer X is k-right-transposableif in moving the leftmost digit to the rightmost, the number is multipliedby k.

Note that X is a repdigit if and only if k = 1. We shall assume k > 1.

Theorem 26.1. The only right-transposable numbers are the repdigits(which aretriviallly 1-right transposable, and

(142857)m, (285714)m,

which are 3-right-transposable.

Proof. Suppose the number X has n digits, with leftmost digit a. Wehave

10(X − a · 10n−1) + a = kX.

From this, (10 − k)X = a(10n − 1) = 9a · Rn.If k �= 3, 10 − k can only have prime divisors 2, 3, 5. The equation

will reduce to X = a repdigit, which is clearly impossible.For k = 3, we have 7X = a(10n − 1). If a = 7, then again X is a

repdigit. Therefore, we must have 7 dividing 10n − 1. This is possibleonly if n is a multiple of 6. Therefore X = a · 106m−1

7and has first digit

a.Now,

106m − 1

7= (142857)m.

It is easy to see that a can only be 1 or 2. Therefore, the only k-transposable numbers are (142857)m and (285714)m with k = 3.

26.4 k-left-transposable integers

Let k be a given positive integer. A positive integer X is k-left-transposableif in moving the rightmost digit to the leftmost, the number is multipliedby k. Note that X is a repdigit if and only if k = 1. We shall assumek > 1. Suppose the number X has n digits, and its rightmost digit is b.We have

b · 10n−1 +X − b

10= kX.

Page 132: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

26.4 k-left-transposable integers 915

From this, b · 10n + X − b = 10kX , and

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

Since X is has n digits, b(10n − 1) > (10k − 1)10n−1, and b >10n−1(10k−1)

10n−1= k − 1

10. This shows that b ≥ k.

k n

2 19X = b(10n − 1) 18m3 29X = b(10n − 1) 28m4 39X = b(10n − 1) 12m5 49X = b(10n − 1) 42m6 59X = b(10n − 1) 58m7 69X = b(10n − 1) 22m8 79X = b(10n − 1) 13m9 89X = b(10n − 1) 44m

These lead to the following numbers:

X(2) =105263157894736842,

X(3) =1034482758620689655172413793,

X(4) =102564102564,

X(5) =102040816326530612244897959183673469387755,

X(6) =10169491525423728813559322033898305084745762711864

40677966,

X(7) =1014492753623188405797,

X(8) =1012658227848,

X(9) =10112359550561797752808988764044943820224719.

Each of these X(k)k can be replaced by bk·Xk for k = b, . . . , 9. Every

k-left-transposable number is of the form (X(k))m for X(k) given aboveand m ≥ 1.

Page 133: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

916 Digit problems

Page 134: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 27

The repunits

27.1 Recurring decimals

The decimal expansion of a rational number is eventually periodic. It isfinite if and only if the denominator has no prime divisors other than 2and 5.

The decimal expansion of 1n

is purely periodic if and only if n is aprime. For p = 3, this is the most well known recurring decimal

1

3= 0.333 · · · = 0.3.

with period length 1. Here are the periods of the reciprocals of the firstfew primes, together with their period lengths.

p period λ(p)3 3 17 142857 611 09 213 076923 617 0588235294117647 1619 052631578947368421 1823 0434782608695652173913 2229 0344827586206896551724137931 2831 032258064516129 1537 027 341 0243902439 1043 023255813953488372093 2147 0212765957446808510638297872340425531914893617 46

Page 135: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

918 The repunits

27.2 The period length of a prime

The period length of a prime number p means the length of the shortestrepeating block of digits in the decimal expansion of 1

p.

Suppose 1p

has period length λ:

1

p= 0.a1 · · ·aλ.

Then moving the decimal places n places to the right, we have

10λ

p= a1 · · ·aλ.a1 · · ·aλ,

and

10λ

p− 1

p= a1 · · ·aλ

is an integer. This means that p divides 10λ − 1. Clearly, p cannot be 2or 5. It is known that if p �= 2, 5, then 10p−1 − 1 is divisible by p, andany number λ for which 10λ − 1 is divisible by p divides p − 1.

Theorem 27.1. (a) If p �= 2, 5, the period length of p is the smallestdivisor λ of p − 1 such that p divides 10λ − 1. (b) Let p > 5 be a prime.The period length of p is the smallest divisor n of p−1 such that p dividesRn.

Proof. (b) Note that 10n − 1 = 9n = 9 × Rn. If p �= 3, then p dividesRn.

We say that p is a primitive prime divisor the repunit Rn. Thus, fora prime p > 5, the period length of p is the number n for which p isprimitive prime divisor. A table of primitive prime divisors of repunitsis given in an Appendix.

Except for p = 2, 5, the decimal expansion of the reciprocal of aprime p is purely periodic. The period is a divisor of p − 1. It is thesmallest positive integer n for which p divides 10n − 1.

Page 136: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

27.2 The period length of a prime 919

p 1p

period length2 0.503 0.3 15 0.20

7∗ 0.142857 611 0.09 213 0.076923 6

17∗ 0.0588235294117647 1619 0.052631578947368421 18

23∗ 0.0434782608695652173913 2229∗ 0.0344827586206896551724137931 2831 0.032258064516129 1537 0.027 341 0.02439 543 0.023255813953488372093 22

47∗ 0.0212765957446808510638297872340425531914893617 46

The only prime number with period 1 is p = 3. On the other hand,there are many full period primes with period p − 1.

Conjecture (E. Artin). There are infinitely many primes p with periodp − 1.

27.2.1 Decimal expansions of 1pn

The decimal expansion of 1pn has period pn−1 times the period of p unless

p = 3 or is a Wieferich prime for base 10 satisfying 10p−1 ≡ 1 mod p2.The only known Wieferich prime for base 10 is p = 487. Both 1

487

and 14872 have period 486.

Page 137: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

920 The repunits

Appendix: Factorizations of repunits Rn for n ≤ 50

n Rn

2 11.3 3 × 37.4 11 × 101.5 41 × 271.6 3 × 7 × 11 × 13 × 37.7 239 × 4649.8 11 × 73 × 101 × 137.9 32 × 37 × 333667.

10 11 × 41 × 271 × 9091.11 21649 × 513239.12 3 × 7 × 11 × 13 × 37 × 101 × 9901.13 53 × 79 × 265371653.14 11 × 239 × 4649 × 909091.15 3 × 31 × 37 × 41 × 271 × 2906161.16 11 × 17 × 73 × 101 × 137 × 5882353.17 2071723 × 5363222357.18 32 × 7 × 11 × 13 × 19 × 37 × 52579 × 333667.19 prime20 11 × 41 × 101 × 271 × 3541 × 9091 × 27961.21 3 × 37 × 43 × 239 × 1933 × 4649 × 10838689.22 112 × 23 × 4093 × 8779 × 21649 × 513239.23 prime24 3 × 7 × 11 × 13 × 37 × 73 × 101 × 137 × 9901 × 99990001.25 41 × 271 × 21401 × 25601 × 182521213001.26 11 × 53 × 79 × 859 × 265371653 × 1058313049.27 33 × 37 × 757 × 333667 × 440334654777631.28 11 × 29 × 101 × 239 × 281 × 4649 × 909091 × 121499449.29 3191 × 16763 × 43037 × 62003 × 77843839397.30 3 × 7 × 11 × 13 × 31 × 37 × 41 × 211 × 241 × 271 × 2161 × 9091 × 2906161.31 2791 × 6943319 × 57336415063790604359.32 11 × 17 × 73 × 101 × 137 × 353 × 449 × 641 × 1409 × 69857 × 5882353.33 3 × 37 × 67 × 21649 × 513239 × 1344628210313298373.34 11 × 103 × 4013 × 2071723 × 5363222357 × 21993833369.35 41 × 71 × 239 × 271 × 4649 × 123551 × 102598800232111471.36 32 × 7 × 11 × 13 × 19 × 37 × 101 × 9901 × 52579 × 333667 × 999999000001.37 2028119 × 247629013 × 2212394296770203368013.38 11 × 909090909090909091 × R19.39 3 × 37 × 53 × 79 × 265371653 × 900900900900990990990991.40 11 × 41 × 73 × 101 × 137 × 271 × 3541 × 9091 × 27961 × 1676321 × 5964848081.41 83 × 1231 × 538987 × 201763709900322803748657942361.42 3 × 72 × 11 × 13 × 37 × 43 × 127 × 239 × 1933 × 2689 × 4649 × 459691 × 909091 × 10838689.43 173 × 1527791 × 1963506722254397 × 2140992015395526641.44 112 × 23 × 89 × 101 × 4093 × 8779 × 21649 × 513239 × 1052788969 × 1056689261.45 32 × 31 × 37 × 41 × 271 × 238681 × 333667 × 2906161 × 4185502830133110721.46 11 × 47 × 139 × 2531 × 549797184491917 × R23.47 35121409 × 316362908763458525001406154038726382279.48 3 × 7 × 11 × 13 × 17 × 37 × 73 × 101 × 137 × 9901 × 5882353 × 99990001 × 9999999900000001.49 239 × 4649 × 505885997 × 1976730144598190963568023014679333.50 11 × 41 × 251 × 271 × 5051 × 9091 × 21401 × 25601 × 182521213001 × 78875943472201.

Page 138: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

27.2 The period length of a prime 921

Appendix: Primitive prime divisors of repunitsn Primitive prime divisors of Rn2 11.3 3, 37.4 101.5 41, 271.6 7, 13.7 239, 4649.8 73, 137.9 333667.

10 9091.11 21649, 513239.12 9901.13 53, 79, 265371653.14 909091.15 31, 2906161.16 17, 5882353.17 2071723, 5363222357.18 19, 52579.19 1111111111111111111.20 3541, 27961.21 43, 1933, 10838689.22 23, 4093, 8779.23 11111111111111111111111.24 99990001.25 21401, 25601, 182521213001.26 859, 1058313049.27 757, 440334654777631.28 29, 281, 121499449.29 3191, 16763, 43037, 62003, 77843839397.30 211, 241, 2161.31 2791, 6943319, 57336415063790604359.32 353, 449, 641, 1409, 69857.33 67, 1344628210313298373.34 103, 4013, 21993833369.35 71, 123551, 102598800232111471.36 999999000001.37 2028119, 247629013, 2212394296770203368013.38 909090909090909091.39 900900900900990990990991.40 1676321, 5964848081.41 83, 1231, 538987, 201763709900322803748657942361.42 127, 2689, 459691.43 173, 1527791, 1963506722254397, 2140992015395526641.44 89, 1052788969, 1056689261.45 238681, 4185502830133110721.46 47, 139, 2531, 549797184491917.47 35121409, 316362908763458525001406154038726382279.48 9999999900000001.49 505885997, 1976730144598190963568023014679333.50 251, 5051, 78875943472201.

Page 139: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 28

Routh and Ceva theorems

28.1 A worked example on homogeneous barycentriccoordinates

Given a triangle ABC, X , Y , Z are points on the side lines specified bythe ratios of divisions

BX : XC = 2 : 1, CY : Y A = 5 : 3, AZ : ZB = 3 : 2.

The lines AX , BY , CZ bound a triangle PQR. Suppose triangle ABChas area �. Find the area of triangle PQR.

2 1

5

3

3

2

A

B CX

Z

Y

P Q

R

We make use of homogeneous barycentric coordinates with respectto ABC.

X = (0 : 1 : 2), Y = (5 : 0 : 3), Z = (2 : 3 : 0).

Those of P , Q, R can be worked out easily:

Page 140: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1002 Routh and Ceva theorems

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

P =1

31(10A + 15B + 6C), Q =

1

11(2A + 3B + 6C), R =

1

19(10A + 3B + 6C).

The area of triangle PQR

=1

31 · 11 · 19

∣∣∣∣∣∣10 15 62 3 610 3 6

∣∣∣∣∣∣ · � =576

6479�.

28.2 Routh theorem

λ 1

µ

1

A

B CX

Z

Y

P Q

R

We make use of homogeneous barycentric coordinates with respectto ABC.

X = (0 : 1 : λ), Y = (µ : 0 : 1), Z = (1 : ν : 0).

Those of P , Q, R can be worked out easily:

P = BY ∩ CZ Q = CZ ∩ AX R = AX ∩ BY

Y = (µ : 0 : 1) Z = (1 : ν : 0) X = (0 : 1 : λ)Z = (1 : ν : 0) X = (0 : 1 : λ) Y = (µ : 0 : 1)

P = (µ : µν : 1) Q = (1 : ν : νλ) R = (λµ : 1 : λ)

This means that the absolute barycentric coordinates of X , Y , Z are

Page 141: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

28.3 Ceva Theorem 1003

P =1

µν + µ + 1(µA + µνB + C),

Q =1

νλ + ν + 1(A + νB + νλC),

R =1

λµ + λ + 1(λµA + B + λC).

From these,

Area(PQR) =

∣∣∣∣∣∣µ µν 11 ν νλ

λµ 1 λ

∣∣∣∣∣∣(µν + µ + 1)(νλ + ν + 1)(λµ + λ + 1)

· �

=(λµν − 1)2

(µν + µ + 1)(νλ + ν + 1)(λµ + λ + 1)· �.

Exercise

Calculate the area of triangle PQR given

1. λ = µ = ν = 2.

2. λ = 1, µ = 7, ν = 4;

3. λ = 3, µ = 7, ν = 6.

28.3 Ceva Theorem

Theorem 28.1 (Ceva). Let X , Y , Z be points on the lines BC, CA, ABrespectively. The lines AX , BY , CZ are concurrent if and only if

BX

XC· CY

Y A· AZ

ZB= 1.

If this condition is satisfied, the homogeneous barycentric coordi-nates of the common point of AX , BY , CZ can be written down bycombining the coordinates of X , Y , Z.

Page 142: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1004 Routh and Ceva theorems

1 1

1

11

1

A

B C

G

Z

X

Y

Example: centroid

If AX , BY , CZ are the medians, the intersection is the centroid G:

X = (0 : 1 : 1)Y = (1 : 0 : 1)Z = (1 : 1 : 0)G = (1 : 1 : 1)

Example: incenter

If AX , BY , CZ are the angle bisectors, the intersection is the incenterI:

c b

a

cb

a

A

B C

I

Z

X

Y

X = (0 : b : c)Y = (a : 0 : c)Z = (a : b : 0)I = (a : b : c)

Page 143: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 29

Equilateral triangle in arectangle

29.1 Equilateral triangle inscribed in a rectangle

Given a rectangle ABCD, how can we choose a point P on BC and apoint Q on CD such that triangle APQ is equilateral?

P

Q

A B

CD

a

y

b − y

a − xx

b

Suppose AB = DC = a, BC = AD = b, DQ = x, and BP = y.These satisfy

a2 + y2 = b2 + x2 = (a − x)2 + (b − y)2.

From these, 2(ax + by) = a2 + y2 = b2 + x2, and we have

(x2 − 2ax + b2)2 = 4b2(b2 + x2) − 4a2b2.

Page 144: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1006 Equilateral triangle in a rectangle

This can be rewritten as

(x2 + b2)((x2 + b2) − 4ax − 4b2) = 0,

from whichx = 2a −

√3b.

Similarly, y = 2b −√3a.

29.2 Construction of equilateral triangle inscribed in arectangle

What is more interesting is that the above calculation leads to a very easyconstruction of the equilateral triangle AXY .

Construction 29.1. Construct equilateral triangles BCY and CDX sothat X and Y are in the interior of the rectangle. 1 Join AX to intersectBC at P and AY to intersect CD at Q. Then AXY is equilateral.

P

Q

A B

CD

X

Y

M

N

1This is not always possible. What is the range of the ratio ab

for X and Y to be in the interior of therectangle?

Page 145: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 30

The shoemaker’s knife

30.1 Archimedes’ twin circles

Let P be a point on a segment AB. The region bounded by the threesemicircles (on the same side of AB) with diameters AB, AP and PB iscalled a shoemaker’s knife. Suppose the smaller semicircles have radii aand b respectively. Let Q be the intersection of the largest semicircle withthe perpendicular through P to AB. This perpendicular is an internalcommon tangent of the smaller semicircles.

A BOO1 O2P A BOO1 O2P

Q

U

V

H

K

R

Theorem 30.1 (Archimedes). The two circles each tangent to CP , thelargest semicircle AB and one of the smaller semicircles have equalradii t, given by t = ab

a+b.

A BOO1 O2P A BOO1 O2P

Q

Page 146: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1008 The shoemaker’s knife

30.2 Incircle of the shoemaker’s knife

30.2.1 Archimedes’ construction

Theorem 30.2 (Archimedes). The circle tangent to each of the threesemicircles has radius given by

ρ =ab(a + b)

a2 + ab + b2.

A BOO1 O2P

C

X

Y

Construction

G

H

H′G′A BC

Z

Y X

Page 147: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

30.2 Incircle of the shoemaker’s knife 1009

30.2.2 Bankoff’s constructions

Theorem 30.3 (Leon Bankoff). If the incircle C(ρ) of the shoemaker’sknife touches the smaller semicircles at X and Y , then the circle throughthe points P , X , Y has the same radius as the Archimedean circles.

A BOO1 O2P

C

Z

X

Y

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

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

The semiperimeter of the triangle CO1O2 is

a + b + ρ = (a + b) +ab(a + b)

a2 + ab + b2=

(a + b)3

a2 + ab + b2.

The inradius of the triangle is given by√abρ

a + b + ρ=

√ab · ab(a + b)

(a + b)3=

ab

a + b.

This is the same as t, the common radius of Archimedes’ twin circles.

First construction

A BOO1 O2P

C

X

YC3

Q1

Q2

Z

Page 148: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1010 The shoemaker’s knife

Second construction

Z

Y X

A BC

Q

P

30.2.3 Woo’s three constructions

Z

YX

A BC

Q

SP

Z

Y XA B

C

M

Z

YX

A BC

30.3 More Archimedean circles

Let UV be the external common tangent of the semicircles O1(a) andO2(b), which extends to a chord HK of the semicircle O(a + b). Let C4

Page 149: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

30.3 More Archimedean circles 1011

be the intersection of O1V and O2U . Since

O1U = a, O2V = b, and O1P : PO2 = a : b,

C4P = aba+b

= t. This means that the circle C4(t) passes through P andtouches the common tangent HK of the semicircles at N .

A BOO1 O2P

N

U

V

H

K

C4

M

C5

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 tangentto HK and the minor arc HK of O(a + b) has radius t. This circletouches the minor arc at the point Q.

Theorem 30.4 (Thomas Schoch). The incircle of the curvilinear trianglebounded by the semicircle O(a+b) and the circles A(2a) and B(2b) hasradius t = ab

a+b.

A BOO1 O2P

S

Proof. Denote this circle by S(x). Note that SO is a median of thetriangle SO1O2. By Apollonius theorem,

(2a + x)2 + (2b + x)2 = 2[(a + b)2 + (a + b − x)2].

From this, x = aba+b

= t.

Page 150: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 31

Permutations

31.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 < i. These can be calculated recursively as follows. Begin-ning with (q1, r1) = (m − 1, 0), we set, for each i ≥ 2,

qi−1 = i × qi + ri.

In other words,

(qi, ri) =(⌊qi−1

i

⌋, mod(qi−1, i)

).

Along with these, we construct a sequence of lists which ends at thedesired permutation. Let L1 = (1). For i ≥ 2, form Li by inserting iinto Li−1 so that there are exactly ri members smaller than i on its righthand side. Then Lk is the permutation corresponding to m.

Page 151: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1102 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).

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

Page 152: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

31.2 The position of a permutation in the universal sequence 1103

Example

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

j Lj rj sj

9 (1, 4, 6, 2, 3, 7, 9, 8, 5) 2 28 (1, 4, 6, 2, 3, 7, 8, 5) 1 177 (1, 4, 6, 2, 3, 7, 5) 1 1206 (1, 4, 6, 2, 3, 5) 3 7235 (1, 4, 2, 3, 5) 0 36154 (1, 4, 2, 3) 2 144623 (1, 2, 3) 0 433862 (1, 2) 0 867721 (1) 1 86773

This permutation appears as the 86773-th in the universal sequence.

Page 153: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1104 Permutations

Page 154: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 32

Cycle decompositions

32.1 The disjoint cycle decomposition of a permutation

Theorem 32.1. Every permutation can be decomposed into a product ofdisjoint cycles.

For example, the permutation(1 2 3 4 5 6 7 8 9 X J Q K6 9 8 3 4 2 K 7 Q 5 1 J X

)

decomposes into the two disjoint cycles (1629QJ)(387KX54).

Theorem 32.2. Every cycle decomposes into a product of transpositions.

Theorem 32.3. A permutation can be decomposed into a product oftranspositions. The parity (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 32.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, thoughwe usually do not write them in the cycle decomposition of a permuta-tion.

Page 155: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1106 Cycle decompositions

32.2 Dudeney’s puzzle

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

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

1 2 3 4 5 6 7 8 9(25) 1 5 3 4 2 6 7 8 9(37) 1 5 7 4 2 6 3 8 9(38) 1 5 7 4 2 6 8 3 9(34) 1 5 7 3 2 6 8 4 9

The squares of 25572, 26733, and 27273 can also be obtained in fourmoves.

•1 2 3 4 5 6 7 8 9

6 5 3 9 2 7 1 8 4

•1 2 3 4 5 6 7 8 9

7 1 4 6 5 3 2 8 9

•1 2 3 4 5 6 7 8 9

7 4 3 8 1 6 5 2 9

1Puzzle 128 of [Dudeney]

Page 156: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

32.3 Dudeney’s Canterbury puzzle 3 1107

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

1 2 3 4 5 6 7 8 9

32.3 Dudeney’s Canterbury puzzle 3

7 × 2 8 = 1 9 6 = 3 4 × 5 .

While 7 × 28 = 196, it is not true that 34 × 5 = 196. Move as fewcounters as possible to make the equations valid. 2

2 (27)(495)to2×78=156=39×4.

Page 157: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1108 Cycle decompositions

Page 158: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 33

More card Games

33.1 Perfect shuffles

Consider a deck of an even number of cards, say, 2n. Separates the tophalf (of n cards) from the bottom half, and perfectly interlaces them. Itis called the out-shuffle if the top and bottom cards remain respectivelyon top and in bottom. Otherwise it is called the in-shuffle. These arecalled perfect shuffles.

1

5

2

6

3

7

4

8

Figure 33.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-faro shuffle, weachieve this in the following leisurely way. Align the two halves of cardsin two rows and n columns, the first half in the top row, and the secondhalf in the bottom row. Collect the cards along the columns, from top tobottom, 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 rowand the second half in the top row instead.

Page 159: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1110 More card Games

5

1

6

2

7

3

8

4

Figure 33.2: The in-shuffle ρ8

ρ2n = (n + 1, 1, n + 2, 2, . . . , 2n − 1, n − 1, 2n, n).

33.1.1 In-shuffles

Where is the first card after a number of perfect shuffles? We do this byworking out formulas for ω2n(k) and ρ2n(k).

It is easier with in-shuffles. If k is an even number, then ρ(k) is simplyk2. If, k is odd, then we add n + 1 to k−1

2.

In terms of binary representations of numbers, this can be describedas follows: drop the rightmost digit, and add n if this deleted digit is 1.

Let verify this rule with two examples.

Examples

(1) Take a complete suit of spade put an extra heart at the end to forma row of 14 cards. What are the positions of the heart under repeatedin-shuffles?

Here, 2n = 14 and n + 1 = 8 = 10002. We consider every number≤ 14 with 4 binary digits. In this case, ρ14 is simply transferring therightmost binary digit of k to the leftmost positions. This is why after 4in-shuffles, every card is restored.

This applies to any n which is one less than a power of 2: if thenumber of cards is 2 less than a power of 2, after an in-shuffle, the cardin position k has number obtained by transferring the rightmost binarydigit of k to the leftmost. Example:

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

Page 160: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

33.1 Perfect shuffles 1111

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

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

(2) For an ordinary deck of 52 cards, n + 1 = 27 = 110112. What isthe 11-th card after 4 in-shuffles? Note that 11 = 10112.

ρ4(10112) =ρ3(110112 + 10112) = ρ3(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.

ρ−12n (k) =

{2k, if k ≤ n,

2k − 2n − 1, if k > n,

or we simply say

ρ−12n (k) = 2k mod (2n + 1).

This means that ρ2n can be obtained by dividing by 2 modulo 2n+1. If �is the smallest positive integer with 2� ≡ 1 mod 2n+1, then � in-shufflesrestore every card in their original positions.

33.1.2 Out-shuffles

For the out-shuffle ω2n, we have

ω−12n (k) =

{2k − 1 if k ≤ n,

2(k − n) if k > n,

or simplyω−1

2n (k) = 2k − 1 mod (2n − 1).

Page 161: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1112 More card Games

How do we describe ω2n directly?If k is odd, ω2n(k) is k+1

2. If k is even, ω2n(k) is obtained by adding

n to k2.

This can be described in terms of binary digits as follows. ω2n(k) isfound by deleting the rightmost binary digit from k, and to the resultingnumber add this digit if it is nonzero, otherwise, add n.

Example 33.1. Take an ordinary deck of 2n = 52 cards and out-shuffle3 times. Where does card 13 appear

ω−352 (13) ≡ ω−2

52 (25) ≡ ω−152 (49) ≡ ω−1

52 (−2) ≡ −5 ≡ 46 mod 51.

On the other hand, what is the 13th card after 3 out-shuffles? Withn = 26 = 110102, we have

ω352(11012) =ω2(1112)

=ω(1002)

=110102 + 102

=111002

=28.

If the orignal order is natural, then this is ♥2.

Page 162: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

33.2 Monge’s shuffle 1113

33.2 Monge’s shuffle

The Monge shuffle of n cards puts card 2 above 1, card 3 beneath thepair, card 4 above the three, card 5 below the four, and proceed by puttinga card alternatively above and below the pile that precedes it. We denotethe Monge shuffle of n cards by µn.

8

64

2

13

5

7

Figure 33.3: The Monge shuffle µ8

In practice, we put the cards in a line, and move successively everysecond card to the leftmost position. To write down the permutation, wesimply write the even numbers in descending order, followed by the oddnumbers in ascending order. Thus,

µ2k = (2k, 2k − 2, . . . , 4, 2, 1, 3, . . . , 2k − 3, 2k − 1),

and

µ2k+1 = (2k, 2k − 2, . . . , 4, 2, 1, 3, . . . , 2k − 3, 2k − 1, 2k + 1).

Page 163: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 34

Figurate numbers

34.1 Triangular numbers

The nth triangular number is Tn = 1 + 2 + 3 + · · · + n = 12n(n + 1).

The first few of these are 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, . . . .

34.1.1 Palindromic triangular numbers

n Tn n Tn n Tn

1 1 109 5995 3185 50737052 3 132 8778 3369 56767653 6 173 15051 3548 629592610 55 363 66066 8382 3513315311 66 1111 617716 11088 6147741618 171 1287 828828 18906 17872787134 595 1593 1269621 57166 163400436136 666 1833 1680861 102849 528900982577 3003 2662 3544453 111111 6172882716

Page 164: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1202 Figurate numbers

34.2 Pentagonal numbers

The pentagonal numbers are the sums of the arithmetic progression

1 + 4 + 7 + · · ·+ (3n − 2) + · · ·The nth pentagonal number is Pn = 1

2n(3n − 1).

34.2.1 Palindromic pentagonal numbers

n Pn n Pn n Pn

1 1 101 12521 6010 541771452 5 693 720027 26466 10506605014 22 2173 7081807 26906 108588580126 1001 2229 7451547 31926 152888825144 2882 4228 26811862 44059 2911771192

34.3 The polygonal numbers Pk,n

More generally, for a fixed k, the k-gonal numbers are the sums of thearithmetic progression 1 + (k − 1) + (2k − 3) + · · · . The nth k-gonalnumber is Pk,n = 1

2n((k − 2)n − (k − 4)).

Page 165: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

34.4 Sums of powers of consecutive integes 1203

34.4 Sums of powers of consecutive integes

Consider the sum of the k-powers of the first natural numbers:

Sk(n) := 1k + 2k + · · ·+ nk.

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

Sk+1(n) =

∫(k + 1)Sk(n)dn + cn,

where c is determined by the condition that the sum of the coefficients is1.

Examples

(1) S2(n) = 16n(n + 1)(2n + 1).

(2) S3(n) = 13 + 23 + · · ·+ n3 = 14n2(n + 1)2.

(3) Since 4S3(n) = n4 + 2n3 + n2, we have

S4(n) =1

5n5 +

1

2n4 +

1

3n3 + cn,

where c = 1 − (15

+ 12

+ 13

)= −1

30. Therefore,

14 + 24 + · · · + n4 =1

5n5 +

1

2n4 +

1

3n3 − 1

30n.

Page 166: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1204 Figurate numbers

Page 167: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 35

Sums of consecutive squares

35.1 The odd number case

Suppose the sum of the squares of 2k + 1 consecutive positive integersis a square. If the integers are b, b ± 1, . . . , b ± k. We require

(2k + 1)b2 +1

3k(k + 1)(2k + 1) = a2

for an integer a. From this we obtain the equation

a2 − (2k + 1)b2 =1

3k(k + 1)(2k + 1). (Ek)

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

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

2k + 1 25 49 121 169 289 361 529 625 841 961 . . .0 1 1 2 7 3 5 3 3 10 . . .

2. Find the unique sequence of 49 (respectively 121) consecutive pos-itive integers whose squares sum to a square.

Page 168: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1206 Sums of consecutive squares

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

4. Suppose 2k + 1 is not a square. If k + 1 is divisible 9 = 32 orby any prime of the form 4k + 3 ≥ 7, then the equation (Ek) hasno solution. Verify that for the following values of k < 50, theequation (Ek) has no solution:

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

5. Suppose p = 2k+1 is a prime. If the Legendre symbol(− 1

3k(k+1)

p

)=

−1, then the equation (Ek) has no solution. Verify that for the fol-lowing values of k < 50, the equation (Ek) has no solution:

1, 2, 3, 8, 9, 14, 15, 20, 21, 26, 33, 39, 44.

6. For k ≤ 50, it remains to consider (Ek) for the following values ofk:

5, 7, 11, 16, 19, 23, 25, 28, 29, 31, 36, 38, 43, 47, 49.

Among these, only for k = 5, 11, 16, 23, 29 are the equations (Ek)solvable.

7. Work out 5 sequences of 23 consecutive integers whose squaresadd up to a square in each case.

Answer:

72 + 82 + · · ·+ 292 = 922;8812 + 8822 + · · · + 9032 = 42782;

427872 + 427882 + · · ·+ 428092 = 2052522;20534012 + 20534022 + · · · + 20534232 = 98478182;

· · · · · · · · ·

Page 169: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

35.2 The even number case 1207

8. Consider the equation (E36) : u2−73v2 = 12·37·73. This equationdoes in fact have solutions (u, v) = (4088, 478), (23360, 2734).The fundamental solution of the Pell equation x2 − 73y2 = 1 being(a, b) = (2281249, 267000), we obtain two sequences of solutionsof (E73):Answer:

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

This means, for example, the sum of the squares of the 73 numberswith center 478 (respectively 2734) is equal to the square of 4088(respectively 23360).

35.2 The even number case

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

b − k + 1, b − k + 2, . . . , b, . . . , b + k − 1, b + k,

is equal to a2. This means

(2a)2 − 2k(2b + 1)2 =2k

3(4k2 − 1). (E ′

k)

Note that the numbers 2k, 4k2 − 1 are relatively prime.

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

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

k) has nosolution.

3. For k ≤ 50, the equation (E ′k) has no solution for the following

values of k:

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

4. Let k be a prime. The equation (E ′k) can be written as

(2b + 1)2 − 2ky2 = −4k2 − 1

3.

Page 170: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1208 Sums of consecutive squares

By considering Legendre symbols, the equation (E ′k) has no solu-

tion for the following values of k ≤ 50:

k = 5, 7, 17, 19, 29, 31, 41, 43.

5. Excluding square values of 2k < 100, the equation (E ′k) has solu-

tions only for k = 1, 12, 37, 44.

6. Show that (34, 0), (38, 3), (50, 7) are solutions of (E”12). Constructfrom them three infinite sequences of expressions of the sum of 24consecutive squares as a square.

7. The equation (E ′37) has solutions (185, 2), (2257,261), and (2849,

330). From these we construct three infinite sequences of expres-sions of the sum of 74 consecutive squares as a square.

Answer:

2252 + 2262 + · · · + 2982 = 22572;2942 + 2952 + · · · + 3672 = 28492;

130962 + 130972 + · · ·+ 131792 = 7638652.

8. The equation (E ′44) has solutions (242, 4) and (2222,235). From

these we obtain two infinite sequences of expressions of the sum of88 consecutive squares as a square.

1922 + 1932 + · · ·+ 2792 = 22222;59252 + 59262 + · · ·60122 = 559902.

Page 171: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

Chapter 36

Polygonal triples

We consider polygonal numbers of a fixed shape. For a given positiveinteger k, the sequence of k-gonal numbers consists of the integers

Pk,n :=1

2

((k − 2)n2 − (k − 4)n

). (36.1)

By a k-gonal triple, we mean a triple of positive integers (a, b, c) satis-fying

Pk,a + Pk,b = Pk,c. (36.2)

A 4-gonal triple is simply a Pythagorean triple satisfying a2 + b2 = c2.We shall assume that k �= 4. By completing squares, we rewrite (36.2)as

(2(k − 2)a − (k − 4))2 + (2(k − 2)b − (k − 4))2

= (2(k − 2)c − (k − 4))2 + (k − 4)2, (36.3)

and note, by dividing throughout by (k − 4)2, that this determines arational point on the surface S:

x2 + y2 = z2 + 1, (36.4)

namely,P (k; a, b, c) := (ga − 1, gb − 1, gc − 1), (36.5)

where g = 2(k−2)k−4

. This is always an integer point for k = 3, 5, 6, 8, withcorresponding g = −2, 6, 4, 3. For k = 3 (triangular numbers), we shallchange signs, and consider instead the point

P ′(3; a, b, c) := (2a + 1, 2b + 1, 2c + 1). (36.6)

The coordinates of P ′(3; a, b, c) are all odd integers exceeding 1.

Page 172: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1210 Polygonal triples

36.1 Double ruling of S

The surface S, being the surface of revolution of a rectangular hyperbolaabout its conjugate axis, is a rectangular hyperboloid of one sheet. Ithas a double ruling, i.e., through each point on the surface, there are twostraight lines lying entirely on the surface.

Figure 36.1:

Let P (x0, y0, z0) be a point on the surface S. A line � through P withdirection numbers p : q : r has parametrization

� : x = x0 + pt, y = y0 + qt, z = z0 + rt.

Substitution of these expressions into (36.4) shows that the line � isentirely contained in the surface S if and only if

px0 + qy0 = rz0, (36.7)

p2 + q2 = r2. (36.8)

It follows that

r2 = r2(x20 + y2

0 − z20)

= r2(x20 + y2

0) − (px0 + qy0)2

= (p2 + q2)(x20 + y2

0) − (px0 + qy0)2

= (qx0 − py0)2.

This meansqx0 − py0 = εr, ε = ±1. (36.9)

Solving equations (36.7) and (36.9), we determine the direction numbersof the line. We summarize this in the following proposition.

Page 173: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

36.2 Primitive Pythagorean triple associated with a k-gonal triple 1211

Proposition 36.1. The two lines lying entirely on the hyperboloid S :x2 + y2 = z2 + 1 and passing through P (x0, y0, z0) have direction num-bers

x0z0 − εy0 : y0z0 + εx0 : x20 + y2

0

for ε = ±1.

In particular, if P is a rational point, these direction numbers are ra-tional.

36.2 Primitive Pythagorean triple associated with a k-gonal triple

Let P be the rational point determined by a k-gonal triple (a, b, c), asgiven by (36.5), for k ≥ 5 and (36.6) for k = 3 (triangular numbers).We first note that the coordinates of P all exceed 1. This is clear fork = 3, and for k ≥ 5, it follows from the fact that g = 2(k−2)

k−4> 2.

The direction numbers of the ruling lines on S through the point P , asgiven in Proposition 1, are all positive. In view of (36.8), we may there-fore choose a primitive Pythagorean triple (p, q, r) for these directionnumbers. As is well known, every such triple is given by

p = m2 − n2, q = 2mn, r = m2 + n2 (36.10)

for relatively prime integers m > n of different parity.We study the converse question of determining k-gonal triples from

(primitive) Pythagorean triples.

36.3 Triples of triangular numbers

Given a primitive Pythagorean triple (p, q, r) as in (36.10), we want todetermine a triangular triple (a, b, c) corresponding to it. Given an oddinteger z0 > 1, we obtain, from (36.7) and (36.9),

x0 =pz0 + εq

r, y0 =

qz0 − εp

r. (36.11)

We claim that it is possible to choose z0 > 1 so that x0 and y0 arealso odd integers > 1.

By the euclidean algorithm, there are odd integers u and v such thatqu + rv = 1. (Note that v must be odd, since q is even. If u is even, we

Page 174: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1212 Polygonal triples

replace (u, v) by (u− r, v + q), in which both entries are odd). Clearly,the integer z0 = εpu is such that qz0 − εp = εp(qu − 1) is divisible byr. This makes y0 an integer. The corresponding x0 is also an integer.Replacing z0 by z0 + rt for a positive integer t if necessary, the integersz0, x0, and y0 can be chosen greater than 1. From (36.11), the integersx0 and y0 are both odd, since p and q are of different parity and z0 is odd.

We summarize this in the following theorem.

Theorem 36.2. Let (p, q, r) be a primitive Pythagorean triple. Thereare two infinite families of triangular triples (aε(t), bε(t), cε(t)), ε = ±1,such that one of the lines �ε(P ), P = P ′(3; aε(t), bε(t), cε(t)), has direc-tion numbers p : q : r.

Triangular triples from primitive Pythagorean triples

(m, n) (p, q, r) (a+(0), b+(0), c+(0)) (a−(0), b−(0), c−(0))

(2, 1) (3, 4, 5) (2, 2, 3) (3, 5, 6)(4, 1) (15, 8, 17) (9, 4, 10) (5, 3, 6)(3, 2) (5, 12, 13) (4, 9, 10) (5, 14, 15)(6, 1) (35, 12, 37) (20, 6, 21) (14, 5, 15)(5, 2) (21, 20, 29) (6, 5, 8) (14, 14, 20)(4, 3) (7, 24, 25) (6, 20, 21) (7, 27, 28)(8, 1) (63, 16, 65) (35, 8, 36) (27, 7, 28)(7, 2) (45, 28, 53) (35, 21, 41) (9, 6, 11)(5, 4) (9, 40, 41) (8, 35, 36) (9, 44, 45)

36.4 k-gonal triples determined by a Pythagorean triple

Now, we consider k ≥ 5. We shall adopt the notation

h′ :=

{h if h is odd,h2

if h is even,

for an integer h.

Theorem 36.3. Let k ≥ 5 and g = 2(k−4)k−2

. The primitive Pythagoreantriple (p, q, r) defined in (36.10) by relatively prime integers m > n withdifferent parity corresponds to a k-gonal triple if and only if one of 2n

g

and 2(m−n)g

is an integer.

Since m and n are relatively prime, the integer (k − 2)′ > 1 cannotdivide both n and m−n. This means that a primitive Pythagorean triple

Page 175: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

36.4 k-gonal triples determined by a Pythagorean triple 1213

(p, q, r) corresponds to at most one line on S associated with k-gonaltriples (for k ≥ 5).

Indeed, if k = 4h + 2, (k − 2)′ is the even number 2h, and cannotdivide the odd integer m−n. It follows that only those pairs (m, n), withn a multiple of 2h give (4h + 2)-gonal pairs. For example, by choosingm = 2h + 1, n = 2h, we have

p = 4h + 1, q = 8h2 + 4h, r = 8h2 + 4h + 1,a0 = 4h + 1, b0 = 8h2 + 2h + 1, c0 = 8h2 + 2h + 2.

These give an infinite family of (4h + 2)-gonal triples:

at = (4h + 1)(t + 1),bt = 8h2 + 2h + 1 + (8h2 + 4h)t,ct = 8h2 + 2h + 2 + (8h2 + 4h + 1)t.

(4h + 2) − gonal triples

(h, k, g) (m, n) (p, q, r) (a, b, c)

(1, 6, 4) (3, 2) (5, 12, 13) (5, 11, 12)

(5, 2) (21, 20, 29) (14, 13, 19)

(5, 4) (9, 40, 41) (9, 38, 39)

(7, 2) (45, 28, 53) (18, 11, 21)

(7, 4) (33, 56, 65) (11, 18, 21)

(7, 6) (13, 84, 85) (13, 81, 82)

(9, 2) (77, 36, 85) (11, 5, 12)

(9, 4) (65, 72, 97) (13, 14, 19)

(9, 8) (17, 144, 145) (17, 140, 141)

(11, 2) (117, 44, 125) (104, 39, 111)

(11, 4) (105, 88, 137) (60, 50, 78)

(11, 6) (85, 132, 157) (68, 105, 125)

(11, 8) (57, 176, 185) (38, 116, 122)

(11, 10) (21, 220, 221) (21, 215, 216)

(2, 10, 83) (5, 4) (9, 40, 41) (9, 37, 38)

(7, 4) (33, 56, 65) (33, 55, 64)

(9, 4) (65, 72, 97) (52, 57, 77)

(9, 8) (17, 144, 145) (17, 138, 139)

(11, 4) (105, 88, 137) (90, 75, 117)

(11, 8) (57, 176, 185) (57, 174, 183)

(3, 14, 125

) (7, 6) (13, 84, 85) (13, 79, 80)

(11, 6) (85, 132, 157) (85, 131, 156)

Page 176: Recreational Mathematicsmath.fau.edu/yiu/Oldwebsites/RM2006/RM2006.pdf · 2006. 7. 26. · Recreational Mathematics Paul Yiu Department of Mathematics Florida Atlantic University

1214 Polygonal triples

36.5 Correspondence between (2h + 1)-gonal and 4h-gonal triples

Let k1 < k2 be two positive integers ≥ 5. Theorem 2 suggests that thereis a one-to-one correspondence between k1-gonal triples and k2-gonaltriples, provided (k1 − 2)′ = (k2 − 2)′. This is the case if and only if

k1 = 2h + 1, k2 = 4h, for some h ≥ 2. (36.12)

In this case, (k1 − 2)′ = (k2 − 2)′ = 2h − 1, while (k1 − 4)′ = 2h − 3,and (k2−4)′ = 2h−2. The (2h+1)-gonal triple (a, b, c) and a 4h-gonaltriple (a′, b′, c′) are related by

(m − n)(c − c′) ≡ n

2h − 1(mod m2 + n2).

(2h + 1) − gonal and 4h − gonal triples

(2h + 1) − gonal 4h − gonal(h, 2h + 1, 4h) (m, n) (p, q, r) (a, b, c) (a′, b′, c′)

(2, 5, 8) (4, 1) (15, 8, 17) (7, 4, 8) (14, 8, 16)(4, 3) (7, 24, 25) (7, 23, 24) (7, 22, 23)(5, 2) (21, 20, 29) (5, 5, 7) (10, 10, 14)(7, 4) (33, 56, 65) (4, 7, 8) (8, 14, 16)(7, 6) (13, 84, 85) (13, 82, 83) (13, 80, 81)(8, 3) (55, 48, 73) (22, 19, 29) (44, 38, 58)(8, 5) (39, 80, 89) (35, 72, 80) (31, 64, 71)(10, 1) (99, 20, 101) (48, 10, 49) (96, 20, 98)(10, 3) (91, 60, 109) (26, 17, 31) (52, 34, 62)(10, 7) (51, 140, 149) (40, 110, 117) (29, 80, 85)(10, 9) (19, 180, 181) (19, 177, 178) (19, 174, 175)

(3, 7, 12) (6, 1) (35, 12, 37) (16, 6, 17) (33, 12, 35)(6, 5) (11, 60, 61) (11, 57, 58) (11, 56, 57)(7, 2) (45, 28, 53) (33, 21, 39) (44, 28, 52)(8, 3) (55, 48, 73) (27, 24, 36) (36, 32, 48)(8, 5) (39, 80, 89) (39, 79, 88) (26, 52, 58)(9, 4) (65, 72, 97) (24, 27, 36) (32, 36, 48)

(4, 9, 16) (8, 1) (63, 16, 65) (29, 8, 30) (60, 16, 62)(8, 7) (15, 112, 113) (15, 107, 108) (15, 106, 107)(9, 2) (77, 36, 85) (18, 9, 20) (37, 18, 41)(10, 3) (91, 60, 109) (75, 50, 90) (90, 60, 108)(10, 7) (51, 140, 149) (17, 45, 48) (51, 138, 147)

(5, 11, 20) (10, 1) (99, 20, 101) (46, 10, 47) (95, 20, 97)(10, 9) (19, 180, 181) (19, 173, 174) (19, 172, 173)