<<

Recreational Mathematics

Paul Yiu

Department of Mathematics Florida Atlantic University

Summer 2003

Version 030131

Contents

1 Graph Labelings 1 1.1 Magic hexagrams ...... 1

2 The Geoboard 3 2.1 Stretch: A geoboard game ...... 3 2.2 Proof of Pick’s theorem ...... 3 2.3 Geoboard triangles with one interior point ...... 3 2.3.1 Geoboard polygons can never be regular ...... 4

3 Prime Numbers 5 3.0.2 Is 2 · 3 · 5 ···P + 1 a prime? ...... 5 3.1 Prime links ...... 10 3.2 primes ...... 10 3.2.1 Near-repunit primes ...... 11 3.2.2 Near primes ...... 11 3.3 Palindromic primes ...... 14 3.4 Primes in π ...... 14 3.5 Perfect numbers ...... 16 3.5.1 The first 10 perfect numbers ...... 16 3.6 Abundant and deficient numbers ...... 17

4 Number Trivia 19

5 Pell’s equation 21

6 Heron triangles 23 6.1 Perfect cuboid ...... 23

7 Interpolation 25 7.0.1 Method of differences ...... 25 7.0.2 Another pattern ...... 26 7.0.3 Derivatives ...... 26

8 The Catalan numbers 29 8.1 ...... 30

Chapter 1

Graph Labelings

1.1 Magic hexagrams

J. R. Hendrick, JRM, 25 (1993) 10–12.

Label the star of David with (consecutive) positive such that the sum of the 4 numbers along each line is constant.

a

b c d e

f g

h i j k

l 2 Graph Labelings

a bcd e fggij k l constant 13 12311125964 8 7 27 1 2610812 4 73511 9 26 1 2712510 4 836 9 11 26 1 289 711 4 6351210 26 1 2810612 4 53711 9 26 1 3511712 4 82610 9 26 1 3612511 4 827 9 11 26 1 3711512 4 62810 9 26 1 389 610 4 7251211 26 2 4511612 3 71810 9 26 2 469 710 3 8151211 26 2 47105 938161112 26 2 489 510 3 6171211 26 2 459 811 2 7161210 26 2 4510712 2 61811 9 26 2 46115 928171012 26 2 479 611 2 5181210 26 Chapter 2

The Geoboard

A lattice polygon is one whose vertices are lattice points, points with coordi- nates. For a lattice polygon, we denote by (i) I the number of interior points, and (ii) B the number of boundary points. B Theorem 2.1 (Pick). The area of a lattice polygon is I + 2 − 1.

2.1 Stretch: A geoboard game

Reference: Math. Mag. 51 (1978) 49–54. Start with a convex lattice polygon enclosed by rubber bands. Players take turn to modify the figures subject to the rules: (1) The modified figure must be convex. (2) The number I of interior lattice points cannot change. (3) The number B of boundary points must increase. (4) At most one side can be disturbed. (Extending a side does not disturb the side). The player who cannot move loses. This paper shows that the game must end by proving B ≤ 9I for a convex polygon. But the bound is far from the best.

2.2 Proof of Pick’s theorem

Reference: A. Liu, Math. Mag., (1979) A. Liu, Crux Math., 4 (1978) A primitive geoboard triangle is one without interior point, i.e., I =0. 1 The area of a primitive geoboard triangle must be 2 .

2.3 Geoboard triangles with one interior point

Reference: Charles S. Weaver, Math. Mag., 50 (1977) 92–94. 4 The Geoboard

Theorem 2.2 (Weaver). If a geoboard triangle has exactly one point in the interior and B points on its boundary, then B =3, 4, 6, 8, or 9. These numbers are all possible. Construct explicit examples.

2.3.1 Geoboard polygons can never be regular π The only values of n for which sin n is rational is n =6. Chapter 3

Prime Numbers

The file PrimeTable.txt contains a list of first 100,000 prime numbers. Euclid’s proof of the infinitude of prime numbers. G.H. Hardy, A Mathematician’s Apology:

The proof is by reductio ad absurdum, and reductio ad absurdum, which Euclid loved so much, is one of a mathematician’s finest weapon. It is a far finer gambit than any chess gambit: a chess player may offer the sacrifice of a pawn or even a prize, but a mathematician offers the game.

3.0.2 Is 2 · 3 · 5 ···P + 1 a prime?

2+1=3, 2 · 3+1=7, 2 · 3 · 5+1=31, 2 · 3 · 5 · 7+1=211, 2 · 3 · 5 · 7 · 11 + 1 =2311, 2 · 3 · 5 · 7 · 11 · 13 + 1 =30031, 2 · 3 · 5 · 7 · 11 · 13 · 17 + 1 =510511, 2 · 3 · 5 · 7 · 11 · 13 · 17 · 19 + 1 =9699691, 2 · 3 · 5 · 7 · 11 · 13 · 17 · 19 · 23 + 1 =223092871, 2 · 3 · 5 · 7 · 11 · 13 · 17 · 19 · 23 · 29 + 1 =6469693231, 2 · 3 · 5 · 7 · 11 · 13 · 17 · 19 · 23 · 29 · 31 + 1 =200560490131, . .

The next string for which 2 · 3 · 5 ···P +1is prime has length 75, with P = 379 6 Prime Numbers and the prime has 154 digits

17196201054584064334833405683175430195845756358957 42560438771105058321655238562613083979651479555788 00999455782202456522693290629520826275682227566369 4111.

The next time this is time, the string has 171 primes and the last prime is 1019. It is interesting to note that the very next string (with 172 primes ending at 1021) also gives a prime.

Guy’s Example 11

[I]f you go to the next prime, its difference from the product is always a prime.

If there are m primes numbers less than the product 2 · 3 ···p k, then

pm+2 − 2 · 3 ···pk is a prime. This seems to be the rule for the five lines. The skipped over are 3, 7, 31, 211 and 2311. But in the next line, Guy did not jump over 30047 to 30059. The difference is 29. Likewise, the primes in the next two lines are 510551 and 9699727. The differences are 41 and 37.

5 − 2=3, 11 − 2 × 3=5, 37 − 2 × 3 × 5=7, 223 − 2 × 3 × 5 × 7=13, 2333 − 2 × 3 × 5 × 7 × 11 =23, 30047 − 2 × 3 × 5 × 7 × 11 × 13 =17, 510529 − 2 × 3 × 5 × 7 × 11 × 13 × 17 =19, 9699713 − 2 × 3 × 5 × 7 × 11 × 13 × 17 × 19 =23, 7

kpm+2 differnce 6 30059 29 7 510551 41 8 9699727 37 9 223092917 47 10 6469693319 89 11 200560490197 67 12 7420738134911 101 13 304250263527317 107 14 13082761331670097 67 15 614889782588491519 109 16 32589158477190044803 73 17 1922760350154212639159 89 18 117288381359406970983437 167 19 7858321551080267055879229 139 20 557940830126698960967415619 229 According to Guy, this is called Fortune’s conjecture. Here are the primes for the first 100 cases.

(1, 3) (1, 5) (1, 7) (1, 13) (1, 23) (17, 29) (19, 41) (23, 37) (37, 47) (61, 89) (1, 67) (61, 101) (71, 107) (47, 67) (107, 109) (59, 73) (61, 89) (109, 167) (89, 139) (103, 229) (79, 163) (151, 193) (197, 269) (101, 157) (103, 173) (233, 523) (223, 233) (127, 157) (223, 251) (191, 193) (163, 179) (229, 383) (643, 647) (239, 311) (157, 223) (167, 317) (439, 509) (239, 457) (199, 211) (191, 503) (199, 251) (383, 479) (233, 617) (751, 1019) (313, 347) (773, 863) (607, 827) (313, 349) (383, 389) (293, 563) (443, 601) (331, 419) (283, 367) (277, 349) (271, 449) (401, 829) (307, 397) (331, 811) (379, 563) (491, 521) (331, 773) (311, 359) (397, 643) (331, 449) (353, 419) (419, 823) (421, 631) (883, 1129) (547, 863) (1381, 1609) (457, 797) (457, 683) (373, 409) (421, 461) (1, 409) (1061, 1319) (523, 607) (499, 661) (619, 1231) (727, 1409) (457, 941) (509, 631) (439, 503) (911, 991) (461, 619) (823, 1031) (613, 1361) (617, 659) (1021, 1063) (523, 617) (941, 1409) (653, 1163) (601, 641) (877, 941) (607, 691) (631, 733) (733, 1097) (757, 1229) (877, 1087) (641, 751)

How about 2 · 3 · 5 ···P − 1? Harvey Dubner, Recursive prime generating sequences, Journal of Recreational Math- ematics, 29 (1998) 170–175. Construct an increasing sequence of primes

p1,p2,...,pn,... n such that each Qn = k=1 pk +1is prime. Dubner has 2, 3, 5, 7, 11, 19, 29, 37, 97, 107, 157, ... It does not seem to be right. I have 47 after 37: 2 × 3 × 5 × 7 × 11 × 19 × 29 × 37 =4709397, 2 × 3 × 5 × 7 × 11 × 19 × 29 × 37 × 47 =2213416591, and then 67, 103, 179, 191, 223, 271 .... Here is a Mathematica program: 8 Prime Numbers

Block[{n, p, Q, c, qq}, c =1; Q =3; qq =3; While[c<40000, While[!PrimeQ[qq],c ++; qq =(Q − 1) ∗ Prime[c]+1]; Q = qq;Print[Prime[c]];c ++; qq =(Q − 1) ∗ Prime[c]+1]]

Up to the first 10,000 primes

2357111929374767 103 179 191 223 271 293 317 577 643 673 809 863 877 1049 1093 1129 1151 1381 1613 1637 2089 2131 2311 2957 3623 3833 4253 4271 4423 4673 5939 7717 8167 9133 9533 9539 9679 11059 11743 11969 14759 15859 15971 16139 17431 17713 17761 19309 19373 20747 20983 23741 25261 25933 26501 26627 30859 30869 30881 31219 31957 32647 33049 37087 40487 40531 42019 44059 48239 48781 52181 53309 53323 54437 54787 55603 56401 57809 62219 64091 64997 65011 67231 67601 68687 70373 71171 71527 72277 74231 76819 77431 77933 81929 85381 86137 86711 86857 87179 87491 91303 97001 97231 97379 104579 104717 110269

pn Qn = p1 ···pn +1 23 37 531 7 211 11 2311 19 43891 29 1272811 37 47093971 47 2213416591 67 148298911531 103 15274787887591 179 2734187031878611 191 522229723088814511 223 116457228248805635731 271 31559908855426327282831 293 9247053294639913893869191 317 2931315894400852704356533231 577 1691369271069292010413719673711

Exercise

Variations of the theme: (1) do not require p1, p2,...,tobeprime numbers. n n (2) replace Qn by k=1 pk − 1 or k=1 pk ± 1. 9

2p1 · p2 ···pn − 1=prime.

3 5 13 23 37 53 67 79 157 173 191 197 277 281 461 479 503 619 829 907 997 1033 1303 1459 1493 1663 2357 2467 3331 3347 3407 4093 4441 4591 4987 5179 5189 6911 8807 ...

pn Qn =2p1 ···pn − 1 35 529 13 389 23 8969 37 331889 53 17590169 67 1178541389 79 93104769809 157 14617448860169 173 2528818652809409

n n (3) require both k=1 pk +1and k=1 pk − 1 to be primes. 10 Prime Numbers

3.1 Prime links

A prime link of length n is a permutation of 1, 2, . . . n beginning with 1 and ending with n such that the sum of each pair of adjacent terms is prime. This was proposed and solved by Morris Wald [12]. For n ≤ 6, the link is unique. For n =7there are two links: 1, 4, 3, 2, 5, 6, 7 and and 1, 6, 5, 2, 3, 4, 7. Wald suggested working backwards. Start with n and precede it with the greatest remaining member of the set whose sum with n is a prime, and repeat in like fashion. Here are the first 20 links:

1. 1, 2. 1, 2, 3. 1, 2, 3, 4. 1, 4, 3, 2, 5. 1, 4, 3, 2, 5, 6. 1, 4, 3, 2, 5, 6, 7. 1, 2, 3, 4, 7, 6, 5, 8. 1, 2, 3, 4, 7, 6, 5, 8, 9. 1, 2, 3, 4, 7, 6, 5, 8, 9, 10. 1, 4, 3, 2, 5, 6, 7, 10, 9, 8, 11. 1, 4, 3, 2, 5, 6, 7, 10, 9, 8, 11, 12. 1, 4, 3, 2, 5, 6, 7, 12, 11, 8, 9, 10, 13. 1, 2, 5, 8, 3, 4, 7, 12, 11, 6, 13, 10, 9, 14. 1, 2, 5, 8, 3, 4, 7, 12, 11, 6, 13, 10, 9, 14, 15. 1, 2, 5, 8, 3, 4, 7, 12, 11, 6, 13, 10, 9, 14, 15, 16. 1, 4, 3, 2, 5, 6, 7, 12, 11, 8, 9, 10, 13, 16, 15, 14, 17. 1, 4, 3, 2, 5, 6, 7, 10, 9, 8, 11, 12, 17, 14, 15, 16, 13, 18. 1, 4, 3, 2, 5, 6, 7, 10, 9, 8, 11, 12, 17, 14, 15, 16, 13, 18, 19. 1, 4, 3, 2, 5, 6, 7, 10, 9, 8, 11, 12, 19, 18, 13, 16, 15, 14, 17, 20. Guy [7, C1] calls this a prime pyramid, and commented that Wald’s solutions “are almost certain to work, but a proof of this may be as difficult as proving the Goldbach conjecture”.

Exercise Does this construction cover all primes (except 2) up to 2n? This is the case for very small n, and also for n =8, 9, 10. Up to n =27, there is at most one more missing prime. What are the missing primes (apart from 2) for n =11,...,20? In these cases, can you find another construction of the prime link with all primes (between 3 and 2n − 1) covered?

3.2 Repunit primes

Rn =1n. 3.2 Repunit primes 11

Samuel Yates.

Records of repunit primes.

3.2.1 Near-repunit primes

Caldwell and Dubner: JRM, 27 (1995) 35–41.

Rn,k := 1n−k−1011k.

3.2.2 Near repdigit primes

C. K. Caldwell, JRM, 21 (1988) 299–304; (1989) 101–109.

31 331 3331 33331 333331 3333331 33333331

all primes. 12 Prime Numbers

3 31 331 3331 33331 333331 3333331 33333331 555551111 2222222111 22222222111 222221111111 5555555555551 77777777777111 888888888888811 7777777771111111 44444444444444411 222222222222222221 8888888888888888881 77777777777777777771 666666666666666666661 6666666666666666666661 77777777777777777777771 222222222222222222211111 4444444444444444444444411 33333333333333333333311111 888888888888888888888811111 4444444444444444444444444441 77777777777777777777777711111 666666666666611111111111111111 7777777777777777777777777777771 33333333333333333333333331111111 999999999999999999999999999999991 6666666666666666666666666661111111 22222222222222222222222222222222111 333333333333333333333331111111111111 3333333333333333333333333333333311111 22222222222222222222222222222111111111 222222222222222222222222222222222211111 3333333333333333333333333333333333333331 44444444444444444444444444444444441111111 333333333333333333333333311111111111111111 6666666666666666666666666666666666666666661 44444444444444444444444444444444444444411111 999999999999999999999999999999999999999999991 7777777777777777777777777777777777711111111111 77777777777777777777777777777777777777777771111 999999999111111111111111111111111111111111111111 7777777777777777777777777777777777777777777711111 33333333333333333333333333333333333333333333333331 222222222222222222222222222222222222222222211111111 9999999999999999999999999999999991111111111111111111 99999999999999999999999999999999999991111111111111111 222222222222222222222222222222222222222222211111111111 4444444444444444444444444444444444444444444444444444441 99999999999999999999999999999999999999999999999999911111 555555555555555555555555555555555555555555555555555511111 9999999999999999999999999999999999999999999999999991111111 88888888888888888888888888888888888888888888888888888111111 333333333333333333333333333333333333333333333333333333333331 2222222222222222222222222222222222222222222222222222222111111 44444444444444444444444444444444444444444444444444444111111111 666666666666666666666666666666666666666666666666666611111111111 9999999999999999999999999999999999999999999999999999999991111111 22222222222222222222222222222222222222222222222211111111111111111 666666666666666666666666666666666666666666666666666666666666666661 2222222222222222222222222222222222222222222222222222222222221111111 77777777777777777777777777777777777777777777777771111111111111111111 333333333333333333333333333333333333333333333333333333331111111111111 9999999999999999999999999999999999999999999999999991111111111111111111 3.2 Repunit primes 13

Almost without efforts, 3k1 is prime for

k =17, 39, 49, 59, 77, 100, 150,

1777777777 1111111999 2777777777 2222222111 4441111111 4447777777 4444444777 4444444447 4444444999 5555555557 6666666661 8881111111 8888888111 8777777777 8888888777 9991111111

Length 50:

(41, 9) 11111111111111111111111111111111111111111999999999 (49, 1) 11111111111111111111111111111111111111111111111119 (17, 33) 22222222222222222111111111111111111111111111111111 (29, 21) 22222222222222222222222222222777777777777777777777 (49, 1) 33333333333333333333333333333333333333333333333331 (7, 43) 44444441111111111111111111111111111111111111111111 (7, 43) 44444443333333333333333333333333333333333333333333 (17, 33) 44444444444444444333333333333333333333333333333333 (1, 49) 53333333333333333333333333333333333333333333333333 (29, 21) 55555555555555555555555555555777777777777777777777 (37, 13) 55555555555555555555555555555555555559999999999999 (47, 3) 77777777777777777777777777777777777777777777777111 (1, 49) 79999999999999999999999999999999999999999999999999 (9, 41) 99999999977777777777777777777777777777777777777777 (27, 23) 99999999999999999999999999977777777777777777777777 (31, 19) 99999999999999999999999999999997777777777777777777 14 Prime Numbers

Length 60:

(37, 23) 111111111111111111111111111111111111133333333333333333333333 (31, 29) 333333333333333333333333333333311111111111111111111111111111 (47, 13) 333333333333333333333333333333333333333333333331111111111111 (49, 11) 333333333333333333333333333333333333333333333333311111111111 (59, 1) 333333333333333333333333333333333333333333333333333333333331 (17, 43) 555555555555555551111111111111111111111111111111111111111111 (47, 13) 555555555555555555555555555555555555555555555557777777777777 (19, 41) 999999999999999999977777777777777777777777777777777777777777

Length 100:

171729, 181719, 187713 29911, 311789, 411389, 447353, 439761, 489911, 511989, 79911, 731969, 773927, 89317, 857743, 873727,

3.3 Palindromic primes

101 11311 1114111 111181111 11117771111 1111118111111 111111151111111 11111118881111111 1111111111111111111 111111111161111111111 11111111111111111111111 1115555555555555555555111

3.4 Primes in π

Caldwell and Dubner: JRM, 29 (1998) 282–289. 3.4 Primes in π 15

Projects

Search records for primes of the following types:

• palindrome

• almost repdigit primes: NR(n, k; a, b):=an−k−1b1ak. Caldwell and Dubner, JRM, 28 (1996–1997) 1–9.

• palindromic prime pyramids, Honaker and Caldwell, JRM, 30 (1999–2000) 169– 176.

n • Mersenne primes Mn =2 − 1. 16 Prime Numbers

3.5 Perfect numbers

A number is perfect is the sum of its proper (including 1) is equal to the number itself. 1. (Euclid): If 1+2+22+···+2k−1 =2k −1 is a prime number, then 2k−1(2k −1) is a . 2. (Euler): Every even perfect number is of the form given by Euclid. 3. Dudley, Cranks, pp. 243–244. 4. (Open problem): Does there exist an odd perfect number? 5. A theorem-joke by Hendrik Lenstra: Perfect squares do not exist. 1

Proof. Suppose n is a perfect square. Look at the odd divisors of n. They all divide the largest of them, which is itself a square, say d2. This shows that the odd divisors of n come in pairs a, b where a · b = d2. Only d is paired to itself. Therefore the number of odd divisors of n is also odd. In particular, it is not 2n. Hence n is not perfect, a contradiction: perfect squares don’t exist.

3.5.1 The first 10 perfect numbers

23 6 37 28 5 31 496 7 127 8128 13 8191 33550336 17 131071 8589869056 19 524287 137438691328 31 2147483647 2305843008139952128 61 2305843009213693951 2658455991569831744654692615953842176 89 618970019642690137449562111 191561942608236107294793378084303638130997321548169216

Some curiosa given by C. W. Trigg [11].

• P1 is the differenc of the digits of P2.InP2, the units digit is the 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 last digits of P4 are like cubes. The sums of the digits of P3 and P4 are the same, namely, the prime 19.

2 • P4 terminates both P11 and P14.

• Three 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 nonzero digits at least once. It is zerofree.

• P10 is the smallest perfect number to contain each of the ten decimal digits at least once. 1Math. Intelligencer, 13 (1991) 40. 2These contain respectively 65 and 366 digits. 3.5 Perfect numbers 17

Exercise

The isle of Pythagora, while very sparsely populated, is capable of supporting a population of thirty million. On the 6th day of the 28th anniversary of his accession to the throne, the king of the island called a meeting of his 496 advisors to decide how to celebrate the auspicious occasion. They decided to divide the regal jewels among the people of the land. All the people, including the king the advisors, were lined up in a single file, and the jewels were distributed as follows. Starting with the second in line, each person was given one jewel. Starting with the 4th in line, each second person was given two jewels. Starting with the 6th in line, each third person was given three jewels. Starting with the 8th in line, each fourth person was given four jewels, and so on. The man at the extreme end of the line noticed that the number of jewels he received corresponded to his position in line. How many people were there in Pythagora ? 18 Prime Numbers

3.6 Abundant and deficient numbers

A number n is abundant, perfect, or deficient if the sum of its proper divisors (including 1 but excluding n itself) is greater than, equal to, or less than n. If we denote by σ(n) the sum of all divisors of n, including 1 and n itself, then n is abundant, perfect, or deficient according as σ(n) is greater than, equal to, or less than 2n. The advantage of using σ(n) is that it can be easily computed if we know how n factors into primes: 3  ak Proposition 3.1. If n = k pk , then

 a +1 p k − 1 σ(n)= . k − k p 1

What numbers are obviously deficient? 4 All multiples of 6 are abundant. But not conversely. 20 is abundant. Are all odd numbers deficient? It is not true! 945 is the first odd abundant number. 4095 is also abundant, but 4096 = is perfect! 5775 and 5776 are the first pair of abundant numbers. Pairs of consecutive abundant numbers up to 10,000:

5775, 5776 5984, 5985 7424, 7425 11024, 11025 21735, 21736 21944, 21945 26144, 26145 27404, 27405 39375, 39376 43064, 43065 49664, 49665 56924, 56925 58695, 58696 61424, 61425 69615, 69616 70784, 70785 76544, 76545 77175, 77176 79695, 79696 81080, 81081 81675, 81676 82004, 82005 84524, 84525 84644, 84645 89775, 89776 91664, 91665 98175, 98176 ... Always the odd number smaller? True up to 150, 000, 000. 171078830,1,2 are the first triple of abundant numbers. (discovered in 1975 by Laurent Hodges and Reid, Pickover, p. 364.)

n factorization σ(n) σ(n) − 2n 171078830 2 · 5 · 13 · 23 · 29 · 1973 358162560 16004900 171078831 33 · 7 · 11 · 19 · 61 · 71 342835200 677538 171078832 24 · 31 · 344917 342158656 992 Abundant numbers up to 200: 12,18,20,24,30,36,40,42,48,54,56,60,66,70,72,78,80,84,88,90,96,100,102,104,108,112,114,120,126,132,138,1 196,198,200 20: 1, 2, 4, 5, 10. Deficient even numbers up to 200: 2,4,8,10,14,16,22,26,32,34,38,44,46,50,52,58,62,64,68,74,76,82,86,92,94,98, 106,110,116,118,122,124,128,13 172,178,182,184,188,190,194. Still more deficient numbers than abundant numbers.

3In Mathematica, σ(n) is given by DivisorSigma[1, n]. 4Primes 3.6 Abundant and deficient numbers 19

 σ(n)= d. d|n Check Honsberger on superabundant numbers. 20 Prime Numbers Chapter 4

Number Trivia

1. What is the largest prime what square has no duplicate digit? 1 If p2 has no duplicate digits, p2 < 1010 and p<105. There are π(105) below 105. We start from the top.

2. Twigg: 2 There is only one 5-digit number whose last three digits are alike and whose square has no duplicate digits. Th´ebault: 3 Determine the largest and smallest perfect squares which can be written with the 10 digits used one each in both cases. 4

3. JRM 2543: 5 Pandigital society number.

4. Knuth: 6 A positive integer is sorted if its digits in its decimal notation are non- decreasing from left to right. 2 (i) If n =3h6k7, then n is sorted. For example,

2 33647 =13334263849.

What is the square of 3h6k71? (ii) Which positive integers n are such that n and n2 are both sorted? See also Blecksmith and Nicol, Monotonic numbers, Math. Mag., 66 (1993) 257–262.

5. Twigg, Permutation-twin square integers, JRM, 21 (1989) 170–173. N 2 and (N +1)2 have the same digit set; they have the same .

1C. W. Trigg, E 385.396.S404. 2Twigg, E389.397.S405. 3E404.401.S408. 432043 and 99066. 5JRM, 30 (1999–2000) 227. 6MG1234.861.S871. 22 Number Trivia

The digital roots of successive integers form a periodic sequence 1, 4, 9, 7, 7, 4, 1, 9,...

132 = 169, 142 = 196; 1572 = 24649, 1582 = 24964; 9132 = 833569, 1592 = 835396; 45132 = 20367169, 45142 = 20376196. How about not requiring equality of multiplicities? 6. Charles Twigg, JRM, 24 (1992) 5: What three-digit squares have the following characteristics? (a) are palindromes. (b) are permutations of consecutive digits. (c) form reversal pairs. (d) are three permutations of the same digit set. (e) three of its permutations are prime. (f) the sum of the digits is 19. (g) is also a cube. (h) the central digit is perfect. (i) are composed of even digits. (j) the central digit is a nonzero cube. 7. JRM 2049, 25 (1993) 156–157. (a) Use each of the digits 1 through 9 once to form prime numbers such that the sum of the primes is as small as possible. What is this sum? (b) Use each of the digits 0 through 9 once to form prime numbers such that the sum of the primes is as small as possible. What is this sum? Answers: (a) are palindromes. 121, 484, 676 (b) are permutations of consecutive digits. 324, 576 (c) form reversal pairs. 144 and 441; 169 and 961 (d) are three permutations of the same digit set. 169, 196, 961 (e) three of its permutations are prime. 163, 613, 631 of 361 (f) the sum of the digits is 19. 289, 676, 784 (g) is also a cube. 729 (h) the central digit is perfect. 169, 361, 961 (i) are composed of even digits. 400, 484, (j) the central digit is a nonzero cube. 289, 484, 784 Chapter 5

Pell’s equation

1. Ramanujan’s house number. 2. An unidentified country has 7-digit population – and everyone has been given a National ID Number, sequentially from one, allocated by no identifiable logic. The Censure Minister has chosen three names at random, and is finding their ID number on the computer. When the first number appears on the screen, the Gov- ernment’s mathematical whizz-kid informs the Minister that there is precisely a 50-50 chance that the other two numbers will both be less than the one just displayed. What is the population, and what is the first number? 1 3. Heron triangle of consecutive sides. Solution in MG.

1Problem 2585, JRM, 31 (2002–2003) 71. 24 Pell’s equation Chapter 6

Heron triangles

From the MathWorld: 1 A Heronian tetrahedron, also called a perfect tetrahedron, is a (not neces- sarily regular) tetrahedron with rational sides, face areas, and volume. The smallest examples of integer Heronian tetrahedra composed of four identical copies of a single acute triangle have pairs of opposite sides (148, 195, 203), (533, 875, 888), (1183, 1479, 1804), (2175, 2296, 2431), (1825, 2748, 2873), (2180, 2639, 3111), (1887, 5215, 5512), (6409, 6625, 8484), and (8619, 10136, 11275) (Guy 1994, p. 190; Buchholz 1992). The only integer Heronian tetrahedron with maximum side length less than 156 has edge lengths 51, 52, 53, 80, 84, 117, faces (117, 80, 53), (117, 84, 51), (80, 84, 52), (53, 51, 52), face areas 1170, 1800, 1890, 2016, and volume 18144 (Buchholz 1992; Guy 1994, p. 191).

6.1 Perfect cuboid

From the MathWorld: 2 A solution giving integer space and face diagonals with only a single nonintegral polyhedron edge is √ a = 18720, b = 211773121, c = 7800, dab = 23711, dbc = 16511, dca = 20280, dabc = 24961.

1http://mathworld.wolfram.com/HeronianTetrahedron.html 2http://mathworld.wolfram.com/PerfectCuboid.html 26 Heron triangles Chapter 7

Interpolation

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

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

What is f(n +1)? It is tempting to answer with 2n+1, but this assumes f(x)=2x, not a polynomial. There is the famous Lagrange interpolation formula to find such a polynomial. If the value of a polynomial of degree ≤ n are given at n +1distinct points, the polynomial is uniquely determined. More precisely, if

f(x0)=y0,f(x1)=y1, ..., f(xn)=yn,

n then by putting gi(x)= k=i(x − xk) for k =0,1,...,n,wehave n gk(x) f(x)= yk · . k k k=0 g (x )

Here is an approach to the problem, by considering the successive differences. If f(x) is a polynomial of degree n, then f(x +1)− f(x) is a polynomial of degree n − 1. Suppose the values of f(x) are given at n +1consecutive integers 0, 1, ...,n. Then we can easily find the values of f(x +1)− f(x) at1,2...,n. By repeating the process, we obtain the values of

7.0.1 Method of differences 1, 2, 4, 8, 16, 31, 57, 99 1, 2, 4, 8, 15, 26, 42 1, 2, 4, 7, 11, 16 1, 2, 3, 4, 5 1, 1, 1, 1 f(n +1)=2n+1 − 1. 28 Interpolation

What is f(n +2)? How does the sequence

1, 4, 11, 26, 57 continue? The differences are 3, 7, 15, 31,.... The next two terms are therefore 120 and 247.

f(n +2)=1+(22 − 1) + (23 − 1) + ···+(2n+1 − 1) =2n+2 − (n +3).

What about negative values?  0ifn is odd, f(−1) = 1ifn is even.

The values of f(−2) are

2, −2, 3, −3, 4, −4, ... for n =2, 3, 4, 5, 6, 7,....

7.0.2 Another pattern

1 Now suppose we have a polynomial f(x) of degree n with given values

x 012345··· n 1 1 1 1 1 1 f(x)1 2 3 4 5 6 ··· n+1

What are f(n +1)and f(n +2)? 2 Answer: If n is odd, f(n +1)= n+1 and f(n +2)=1. n If n is even, f(n +1)=0and f(n +2)=− n+2 .

7.0.3 Derivatives For distinct indices i and j, let  gi,j = (x − xk). k=i,j

What is the derivative of gi?

1See also [8, pp.174–175]. 29

 log gi(x)= log(x − xj); j=i g(x)  1 i = i − j g (x) j=i x x  gi(x)= gi,j (x). j=i 30 Interpolation Chapter 8

The Catalan numbers

  1 2n Cn = . n +1 n n Cn+1 = CnCn−k,C0 =1. k=1 The first 20 Catalan numbers are

C0 =1,C1 =1,C2 =2,C3 =5, C4 =14,C5 =42,C6 = 132,C7 = 429, C8 = 1430,C9 = 4862,C10 = 16796,C11 = 58786, C12 = 208012,C13 = 742900, C14 = 2674440,C15 = 9694845, C16 = 35357670, ···

• Catalan:

• Guy’s Example 74: The number of ways 2n people at a round table can shake hands in pairs without their hands crossing.

• Euler: Cn is the number of triangulations of a convex (n +2)-gon into nonover- lapping triangles.

• Cn is the numbers of arrangements of n 1’s and n −1’s so that the partial sums are all nonnegative. 1   n 1More generally, if denotes the number of arrangements of n 1’s and k −1’s so that the partial k   n = ≥ ≥ 2 sums of all nonnegative, then 1 n, and for n k ,    n (n − k +1)(n +2)···(n + k) n − k +1 n + k = = . k k! n +1 k See D. F. Bailey, Counting arrangements of 1’s and −1’s, Math. Mag., 69 (1996) 128–131. 32 The Catalan numbers

– The number of mountain ranges you can draw with n upstrokes and n downstrokes. 2 Suppose A and B are candidates for office and there are 2n voters, n voting for A and n for B. – In how many ways can the ballots be counted so that A is always ahead of 3 or tied with B ? The answer is Cn.

• Singmaster, Monthly, 85 (1978) 366–368.

4 • Cn is the number of ways of arranging n pairs of parentheses meaningfully. •

8.1

k The only odd Catalan numbers are Cn for n =2 − 1.

2Guy’s Example 71. 3Hilton-Pederson, Math. Intelligencer, 13.? (1991) 64–75. 4Guy, end of Strong law of small numbers. Bibliography

[1] A. Beiler, Recreations in the Theory of Numbers, Dover, 1963. [2] J. H. Conway and R. K. Guy, The Book of Numbers, Springer, 1996. [3] U. Dudley, Mathematical Cranks, Math. Assoc. America, 1992. [4] R. K. Guy, The strong law of small numbers, Amer. Math. Monthly, 95 (1988) 697–712. [5] R. K. Guy and C. Springer, Problem 1367, Crux Math., 14 (1988) 202; solution, 15 (1989) 278–279. [6] R. K. Guy, The second strong law of small numbers, Math. Mag., 63 (1990) 3–20. [7] R. K. Guy, Unsolved Problems in , 2nd edition, Springer, 1994.

[8] R. Honsberger, In Polya’s´ Footsteps, Math. Assoc. America, 1997. [9] D. E. Knuth, Fundamental Algorithms, 2nd edition, Addison-Wesley, 1973. [10] P. Ribenboim, The New Book of Prime Number Records, Springer, 1996.

[11] C. W. Trigg, Some curiosa involving the first ten perfect numbers, Jour. Recre- ational Math., 23 (1991) 286. [12] M. Wald, Solution to Problem 1664, Jour. Recreational Math., 21 (1989) 236– 237.