Answers to Exercises

Every exercise is answered here (at least briefly), and some of these answers go beyond what was asked. Readers will learn best if they make a serious attempt to find their own answers BEFORE PEEKING at this appendix.

The authors will be interested to learn of any solutions (or partial solutions) to the research problems, or of any simpler (or more correct) ways to solve the non-research ones.

(The first finder of every error in this book will receive a reward of $2.56.)

1.1 The proof is fine except when n \= 2 . If all sets of two horses have horses of the same color, the statement is true for any number of horses.

Does that mean I have to find every error?

1.2 If X n is the number of moves, we have X 0 \= 0 and X n \= X n – 1 + 1 + X n – 1 + 1 + X n – 1 when n > 0 . It follows (for example by adding 1 to both sides) that X n \= 3 n − 1 . (After Image moves, it turns out that the entire tower will be on the middle peg, halfway home!)

(We meant to say “any error.”)

Does that mean only one person gets a reward?

1.3 There are 3 n possible arrangements, since each disk can be on any of the pegs. We must hit them all, since the shortest solution takes 3 n − 1 moves. (This construction is equivalent to a “ternary Gray code,” which runs through all numbers from ( 0 . . . 0 ) 3 to ( 2 . . . 2 ) 3 , changing only one digit at a time.)

(Hmmm. Try it and see.)

1.4 No. If the largest disk doesn’t have to move, 2 n – 1 − 1 moves will suffice (by induction); otherwise ( 2 n – 1 − 1 ) + 1 + ( 2 n – 1 − 1 ) will suffice (again by induction).

1.5 No; different circles can intersect in at most two points, so the fourth circle can increase the number of regions to at most 14. However, it is possible to do the job with ovals:

Image

The number of intersection points turns out to give the whole story; convexity was a red herring.

Venn [ 359 ] claimed that there is no way to do the five-set case with ellipses, but a five-set construction with ellipses was found by Grünbaum [ 167 ].

1.6 If the n th line intersects the previous lines in k > 0 distinct points, we get k − 1 new bounded regions (assuming that none of the previous lines were mutually parallel) and two new infinite regions. Hence the maximum number of bounded regions is ( n − 2 )+( n − 3 )+ · · · \= S n – 2 \= ( n − 1 )( n − 2 ) /2 \= L n − 2n .

This answer assumes that n > 0 .

1.7 The basis is unproved; and in fact, H ( 1 ) ≠ 2 .

1.8 Q 2 \= ( 1 + β ) /α ; Q 3 \= ( 1 + α + β ) /αβ ; Q 4 \= ( 1 + α ) /β ; Q 5 \= α ; Q 6 \= β . So the sequence is periodic!

1.9 (a) We get P ( n − 1 ) from the inequality

Image

(b) x 1 . . . x n x n + 1 . . . x 2n ⩽ ((( x 1 + · · · + x n ) /n )(( x n + 1 + · · · + x 2n ) /n ) ) n by P ( n ) ; the product inside is ⩽ (( x 1 + · · · + x 2n ) /2n ) 2 by P ( 2 ) . (c) For example, P ( 5 ) follows from P ( 6 ) from P ( 3 ) from P ( 4 ) from P ( 2 ) .

1.10 First show that R n \= R n – 1 + 1 + Q n – 1 + 1 + R n – 1 , when n > 0 . Incidentally, the methods of Chapter 7 will tell us that Q n = ((1 + Image ) n + 1 – ( 1 – Image ) n + 1 )/( 2 Image ) – 1 .

1.11 (a) We cannot do better than to move a double ( n − 1 ) -tower, then move (and invert the order of) the two largest disks, then move the double ( n − 1 ) -tower again; hence A n \= 2A n – 1 + 2 and A n \= 2T n \= 2 n + 1 − 2 . This solution interchanges the two largest disks but returns the other 2n − 2 to their original order.

(b) Let B n be the minimum number of moves. Then B 1 \= 3 , and it can be shown that no strategy does better than B n \= A n – 1 + 2 + A n – 1 + 2 + B n – 1 when n > 1 . Hence B n \= 2 n + 2 − 5 , for all n > 0 . Curiously this is just 2A n − 1 , and we also have B n \= A n – 1 + 1 + A n – 1 + 1 + A n – 1 + 1 + A n – 1 .

1.12 If all m k > 0 , then A ( m 1 , . . . , m n ) \= 2A ( m 1 , . . . , m n – 1 )+ m n . This is an equation of the “generalized Josephus” type, with solution ( m 1 . . . m n ) 2 \= 2 n – 1 m 1 + · · · + 2m n – 1 + m n .

Incidentally, the corresponding generalization of exercise 11b appears to satisfy the recurrence

Image

1.13 Given n straight lines that define L n regions, we can replace them by extremely narrow zig-zags with segments sufficiently long that there are nine intersections between each pair of zig-zags. This shows that ZZ n \= ZZ n – 1 + 9n − 8 , for all n > 0 ; consequently ZZ n \= 9 S n – 8 n + 1 = Image n 2 – Image n + 1.

1.14 The number of new 3-dimensional regions defined by each new cut is the number of 2-dimensional regions defined in the new plane by its intersections with the previous planes. Hence P n \= P n – 1 + L n – 1 , and it turns out that P 5 \= 26 . (Six cuts in a cubical piece of cheese can make 27 cubelets, or up to P 6 \= 42 cuts of weirder shapes.)

Incidentally, the solution to this recurrence fits into a nice pattern if we express it in terms of binomial coefficients (see Chapter 5 ):

Image

I bet I know what happens in four dimensions!

Here X n is the maximum number of 1-dimensional regions definable by n points on a line.

1.15 The function I satisfies the same recurrence as J when n > 1 , but I ( 1 ) is undefined. Since I ( 2 ) \= 2 and I ( 3 ) \= 1 , there’s no value of I ( 1 ) \= α that will allow us to use our general method; the “end game” of unfolding depends on the two leading bits in n ’s binary representation.

If n \= 2 m + 2 m – 1 + k , where 0 ⩽ k < 2 m + 1 + 2 m − ( 2 m + 2 m – 1 ) \= 2 m + 2 m – 1 , the solution is I ( n ) \= 2k + 1 for all n > 2 . Another way to express this, in terms of the representation n \= 2 m + l , is to say that

Image

1.16 Let g ( n ) \= a ( n ) α + b ( n ) β 0 + c ( n ) β 1 + d ( n ) γ . We know from ( 1.18 ) that a ( n ) α + b ( n ) β 0 + c ( n ) β 1 \= ( α β b m – 1 β b m – 2 . . . β b 1 β b 0 ) 3 when n \= ( 1 b m – 1 . . . b 1 b 0 ) 2 ; this defines a ( n ) , b ( n ) , and c ( n ) . Setting g ( n ) \= n in the recurrence implies that a ( n ) + c ( n ) − d ( n ) \= n ; hence we know everything. [Setting g ( n ) \= 1 gives the additional identity a ( n ) − 2b ( n ) − 2c ( n ) \= 1 , which can be used to define b ( n ) in terms of the simpler functions a ( n ) and a ( n ) + c ( n ) .]

1.17 In general we have W m ⩽ 2W m – k + T k , for 0 ⩽ k ⩽ m . (This relation corresponds to transferring the top m − k , then using only three pegs to move the bottom k , then finishing with the top m − k .) The stated relation turns out to be based on the unique value of k that minimizes the right-hand si de of this general inequality, when m \= n ( n + 1 ) /2 . (However, we cannot conclude that equality holds; many other strategies for transferring the tower are conceivable.) If we set Y n \= ( W n ( n + 1 ) /2 − 1 ) /2 n , we find that Y n ⩽ Y n – 1 + 1 ; hence W n ( n + 1 ) /2 ⩽ 2 n ( n − 1 ) + 1 .

1.18 It suffices to show that both of the lines from ( n 2j , 0 ) intersect both of the lines from ( n 2k , 0 ) , and that all these intersection points are distinct.

A line from ( x j , 0 ) through ( x j − a j , 1 ) intersects a line from ( x k , 0 ) through ( x k − a k , 1 ) at the point ( x j − ta j , t ) where t \= ( x k − x j ) / ( a k − a j ) . Let x j \= n 2j and a j \= n j + ( 0 or n – n ) . Then the ratio t \= ( n 2k − n 2j ) / ( n k − n j + (– n – n or 0 or n – n )) lies strictly between n j + n k − 1 and n j + n k + 1 ; hence the y coordinate of the intersection point uniquely identifies j and k . Also the four intersections that have the same j and k are distinct.

1.19 Not when n > 5 . A bent line whose half-lines run at angles θ and θ + 30 ° from its apex can intersect four times with another whose half-lines run at angles ϕ and ϕ + 30 ° only if 30 ° < | θ − ϕ | < 150 ° . We can’t choose more than 5 angles this far apart from each other. (It is possible to choose 5.)

1.20 Let h ( n ) \= a ( n ) α + b ( n ) β 0 + c ( n ) β 1 + d ( n ) γ 0 + e ( n ) γ 1 . We know from ( 1.18 ) that a ( n ) α + b ( n ) β 0 + c ( n ) β 1 \= ( α β b m – 1 β b m – 2 . . . β b 1 β b 0 ) 4 when n \= ( 1 b m – 1 . . . b 1 b 0 ) 2 ; this defines a ( n ) , b ( n ) , and c ( n ) . Setting h ( n ) \= n in the recurrence implies that a ( n ) + c ( n ) − 2d ( n ) − 2e ( n ) \= n ; setting h ( n ) \= n 2 implies that a ( n ) + c ( n ) + 4e ( n ) \= n 2 . Hence d ( n ) \= ( 3a ( n ) + 3c ( n ) − n 2 − 2n ) /4 ; e ( n ) \= ( n 2 − a ( n ) − c ( n )) /4 .

1.21 We can let q be the least (or any) common multiple of 2n , 2n − 1 , . . . , n + 1 . [A non-rigorous argument suggests that a “random” value of q will succeed with probability

Image

so we might expect to find such a q less than 4 n .]

1.22 Take a regular polygon with 2 n sides and label the sides with the elements of a “de Bruijn cycle” of length 2 n . (This is a cyclic sequence of 0 ’s and 1 ’s in which all n -tuples of adjacent elements are different; see [ 207 , exercise 2.3.4.2–23] and [ 208 , exercise 3.2.2–17].) Attach a very thin convex extension to each side that’s labeled 1 . The n sets are copies of the resulting polygon, rotated by the length of k sides for k \= 0 , 1 , . . . , n − 1 .

I once rode a de Bruijn cycle (when visiting at his home in Nuenen, The Netherlands).

1.23 Yes. (We need principles of elementary number theory from Chapter 4 .) Let L ( n ) \= lcm ( 1 , 2 , . . . , n ) . We can assume that n > 2 ; hence by Bertrand’s postulate there is a prime p between n/2 and n . We can also assume that j > n/2 , since q ′ \= L ( n ) + 1 − q leaves j ′ \= n + 1 − j if and only if q leaves j . Choose q so that q ≡ 1 (mod L ( n ) /p ) and q ≡ j + 1 − n (mod p ). The people are now removed in order 1 , 2 , . . . , n − p , j + 1 , j + 2 , . . . , n , n − p + 1 , . . . , j − 1 .

1.24 The only known examples are: X n \= 2i sin πr + 1/X n – 1 , where r is rational and 0 ⩽ r < Image (all period lengths ⩾ 2 occur as r varies); Gauss’s recurrence of period 5 in exercise 8 ; H. Todd’s even more remarkable recurrence X n \= ( 1 + X n – 1 + X n – 2 ) /X n – 3 , which has period 8 (see [ 261 ]); and recurrences derived from these when we replace X n by a constant times X mn . We can assume that the first nonzero coefficient in the denominator is unity, and that the first nonzero coefficient in the numerator (if any) has nonnegative real part. Computer algebra shows easily that there are no further solutions of period ⩽ 5 when k \= 2 . A partial theory has been developed by Lyness [ 261 , 262 ] and by Kurshan and Gopinath [ 231 ].

An interesting example of another type, with period 9 when the starting values are real, is the recurrence X n \= | X n – 1 | − X n – 2 discovered by Morton Brown [ 43 ]. Nonlinear recurrences having any desired period ⩾ 5 can be based on continuants [ 65 ].

1.25 If T ( k ) ( n ) denotes the minimum number of moves needed to transfer n disks with k auxiliary pegs (hence T ( 1 ) ( n ) \= T n and T ( 2 ) ( n ) \= W n ), we have Image . No examples ( n , k ) are known where this inequality fails to be an equality. When k is small compared with n , the formula 2 n + 1 – k Image gives a convenient upper bound on Image .

News flash: Equality for all n when k = 4 has now been proved by Thierry Bousch, in Bulletin of the Belgium Mathematical Society: Simon Stevin, vol. 21 (2014), 895–912.

1.26 The execution-order permutation can be computed in O ( n log n ) steps for all q and n [ 209 , exercises 5.1.1–2 and 5.1.1–5]. Bjorn Poonen has proved that non-Josephus sets with exactly four “bad guys” exist whenever n ≡ 0 (mod 3 ) and n ⩾ 9 ; in fact, the number of such sets is at least Image for some Image > 0 . He also found by extensive computations that the only other n < 24 with non-Josephus sets is n \= 20 , which has 236 such sets with k \= 14 and two with k \= 13 . (One of the latter is { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 11 , 14 , 15 , 16 , 17 } ; the other is its reflection with respect to 21 .) There is a unique non-Josephus set with n \= 15 and k \= 9 , namely { 3 , 4 , 5 , 6 , 8 , 10 , 11 , 12 , 13 } .

2.1 There’s no agreement about this; three answers are defensible: (1) We can say that Image is always equivalent to ∑ m ⩽ k ⩽ n q k ; then the stated sum is zero. (2) A person might say that the given sum is q 4 + q 3 + q 2 + q 1 + q 0 , by summing over decreasing values of k . But this conflicts with the generally accepted convention that Image when n \= 0 . (3) We can say that Image ; then the stated sum is equal to − q 1 − q 2 − q 3 . This convention may appear strange, but it obeys the useful law Image for all a , b , c .

It’s best to use the notation Image only when n − m ⩾ − 1 ; then both conventions (1) and (3) agree.

2.2 This is | x | . Incidentally, the quantity ( [ x > 0 ] − [ x < 0 ] ) is often called sign ( x ) or signum ( x ) ; it is + 1 when x > 0 , 0 when x \= 0 , and − 1 when x < 0 .

2.3 The first sum is, of course, a 0 + a 1 + a 2 + a 3 + a 4 + a 5 ; the second is a 4 + a 1 + a 0 + a 1 + a 4 , because the sum is over the values k ∈ { − 2, − 1 , 0 , + 1, + 2 } . The commutative law doesn’t apply here because the function p ( k ) \= k 2 is not a permutation. Some values of n (e.g., n \= 3 ) have no k such that p ( k ) \= n ; others (e.g., n \= 4 ) have two such k .

2.4 (a) Image

(b) Image

2.5 The same index ‘ k ’ is being used for two different index variables, although k is bound in the inner sum. This is a famous mistake in mathematics (and computer programming). The result turns out to be correct if a j \= a k for all j and k , 1 ⩽ j , k ⩽ n .

2.6 It’s [ 1 ⩽ j ⩽ n ]( n − j + 1 ) . The first factor is necessary here because we should get zero when j < 1 or j > n .

2.7 Image . A version of finite calculus based on ∇ instead of Δ would therefore give special prominence to rising factorial powers.

2.8 0 , if m ⩾ 1 ; 1/ | m | ! , if m ⩽ 0 .

2.9 Image , for integers m and n . Setting m \= − n tells us that Image .

2.10 Another possible right-hand side is Eu Δv + v Δu .

2.11 Break the left-hand side into two sums, and change k to k + 1 in the second of these.

2.12 If p ( k ) \= n then n + c \= k + ((– 1 ) k + 1 ) c and ((– 1 ) k + 1 ) is even; hence (– 1 ) n + c \= (– 1 ) k and k \= n − (– 1 ) n + c c . Conversely, this value of k yields p ( k ) \= n .

2.13 Let R 0 \= α , and R n \= R n – 1 + (– 1 ) n ( β + nγ + n 2 δ ) for n > 0 . Then R ( n ) \= A ( n ) α + B ( n ) β + C ( n ) γ + D ( n ) δ . Setting R n \= 1 yields A ( n ) \= 1 . Setting R n \= (– 1 ) n yields A ( n ) + 2B ( n ) \= (– 1 ) n . Setting R n \= (– 1 ) n n yields − B ( n )+ 2C ( n ) \= (– 1 ) n n . Setting R n \= (– 1 ) n n 2 yields B ( n )– 2C ( n ) + 2D ( n ) \= (– 1 ) n n 2 . Therefore 2D ( n ) \= (– 1 ) n ( n 2 + n ) ; the stated sum is D ( n ) .

2.14 The suggested rewrite is legitimate since we have k \= ∑ 1 ⩽ j ⩽ k 1 when 1 ⩽ k ⩽ n . Sum first on k ; the multiple sum reduces to

Image

2.15 The first step replaces k ( k + 1 ) by 2 ∑ 1 ⩽ j ⩽ k j . The second step gives Image .

2.16 Image , by ( 2.52 ).

2.17 Use induction for the first two \= ’s, and ( 2.52 ) for the third. The second line follows from the first.

2.18 Use the facts that ( ℜ z ) + ⩽ | z | , ( ℜ z ) – ⩽ | z | , ( ℑ z ) + ⩽ | z | , ( ℑ z ) – ⩽ | z | , and | z | ⩽ ( ℜ z ) + + ( ℜ z ) – + ( ℑ z ) + + ( ℑ z ) – .

2.19 Multiply both sides by 2 n – 1 /n ! and let S n \= 2 n T n /n ! \= S n – 1 + 3 · 2 n – 1 \= 3 ( 2 n − 1 ) + S 0 . The solution is T n \= 3 · n ! + n ! /2 n – 1 . (We’ll see in Chapter 4 that T n is an integer only when n is 0 or a power of 2 .)

“It is a profoundly erroneous truism, repeated by all copybooks and by eminent people when they are making speeches, that we should cultivate the habit of thinking of what we are doing. The precise opposite is the case. Civilization advances by extending the number of important operations which we can perform without thinking about them. Operations of thought are like cavalry charges in a battle—they are strictly limited in number, they require fresh horses, and must only be made at decisive moments.”

—A. N. Whitehead [ 370 ]

2.20 The perturbation method gives

Image

2.21 Extracting the final term of S n + 1 gives S n + 1 \= 1 − S n ; extracting the first term gives

Image

Hence 2S n \= 1 + (– 1 ) n and we have S n \= [ n is even ] . Similarly, we find

Image

hence 2T n \= n + 1 − S n and we have T n = Image ( n + [ n is odd]). Finally, the same approach yields

U n + 1 = ( n + 1 ) 2 – U n

=

U n + 2 T n + S n

 

=

U n + n + [ n is odd] + [ n is even]

 

=

U n + n + 1 .

Hence U n is the triangular number Image .

2.22 Twice the general sum gives a “vanilla” sum over 1 ⩽ j , k ⩽ n , which splits and yields twice ( ∑ k a k A k )( ∑ k b k B k ) − ( ∑ k a k B k ) ( ∑ k b k A k ).

2.23 (a) This approach gives four sums that evaluate to 2n + H n – 2n + ( H n + Image – 1 ). (It would have been easier to replace the summand by 1/k + 1/ ( k + 1 ) .) (b) Let u ( x ) \= 2x + 1 and Δv ( x ) \= 1/x ( x + 1 ) \= ( x − 1 ) – 2 ; then Δu ( x ) \= 2 and v ( x ) \= –( x − 1 ) – 1 \= – 1/x . The answer is Image .

2.24 Summing by parts, Σ x m H x δx \= x m + 1 H x / ( m + 1 )– x m + 1 / ( m + 1 ) 2 + C ; hence Σ 0 ⩽ k<n k m H k \= n m + 1 ( H n − 1/ ( m + 1 )) / ( m + 1 ) + 0 m + 1 / ( m + 1 ) 2 . In our case m \= − 2 , so the sum comes to 1 − ( H n + 1 ) / ( n + 1 ) .

2.25 Here are some of the basic analogies:

Image

2.26 P 2 \= ( ∏ 1 ⩽ j,k ⩽ n a j a k )( ∏ 1 ⩽ j=k ⩽ n a j a k ). The first factor is equal to Image ; the second factor is Image . Hence Image .

2.27 Δ ( c x ) \= c x ( c − x − 1 ) \= c x + 2 / ( c − x ) . Setting c \= − 2 and decreasing x by 2 yields Δ (–(– 2 ) x – 2 ) \= (– 2 ) x /x , hence the stated sum is (– 2 ) – 1 – (– 2 ) n – 1 \= (– 1 ) n n ! − 1 .

2.28 The interchange of summation between the second and third lines is not justifiable; the terms of this sum do not converge absolutely. Everything else is perfectly correct, except that the result of ∑ k ⩾ 1 [ k \= j − 1 ] k/j should perhaps have been written [ j − 1 ⩾ 1 ]( j − 1 ) /j and simplified explicitly.

As opposed to imperfectly correct.

2.29 Use partial fractions to get

Image

The (– 1 ) k factor now makes the two halves of each term cancel with their neighbors. Hence the answer is − 1/4 + (– 1 ) n / ( 8n + 4 ) .

2.30 Image . So we have

( b − a )( b + a − 1 ) \= 2100 \= 2 2 · 3 · 5 2 · 7 .

There is one solution for each way to write 2100 \= x · y where x is even and y is odd; we let Image and Image . So the number of solutions is the number of divisors of 3 · 5 2 · 7 , namely 12 . In general, there are ∏ p>2 ( n p + 1 ) ways to represent ∏ p p n p , where the products range over primes.

2.31 ∑ j,k ⩾ 2 j – k \= ∑ j ⩾ 2 1/j 2 ( 1 − 1/j ) \= ∑ j ⩾ 2 1/j ( j − 1 ) . The second sum is, similarly, 3/4 .

2.32 If 2n ⩽ x < 2n + 1 , the sums are 0 + · · · + n +( x − n − 1 )+ · · · +( x − 2n ) \= n ( x − n ) \= ( x − 1 ) + ( x − 3 ) + · · · + ( x − 2n + 1 ) . If 2n − 1 ⩽ x < 2n they are, similarly, both equal to n ( x − n ) . (Looking ahead to Chapter 3 , the formula Image Image ( x + 1 ) Image ( x – Image Image ( x + 1 Image ) covers both cases.)

2.33 If K is empty, ∧ k ∈ K a k \= ∞ . The basic analogies are:

Image

A permutation that consumes terms of one sign faster than those of the other can steer the sum toward any value that it likes.

2.34 Let K + \= { k | a k ⩾ 0 } and K – \= { k | a k < 0 } . Then if, for example, n is odd, we choose F n to be F n – 1 ∪ E n , where E n ⊆ K – is sufficiently large that ∑ k ∈ ( F n – 1 ∩ K + ) a k − ∑ k ∈ E n (– a k ) < A – .

2.35 Goldbach’s sum can be shown to equal

Image

as follows: By unsumming a geometric series, it equals ∑ k ∈ P , l ⩾ 1 k – l ; therefore the proof will be complete if we can find a one-to-one correspondence between ordered pairs ( m , n ) with m , n ⩾ 2 and ordered pairs ( k , l ) with k ∈ P and l ⩾ 1 , where m n \= k l when the pairs correspond. If m ∉ P we let ( m , n ) ↔ ( m n , 1 ) ; but if m \= a b ∈ P , we let ( m , n ) ↔ ( a n , b ) .

With this self-description, Golomb’s sequence wouldn’t do too well on the Dating Game.

2.36 (a) By definition, g ( n ) − g ( n − 1 ) \= f ( n ) . (b) By part (a), g ( g ( n )) − g ( g ( n − 1 )) \= ∑ k f ( k ) [ g ( n − 1 ) < k ⩽ g ( n ) ] \= n ( g ( n ) − g ( n − 1 ) ) \= nf ( n ) . (c) By part (a) again, g ( g ( g ( n ))) – g ( g ( g ( n − 1 ))) is

Image

Colin Mallows observes that the sequence can also be defined by the recurrence

f ( 1 ) = 1 ;      f ( n + 1 ) = 1 + f ( n + 1 – f ( f ( n ))),   for n ⩾ 0 .

2.37 (RLG thinks they probably won’t fit; DEK thinks they probably will; OP is not committing himself.)

3.1 m \= Image lg n Image ; l \= n − 2 m \= n − 2 Image lg n Image .

3.2 (a) Image x + .5 Image . (b) Image x − .5 Image .

3.3 This is Image mn − { mα } n/α Image \= mn − 1 , since 0 < { mα } < 1 .

3.4 Something where no proof is required, only a lucky guess (I guess).

3.5 We have Image nx Image \= Image n Image x Image + n { x } Image \= n Image x Image + Image n { x } Image by ( 3.8 ) and ( 3.6 ). Therefore Image nx Image \= n Image x Image ⇔ Image n { x } Image \= 0 ⇔ 0 ⩽ n { x } < 1 ⇔ { x } < 1/n , assuming that n is a positive integer. (Notice that n Image x Image ⩽ Image nx Image for all x in this case.)

3.6 Image f ( x ) Image \= Image f ( Image x Image ) Image .

3.7 Image n/m Image + n mod m .

3.8 If all boxes contain < Image n/m Image objects, then n ⩽ ( Image n/m Image − 1 ) m , so n/m + 1 ⩽ Image n/m Image , contradicting ( 3.5 ). The other proof is similar.

3.9 We have m/n − 1/q \= ( n mumble m ) /qn . The process must terminate, because 0 ⩽ n mumble m < m . The denominators of the representation are strictly increasing, hence distinct, because qn/ ( n mumble m ) > q .

3.10 Image x + Image Image – [( 2 x + 1 )/ 4 is not an integer] is the nearest integer to x , if { x } ≠ Image ; otherwise it’s the nearest even integer. (See exercise 2 .) Thus the formula gives an “ unbiased” way to round.

3.11 If n is an integer, α < n < β ⇔ Image α Image < n < Image β Image . The number of integers satisfying a < n < b when a and b are integers is ( b − a − 1 )[ b > a ] . We would therefore get the wrong answer if α \= β \= integer.

3.12 Subtract Image n/m Image from both sides, by ( 3.6 ), getting Image ( n mod m ) /m Image \= Image ( n mod m + m − 1 ) /m Image . Both sides are now equal to [ n mod m > 0 ] , since 0 ⩽ n mod m < m .

A shorter but less direct proof simply observes that the first term in ( 3.24 ) must equal the last term in ( 3.25 ).

3.13 If they form a partition, the text’s formula for N ( α , n ) implies that 1/α + 1/β \= 1 , because the coefficients of n in the equation N ( α , n ) + N ( β , n ) \= n must agree if the equation is to hold for large n . Hence α and β are both rational or both irrational. If both are irrational, we do get a partition, as shown in the text. If both can be written with numerator m , the value m − 1 occurs in neither spectrum, and m occurs in both. (However, Golomb [ 151 ] has observed that the sets { Image nα Image | n ⩾ 1 } and { Image nβ Image − 1 | n ⩾ 1 } always do form a partition, when 1/α + 1/β \= 1 .)

3.14 It’s obvious by ( 3.22 ) if ny \= 0 , otherwise true by ( 3.21 ) and ( 3.6 ).

3.15 Plug in Image mx Image for n in ( 3.24 ): Image mx Image = Image x Image + Image x – Image Image + ··· + Image x – Image Image .

3.16 The formula n mod 3 = 1 + Image ((ω – 1 )ω n – (ω + 2 )ω 2 n ) can be verified by checking it when 0 ⩽ n < 3 .

A general formula for n mod m , when m is any positive integer, appears in exercise 7.25 .

3.17 Σ j,k [ 0 ⩽ k < m ][ 1 ⩽ j ⩽ x + k / m ] \= Σ j,k [ 0 ⩽ k < m ][ 1 ⩽ j ⩽ Image x Image ] × [ k ⩾ m ( j − x ) ] \= Σ 1 ⩽ j ⩽ Image x Image Σ k [ 0 ⩽ k < m ] – Σ j \= Image x Image Σ k [ 0 ⩽ k < m ( j − x ) ] \= m Image x Image − Image m ( Image x Image − x ) Image \= − Image − mx Image \= Image mx Image .

3.18 We have

Image

If j ⩽ nα − 1 ⩽ nα − v , there is no contribution, because ( j + v ) α – 1 ⩽ n . Hence j \= Image nα Image is the only case that matters, and the value in that case equals Image ( Image nα Image + v ) α – 1 Image − n ⩽ Image vα – 1 Image .

3.19 If and only if b is an integer. (If b is an integer, log b x is a continuous, increasing function that takes integer values only at integer points. If b is not an integer, the condition fails when x \= b .)

3.20 We have ∑ k kx [ α ⩽ kx ⩽ β ] \= x ∑ k k [ Image α/x Image ⩽ k ⩽ Image β/x Image ], which sums to Image x ( Image β/x Image Image β/x + 1 Image − Image α/x Image Image α/x − 1 Image ).

3.21 If 10 n ⩽ 2 M < 10 n + 1 , there are exactly n + 1 such powers of 2 , because there’s exactly one such k -digit power of 2 for each k . Therefore the answer is 1 + Image M log 2 Image .

Note: The number of powers of 2 with leading digit l is more difficult, when l > 1 ; it’s ∑ 0 ⩽ n ⩽ M ( Image n log 2 − log l Image − Image n log 2 − log ( l + 1 ) Image ).

3.22 All terms are the same for n and n − 1 except the k th, where n \= 2 k– 1 q and q is odd; we have S n \= S n – 1 + 1 and T n \= T n – 1 + 2 k q . Hence S n \= n and T n \= n ( n + 1 ) .

3.23 X n \= m ⇔ Image m ( m – 1 ) < n ⩽ Image m ( m + 1 ) ⇔ m 2 – m + Image < 2 n < m 2 + m + Image ⇔ m – Image < Image < m + Image .

3.24 Let β \= α/ ( α + 1 ) . Then the number of times the nonnegative integer m occurs in Spec ( β ) is exactly one more than the number of times it occurs in Spec ( α ) . Why? Because N ( β , n ) \= N ( α , n ) + n + 1 .

3.25 Continuing the development in the text, if we could find a value of m such that K m ⩽ m , we could violate the stated inequality at n + 1 when n \= 2m + 1 . (Also when n \= 3m + 1 and n \= 3m + 2 .) But the existence of such an m \= n ′ + 1 requires that 2K Image n ′ /2 Image ⩽ n ′ or 3K Image n ′ /3 Image ⩽ n ′, i.e., that

K Image n ′/ 2 Image ⩽ Image n ′/2 Image     or     K Image n ′/ 3 Image ⩽ Image n ′/ 3 Image .

Aha. This goes down further and further, implying that K 0 ⩽ 0 ; but K 0 \= 1 .

What we really want to prove is that K n is strictly greater than n , for all n ⩾ 0 . In fact, it’s easy to prove this by induction, although it’s a stronger result than the one we couldn’t prove!

(This exercise teaches an important lesson. It’s more an exercise about the nature of induction than about properties of the floor function.)

“In trying to devise a proof by mathematical induction, you may fail for two opposite reasons. You may fail because you try to prove too much: Your P ( n ) is too heavy a burden. Yet you may also fail because you try to prove too little: Your P ( n ) is too weak a support. In general, you have to balance the statement of your theorem so that the support is just enough for the burden.”

—G. Pólya [ 297 ]

3.26 Induction, using the stronger hypothesis

Image

3.27 If Image = 2 m b – a , where a is 0 or 1 , then Image = 3 m b – a .

3.28 The key observation is that a n \= m 2 implies a n + 2k + 1 \= ( m + k ) 2 + m − k and a n + 2k + 2 \= ( m + k ) 2 + 2m , for 0 ⩽ k ⩽ m ; hence a n + 2m + 1 \= ( 2m ) 2 . The solution can be written in a nice form discovered by Carl Witty:

Image

3.29 D(α ′ , Image αn Image ) is at most the maximum of the absolute value of s(α ′ , Image nα Image , v ′) \= − s ( α , n , v ) − S + Image + { 0 or 1 } + v ′ − { 0 or 1 } .

3.30 X n \= α 2 n + α – 2 n , by induction; and X n is an integer.

This logic is seriously floored.

3.31 Here’s an “elegant,” “impressive” proof that gives no clue about how it was discovered:

Image x Image + Image y Image + Image x + y Image

=

Image x + Image y Image Image + Image x + y Image

 

⩽

Image x + Image Image 2 y Image Image + Image x + Image Image 2 y Image + Image Image

 

=

Image 2 x + Image 2 y Image Image = Image 2 x Image + Image 2 y Image .

But there’s also a simple, graphical proof based on the observation that we need to consider only the case 0 ⩽ x , y < 1 . Then the functions look like this in the plane:

Image

A slightly stronger result is possible, namely

Image x Image + Image y Image + Image x + y Image ⩽ Image 2x Image + Image 2y Image ;

but this is stronger only when Image . If we replace ( x , y ) by (– x , x + y ) in this identity and apply the reflective law ( 3.4 ), we get

Image y Image + Image x + y Image + Image 2x Image ⩽ Image x Image + Image 2x + 2y Image .

3.32 Let f ( x ) be the sum in question. Since f ( x ) \= f (– x ) , we may assume that x ⩾ 0 . The terms are bounded by 2 k as k → − ∞ and by x 2 /2 k as k → + ∞ , so the sum exists for all real x .

We have f ( 2x ) \= 2 ∑ k 2 k – 1 ∥ x/2 k – 1 ∥ 2 \= 2f ( x ) . Let f ( x ) \= l ( x ) + r ( x ) where l ( x ) is the sum for k ⩽ 0 and r ( x ) is the sum for k > 0 . Then l ( x + 1 ) \= l ( x ) , and l ( x ) ⩽ 1/2 for all x . When 0 ⩽ x < 1 , we have r ( x ) \= x 2 /2 + x 2 /4 + · · · \= x 2 , and r ( x + 1 ) \= ( x − 1 ) 2 /2 + ( x + 1 ) 2 /4 + ( x + 1 ) 2 /8 + · · · \= x 2 + 1 . Hence f ( x + 1 ) \= f ( x ) + 1 , when 0 ⩽ x < 1 .

We can now prove by induction that f ( x + n ) \= f ( x ) + n for all integers n ⩾ 0 , when 0 ⩽ x < 1 . In particular, f ( n ) \= n . Therefore in general, f ( x ) \= 2 – m f ( 2 m x ) \= 2 – m Image 2 m x Image + 2 – m f ({ 2 m x }) . But f ({ 2 m x }) = l ({ 2 m x }) + r ({ 2 m x }) ⩽ Image + 1; so | f ( x ) – x | ⩽ | 2 – m Image 2 m x Image – x | + 2 – m · Image ⩽ 2 – m · Image for all integers m .

The inescapable conclusion is that f ( x ) = | x | for all real x .

3.33 Let r = n – Image be the radius of the circle. (a) There are 2n − 1 horizontal lines and 2n − 1 vertical lines between cells of the board, and the circle crosses each of these lines twice. Since r 2 is not an integer, the Pythagorean theorem tells us that the circle doesn’t pass through the corner of any cell. Hence the circle passes through as many cells as there are crossing points, namely 8n − 4 \= 8r . (The same formula gives the number of cells at the edge of the board.) (b) f ( n , k ) = 4 Image Image Image .

It follows from (a) and (b) that

Image

The task of obtaining more precise estimates of this sum is a famous problem in number theory, investigated by Gauss and many others; see Dickson [ 78 , volume 2, chapter 6 ].

3.34 (a) Let m \= Image lg n Image . We can add 2 m − n terms to simplify the calculations at the boundary:

Image

Consequently f ( n ) \= nm − 2 m + 1 .

(b) We have Image n/2 Image \= Image ( n + 1 ) /2 Image , and it follows that the solution to the general recurrence g ( n ) \= a ( n ) + g ( Image n/2 Image ) + g ( Image n/2 Image ) must satisfy Δg ( n ) \= Δa ( n )+ Δg ( Image n/2 Image ). In particular, when a ( n ) \= n − 1 , Δf ( n ) \= 1 + Δf ( Image n/2 Image ) is satisfied by the number of bits in the binary representation of n , namely Image lg ( n + 1 ) Image . Now convert from Δ to Σ .

A more direct solution can be based on the identities Image lg 2j Image \= Image lg j Image + 1 and Image lg ( 2j − 1 ) Image \= Image lg j Image + [ j > 1 ] , for j ⩾ 1 .

3.35 ( n + 1 ) 2 n ! e \= A n + ( n + 1 ) 2 + ( n + 1 ) + B n , where

Image

is a multiple of n and

Image

is less than 1 . Hence the answer is 2 mod n .

3.36 The sum is

Image

3.37 First consider the case m < n , which breaks into subcases based on whether Image ; then show that both sides change in the same way when m is increased by n .

This is really only a level 4 problem, in spite of the way it’s stated.

3.38 At most one x k can be noninteger. Discard all integer x k , and suppose that n are left. When { x } ≠ 0 , the average of { mx } as m → ∞ lies between Image and Image ; hence { mx 1 } + · · · + { mx n } − { mx 1 + · · · + mx n } cannot have average value zero when n > 1 .

But the argument just given relies on a difficult theorem about uniform distribution. An elementary proof is possible, sketched here for n \= 2 : Let P m be the point ( { mx } , { my } ). Divide the unit square 0 ⩽ x , y < 1 into triangular regions A and B according as x + y < 1 or x + y ⩾ 1 . We want to show that P m ∈ B for some m , if { x } and { y } are nonzero. If P 1 ∈ B , we’re done. Otherwise there is a disk D of radius Image > 0 centered at P 1 such that D ⊆ A . By Dirichlet’s box principle, the sequence P 1 , . . . , P N must contain two points with | P k − P j | < Image and k > j , if N is large enough.

Image

It follows that P k – j – 1 is within Image of ( 1 , 1 ) − P 1 ; hence P k – j – 1 ∈ B .

3.39 Replace j by b − j and add the term j \= 0 to the sum, so that exercise 15 can be used for the sum on j . The result,

Image x/b k Image − Image x/b k + 1 Image + b – 1 ,

telescopes when summed on k .

3.40 Let Image 2 Image Image = 4 k + r where − 2 ⩽ r < 2 , and let m = Image Image Image . Then the following relationships can be proved by induction:

Image

Thus, when k ⩾ 1 , W k is a segment of length 2k − 1 where the path travels west and y ( n ) \= k ; S k is the interior of a segment of length 2k where the path travels south and x ( n ) \= − k ; etc. (a) The desired formula is therefore

y ( n ) = (– 1 ) m (( n – m ( m + 1 ))·[ Image 2 Image Image is odd] – Image Image m Image ).

(b) On all segments, k \= max( | x ( n ) | , | y ( n ) | ). On segments W k and S k we have x < y and n + x + y \= m ( m + 1 ) \= ( 2k ) 2 − 2k ; on segments E k and N k we have x ⩾ y and n − x − y \= m ( m + 1 ) \= ( 2k ) 2 + 2k . Hence the sign is (– 1 ) [ x ( n ) <y ( n )] .

3.41 Since 1/ϕ + 1/ϕ 2 \= 1 , the stated sequences do partition the positive integers. Since the condition g ( n ) \= f(f ( n ) ) + 1 determines f and g uniquely, we need only show that Image Image nϕ Image ϕ Image + 1 \= Image nϕ 2 Image for all n > 0 . This follows from exercise 3 , with α \= ϕ and n \= 1 .

3.42 No; an argument like the analysis of the two-spectrum case in the text and in exercise 13 shows that a tripartition occurs if and only if 1/α + 1/β + 1/γ \= 1 and

Image

for all n > 0 . But the average value of { ( n + 1 ) /α } is 1/2 if α is irrational, by the theorem on uniform distribution. The parameters can’t all be rational, and if γ \= m/n the average is 3/2 − 1/ ( 2n ) . Hence γ must be an integer, but this doesn’t work either. (There’s also a proof of impossibility that uses only simple principles, without the theorem on uniform distribution; see [ 155 ].)

3.43 One step of unfolding the recurrence for K n gives the minimum of the four numbers 1 + a + a · b · K Image ( n – 1 – a ) / ( a · b ) Image , where a and b are each 2 or 3 . (This simplification involves an application of ( 3.11 ) to remove floors within floors, together with the identity x + min ( y , z ) \= min ( x + y , x + z ) . We must omit terms with negative subscripts; i.e., with n − 1 − a < 0 .)

Continuing along such lines now leads to the following interpretation: K n is the least number > n in the multiset S of all numbers of the form

1 + a 1 + a 1 a 2 + a 1 a 2 a 3 + · · · + a 1 a 2 a 3 . . . a m ,

where m ⩾ 0 and each a k is 2 or 3 . Thus,

S \= { 1 , 3 , 4 , 7 , 9 , 10 , 13 , 15 , 19 , 21 , 22 , 27 , 28 , 31 , 31 , . . . } ;

the number 31 is in S “twice” because it has two representations 1 + 2 + 4 + 8 + 16 \= 1 + 3 + 9 + 18 . (Incidentally, Michael Fredman [ 134 ] has shown that lim n →∞ K n /n \= 1 , i.e., that S has no enormous gaps.)

3.44 Let Image mumble ( q − 1 ) , so that Image and Image . Now Image , and the results follow. (This is the solution found by Euler [ 116 ], who determined the a ’s and d ’s sequentially without realizing that a single sequence Image would suffice.)

Too easy.

3.45 Let α > 1 satisfy α + 1/α \= 2m . Then we find 2Y n \= α 2 n + α – 2 n , and it follows that Y n \= Image α 2 n /2 Image .

3.46 The hint follows from ( 3.9 ), since 2 n ( n + 1) = Image 2(n + Image ) 2 Image . Let n + θ = ( Image l + Image l –l ) m and n ′ + θ′ = ( Image l +1 + Image l ) m , where 0 ⩽ θ , θ ′ < 1 . Then θ ′ \= 2θ mod 1 \= 2θ − d , where d is 0 or 1 . We want to prove that n ′ = Image Image ( n + Image ) Image ; this equality holds if and only if

0 ⩽ θ′( 2 – Image ) + Image (1 – d ) < 2 .

To solve the recurrence, note that Spec( 1 + 1 / Image ) and Spec( 1 + Image ) partition the positive integers; hence any positive integer a can be written uniquely in the form a = Image ( Image l + Image l –1 ) m Image , where l and m are integers with m odd and l ⩾ 0 . It follows that L n \= Image ( Image l + n + Image l + n –1 ) m Image .

3.47 (a) Image . (b) c is an integer. (c) c \= 0 . (d) c is arbitrary. See the answer to exercise 1.2.4–40 in [ 207 ] for more general results.

3.48 Let x : 0 \= 1 and x : ( k + 1 ) \= x Image x : k Image ; also let a k \= { x : k } and b k \= Image x : k Image , so that the stated identity reads x 3 = 3 x : 3 + 3 a 1 a 2 + Image – 3 b 1 b 2 + Image . Since a k + b k \= x : k \= xb k – 1 for k ⩾ 0 , we have ( 1 − xz )( 1 + b 1 z + b 2 z 2 + · · · ) \= 1 − a 1 z − a 2 z 2 − · · · ; thus

Image

Take the logarithm of both sides, to separate the a ’s from the b ’s. Then differentiate with respect to z , obtaining

Image

The coefficient of z n – 1 on the left is x n ; on the right it is a formula that matches the given identity when n \= 3 .

Similar identities for the more general product x 0 x 1 . . . x n – 1 can also be derived [ 170 ].

3.49 (Solution by Heinrich Rolletschek.) We can replace ( α , β ) by ( { β } , α + Image β Image ) without changing Image nα Image + Image nβ Image . Hence the condition α \= { β } is necessary. It is also sufficient: Let m \= Image β Image be the least element of the given multiset, and let S be the multiset obtained from the given one by subtracting mn from the n th smallest element, for all n . If α \= { β } , consecutive elements of S differ by either 0 or 2 , hence the multiset Image S = Spec(α) determines α .

A more interesting (still unsolved) problem: Restrict both α and β to be < 1 , and ask when the given multiset determines the unordered pair { α , β }.

3.50 According to unpublished notes of William A. Veech, it is sufficient to have αβ , β , and 1 linearly independent over the rationals.

3.51 H. S. Wilf observes that the functional equation f ( x 2 − 1 ) \= f ( x ) 2 would determine f ( x ) for all x ⩾ ϕ if we knew f ( x ) on any interval ( ϕ . . ϕ + Image ) .

3.52 There are infinitely many ways to partition the positive integers into three or more generalized spectra with repeated α k ; for example,

Spec ( 2α ; 0 ) ∪ Spec ( 4α ; − α ) ∪ Spec ( 4α ; − 3α ) ∪ Spec ( β ; 0 )

works when Image and Image . But there’s a precise sense in which such partitions arise by “expanding” a basic one, Spec ( α ) ∪ Spec ( β ) ; see [ 158 ].

The only known examples with distinct α’s, such as

Spec( 7 ; – 3 ) ∪ Spec( Image ; – 1 ) ∪ Spec( Image ; 0),

are based on parameters like those in the stated conjecture, which is due to A. S. Fraenkel [ 128 ].

3.53 Partial results are discussed in [ 95 , pages 30–31]. The greedy algorithm probably does not terminate.

4.1 1 , 2 , 4 , 6 , 16 , 12 .

4.2 Note that m p + n p \= min ( m p , n p ) + max ( m p , n p ) . The recurrence lcm ( m , n ) \= (n/ ( n mod m ) ) lcm ( n mod m , m ) is valid but not really advisable for computing lcm’s; the best way known to compute lcm ( m , n ) is to compute gcd ( m , n ) first and then to divide mn by the gcd.

4.3 This holds if x is an integer, but π ( x ) is defined for all real x . The correct formula,

π ( x ) − π ( x − 1 ) \= [ Image x Image is prime] ,

is easy to verify.

4.4 Between Image and Image we’d have a left-right reflected Stern–Brocot tree with all denominators negated, etc. So the result is all fractions m/n with m ⊥ n . The condition m ′ n − mn ′ \= 1 still holds throughout the construction. (This is called the Stern–Brocot wreath , because we can conveniently regard the final Image as identical to the first Image , thereby joining the trees in a cycle at the top. The Stern–Brocot wreath has interesting applications to computer graphics because it represents all rational directions in the plane.)

4.5 Image and Image ; this holds even when k < 0 . (We will find a general formula for any product of L ’s and R ’s in Chapter 6 .)

After all, ‘mod y’ sort of means “pretend y is zero.” So if it already is, there’s nothing to pretend.

4.6 a \= b . ( Chapter 3 defined x mod 0 \= x , primarily so that this would be true.)

4.7 We need m mod 10 \= 0 , m mod 9 \= k , and m mod 8 \= 1 . But m can’t be both even and odd.

4.8 We want 10x + 6y ≡ 10x + y (mod 15 ); hence 5y ≡ 0 (mod 15 ); hence y ≡ 0 (mod 3 ). We must have y \= 0 or 3 , and x \= 0 or 1 .

4.9 3 2k + 1 mod 4 \= 3 , so ( 3 2k + 1 − 1 ) /2 is odd. The stated number is divisible by ( 3 7 − 1 ) /2 and ( 3 11 − 1 ) /2 (and by other numbers).

4.10 Image .

4.11 σ ( 0 ) \= 1 ; σ ( 1 ) \= − 1 ; σ ( n ) \= 0 for n > 1 . (Generalized Möbius functions defined on arbitrary partially ordered structures have interesting and important properties, first explored by Weisner [ 366 ] and developed by many other people, notably Gian-Carlo Rota [ 313 ].)

4.12 ∑ d \ m ∑ k \ d μ ( d/k ) g ( k ) \= ∑ k \ m ∑ d \ ( m/k ) μ ( d ) g ( k ) \= ∑ k \ m g ( k ) × [ m/k \= 1 ] \= g ( m ) , by ( 4.7 ) and ( 4.9 ).

4.13 (a) n p ⩽ 1 for all p ; (b) μ ( n ) ≠ 0 .

4.14 True when k > 0 . Use ( 4.12 ), ( 4.14 ), and ( 4.15 ).

4.15 No. For example, e n mod 5 \= [ 2 or 3 ] ; e n mod 11 \= [ 2 , 3 , 7, or 10 ] .

4.16 1/e 1 + 1/e 2 + · · · + 1/e n \= 1 − 1 /( e n ( e n − 1 ) ) \= 1 − 1/ ( e n + 1 − 1 ) .

4.17 We have f n mod f m \= 2 ; hence gcd ( f n , f m ) \= gcd ( 2 , f m ) \= 1 . (Incidentally, the relation f n \= f 0 f 1 . . . f n – 1 + 2 is very similar to the recurrence that defines the Euclid numbers e n .)

4.18 If n \= qm and q is odd, 2 n + 1 \= ( 2 m + 1 )( 2 n – m − 2 n – 2m + · · · − 2 m + 1 ) .

4.19 The first sum is π ( n ) , since the summand is [ k + 1 is prime ] . The inner sum in the second is ∑ 1 ⩽ k < m [ k \ m ] , so it is greater than 1 if and only if m is composite; again we get π ( n ) . Finally Image , so the third sum is an application of Wilson’s theorem. To evaluate π ( n ) by any of these formulas is, of course, sheer lunacy.

4.20 Let p 1 \= 2 and let p n be the smallest prime greater than 2 p n − 1 . Then 2 p n − 1 < p n < 2 p n − 1 + 1 , and it follows that we can take b \= lim n →∞ lg ( n ) p n where lg ( n ) is the function lg iterated n times. The stated numerical value comes from p 2 \= 5 , p 3 \= 37 . It turns out that p 4 \= 2 37 + 9 , and this gives the more precise value

b ≈ 1.2516475977905

(but no clue about p 5 ).

4.21 By Bertrand’s postulate, P n < 10 n . Let

Image

Then 10 n 2 K ≡ P n + fraction (mod 10 2n – 1 ).

4.22 ( b mn − 1 ) / ( b − 1 ) \= (( b m − 1 ) / ( b − 1 )) ( b mn – m + · · · + 1 ) . [The only prime numbers of the form ( 10 p − 1 ) /9 for p < 49081 occur when p \= 2 , 19 , 23 , 317 , 1031 .] Numbers of this form are called “ repunits.”

4.23 ρ ( 2k + 1 ) \= 0 ; ρ ( 2k ) \= ρ ( k ) + 1 , for k ⩾ 1 . By induction we can show that ρ ( n ) \= ρ ( n − 2 m ) , if n > 2 m and m > ρ ( n ) . The k th Hanoi move is disk ρ ( k ) , if we number the disks 0 , 1 , . . . , n − 1 . This is clear if k is a power of 2 . And if 2 m < k < 2 m + 1 , we have ρ ( k ) < m ; moves k and k − 2 m correspond in the sequence that transfers m + 1 disks in T m + 1 + T m steps.

4.24 The digit that contributes dp m to n contributes dp m – 1 + · · · + d \= d ( p m − 1 ) / ( p − 1 ) to Image p ( n !) , hence Image p ( n !) \= ( n − ν p ( n ) ) / ( p − 1 ) .

4.25 m \\ n ⇔ m p \= 0 or m p \= n p , for all p . It follows that (a) is true. But (b) fails, in our favorite example m \= 12 , n \= 18 . (This is a common fallacy.)

4.26 Yes, since Image defines a subtree of the Stern–Brocot tree.

4.27 Extend the shorter string with M ’s (since M lies alphabetically between L and R ) until both strings are the same length, then use dictionary order. For example, the topmost levels of the tree are LL < LM < LR < MM < RL < RM < RR . (Another solution is to append the infinite string RL ∞ to both inputs, and to keep comparing until finding L < R .)

4.28 We need to use only the first part of the representation:

Image

The fraction Image appears because it’s a better upper bound than Image , not because it’s closer than Image . Similarly, Image is a better lower bound than Image . The simplest upper bounds and the simplest lower bounds all appear, but the next really good approximation doesn’t occur until just before the string of R ’s switches back to L .

4.29 1/α . To get 1 − x from x in binary notation, we interchange 0 and 1 ; to get 1/α from α in Stern–Brocot notation, we interchange L and R . (The finite cases must also be considered, but they must work since the correspondence is order preserving.)

4.30 The m integers x Image [ A . . A + m ) are different mod m ; so their residues ( x mod m 1 , . . . , x mod m r ) run through all m 1 . . . m r \= m possible values, one of which must be equal to ( a 1 mod m 1 , . . . , a r mod m r ) by the pigeonhole principle.

4.31 A number in radix b notation is divisible by d if and only if the sum of its digits is divisible by d , whenever b ≡ 1 (mod d ). This follows because ( a m . . . a 0 ) b \= a m b m + · · · + a 0 b 0 ≡ a m + · · · + a 0 .

4.32 The φ ( m ) numbers { kn mod m | k ⊥ m and 0 ⩽ k < m } are the numbers { k | k ⊥ m and 0 ⩽ k < m } in some order. Multiply them together and divide by ∏ 0 ⩽ k<m, k ⊥ m k .

4.33 Obviously h ( 1 ) \= 1 . If m ⊥ n then h ( mn ) \= ∑ d \ mn f ( d ) g ( mn/d ) \= ∑ c \ m,d \ n f ( cd ) g (( m/c )( n/d )) \= ∑ c \ m ∑ d \ n f ( c ) g ( m/c ) f ( d ) g ( n/d ) ; this is h ( m ) h ( n ) , since c ⊥ d for every term in the sum.

4.34 g ( m ) \= ∑ d \ m f ( d ) \= ∑ d \ m f ( m/d ) \= ∑ d ⩾ 1 f ( m/d ) if f ( x ) is zero when x is not an integer.

4.35 The base cases are

I (0, n ) = 0 ;         I ( m , 0) = 1 .

When m , n > 0 , there are two rules, where the first is trivial if m > n and the second is trivial if m < n :

I ( m , n ) \= I ( m , n mod m ) − Image n/m Image I ( n mod m , m ) ;
I ( m , n ) \= I ( m mod n , n ) .

4.36 A factorization of any of the given quantities into nonunits must have m 2 − 10n 2 \= ± 2 or ± 3 , but this is impossible mod 10 .

4.37 Let a n \= 2 – n ln ( e n – Image ) and b n \= 2 – n ln ( e n + Image ). Then

e n \= Image E 2 n + Image Image ⇔ a n ⩽ ln E < b n .

And a n − 1 < a n < b n < b n − 1 , so we can take E \= lim n →∞ e a n . In fact, it turns out that

Image

a product that converges rapidly to ( 1.26408473530530111 . . . ) 2 . But these observations don’t tell us what e n is, unless we can find another expression for E that doesn’t depend on Euclid numbers.

4.38 Let r \= n mod m . Then a n − b n \= ( a m − b m )( a n − m b 0 + a n − 2m b m + · · · + a r b n − m − r ) + b m Image n/m Image ( a r − b r ) .

4.39 If a 1 . . . a t and b 1 . . . b u are perfect squares, so is

Image

where { a 1 , . . . , a t } ∩ { b 1 , . . . , b u } \= { c 1 , . . . , c v } . (It can be shown, in fact, that the sequence Image S ( 1 ) , S ( 2 ) , S ( 3 ) , . . . Image contains every nonprime positive integer exactly once.)

4.40 Let f ( n ) = П 1⩽ k ⩽ n,pχk k = n !/ P Image n/p Image Image n/p Image ! and g ( n ) \= n ! /p Image p ( n !) . Then

g ( n ) \= f ( n ) f ( Image n/p Image ) f ( Image n/p 2 Image ) . . . \= f ( n ) g ( Image n/p Image ) .

Also f ( n ) ≡ a 0 !( p − 1 )! Image n/p Image ≡ a 0 !(– 1 ) Image n/p Image (mod p ), and Image p ( n !) \= Image n/p Image + Image p ( Image n/p Image ! ). These recurrences make it easy to prove the result by induction. (Several other solutions are possible.)

4.41 (a) If n 2 ≡ − 1 (mod p ) then ( n 2 ) ( p − 1 ) /2 ≡ − 1 ; but Fermat says it’s + 1 . (b) Let n \= ( ( p − 1 ) /2 ) ! ; we have n ≡ (– 1 ) ( p − 1 ) /2 ∏ 1 ⩽ k<p/2 ( p − k ) \= ( p − 1 )! /n , hence n 2 ≡ ( p − 1 )! .

4.42 First we observe that k ⊥ l ⇔ k ⊥ l + ak for any integer a , since gcd ( k , l ) \= gcd ( k , l + ak ) by Euclid’s algorithm. Now

       m ⊥ n and n ′ ⊥ n       ⇔     mn ′ ⊥ n

 

                                        ⇔     mn ′ + nm ′ ⊥ n.

Similarly

       m ′ ⊥ n ′ and n ⊥ n ′       ⇔        mn ′ + nm ′ ⊥ n ′ .

Hence

       m ⊥ n and m ′ ⊥ n ′ and n ⊥ n ′       ⇔        mn ′ + nm ′ ⊥ nn ′ .

4.43 We want to multiply by L − 1 R , then by R − 1 L − 1 RL , then L − 1 R , then R – 2 L − 1 RL 2 , etc.; the n th multiplier is R − ρ ( n ) L − 1 RL ρ ( n ) , since we must cancel ρ ( n ) R ’s. And R − m L − 1 RL m \= Image .

4.44 We can find the simplest rational number that lies in

[0.3155..0.3165) = Image

by looking at the Stern–Brocot representations of Image and Image and stopping just before the former has L where the latter has R :

Image

The output is LLLRRRRR = Image ≈ .3158. Incidentally, an average of .334 implies at least 287 at bats.

John .316

—banner displayed during the 1993 World Series, when John Kruk came to bat.

4.45 x 2 ≡ x (mod 10 n ) ⇔ x ( x − 1 ) ≡ 0 (mod 2 n ) and x ( x − 1 ) ≡ 0 (mod 5 n ) ⇔ x mod 2 n \= [ 0 or 1 ] and x mod 5 n \= [ 0 or 1 ] . (The last step is justified because x ( x − 1 ) mod 5 \= 0 implies that either x or x − 1 is a multiple of 5 , in which case the other factor is relatively prime to 5 n and can be divided from the congruence.)

So there are at most four solutions, of which two ( x \= 0 and x \= 1 ) don’t qualify for the title “ n -digit number” unless n \= 1 . The other two solutions have the forms x and 10 n + 1 − x , and at least one of these numbers is ⩾ 10 n − 1 . When n \= 4 the other solution, 10001 − 9376 \= 625 , is not a four-digit number. We expect to get two n -digit solutions for about 80% of all n , but this conjecture has not been proved.

(Such self-reproducing numbers have been called “ automorphic.”)

4.46 (a) If j ′ j − k ′ k \= gcd ( j , k ) , we have n k′ k n gcd ( j,k ) \= n j ′ j ≡ 1 and n k′ k ≡ 1 . (b) Let n \= pq , where p is the smallest prime divisor of n . If 2 n ≡ 1 (mod n ) then 2 n ≡ 1 (mod p ). Also 2 p – 1 ≡ 1 (mod p ); hence 2 gcd ( p − 1,n ) ≡ 1 (mod p ). But gcd ( p − 1 , n ) \= 1 by the definition of p .

4.47 If n m − 1 ≡ 1 (mod m ) we must have n ⊥ m . If n k ≡ n j for some 1 ⩽ j < k < m , then n k − j ≡ 1 because we can divide by n j . Therefore if the numbers n 1 mod m , . . . , n m − 1 mod m are not distinct, there is a k < m − 1 with n k ≡ 1 . The least such k divides m − 1 , by exercise 46 ( a ). But then kq \= ( m − 1 ) /p for some prime p and some positive integer q ; this is impossible, since n kq ≢ 1 . Therefore the numbers n 1 mod m , . . . , n m − 1 mod m are distinct and relatively prime to m . Therefore the numbers 1 , . . . , m − 1 are relatively prime to m , and m must be prime.

4.48 By pairing numbers up with their inverses, we can reduce the product (mod m ) to ∏ 1 ⩽ n<m, n 2 mod m \= 1 n . Now we can use our knowledge of the solutions to n 2 mod m \= 1 . By residue arithmetic we find that the result is m − 1 if m \= 4 , p k , or 2p k ( p > 2 ); otherwise it’s + 1 .

4.49 (a) Either m < n ( Φ ( N ) − 1 cases) or m \= n (one case) or m > n ( Φ ( N ) − 1 again). Hence R ( N ) \= 2Φ ( N ) − 1 . (b) From ( 4.62 ) we get

Image

hence the stated result holds if and only if

Image

And this is a special case of ( 4.61 ) if we set f ( x ) \= [ x ⩾ 1 ] .

4.50 (a) If f is any function,

Image

we saw a special case of this in the derivation of ( 4.63 ). An analogous derivation holds for ∏ instead of ∑ . Thus we have

Image

because ω m/d \= e 2πi/d .

Part (b) follows from part (a) by the analog of ( 4.56 ) for products instead of sums. Incidentally, this formula shows that Ψ m ( z ) has integer coefficients, since Ψ m ( z ) is obtained by multiplying and dividing polynomials whose leading coefficient is 1 .

4.51 ( x 1 + · · · + x n ) p \= ∑ k 1 + ··· + k n \= p p ! / ( k 1 ! . . . k n !) Image , and the coefficient is divisible by p unless some k j \= p . Hence ( x 1 + · · · + x n ) p ≡ Image (mod p ). Now we can set all the x ’s to 1 , obtaining n p ≡ n .

4.52 If p > n there is nothing to prove. Otherwise x ⊥ p , so x k ( p − 1 ) ≡ 1 (mod p ); this means that at least Image ( n − 1 ) / ( p − 1 ) Image of the given numbers are multiples of p . And ( n − 1 ) / ( p − 1 ) ⩾ n/p since n ⩾ p .

“Die ganzen Zahlen hat der liebe Gott gemacht, alles andere ist Menschenwerk.”

—L. Kronecker [ 365 ]

4.53 First show that if m ⩾ 6 and m is not prime then ( m − 2 )! ≡ 0 (mod m ). (If m \= p 2 , the product for ( m − 2 )! includes p and 2p ; otherwise it includes d and m/d where d < m/d .) Next consider cases:

Case 0, n < 5 . The condition holds for n \= 1 only.

Case 1, n ⩾ 5 and n is prime. Then ( n − 1 )! / ( n + 1 ) is an integer and it can’t be a multiple of n .

Case 2, n ⩾ 5 , n is composite, and n + 1 is composite. Then n and n + 1 divide ( n − 1 )! , and n ⊥ n + 1 ; hence n ( n + 1 ) \ ( n − 1 )! .

Case 3, n ⩾ 5 , n is composite, and n + 1 is prime. Then ( n − 1 )! ≡ 1 (mod n + 1 ) by Wilson’s theorem, and

Image ( n − 1 )! / ( n + 1 ) Image \= (( n − 1 )! + n) / ( n + 1 ) ;

this is divisible by n .

Therefore the answer is: Either n \= 1 or n ≠ 4 is composite.

4.54 Image 2 ( 1000 !) > 500 and Image 5 ( 1000 !) \= 249 , hence 1000 ! \= a · 10 249 for some even integer a . Since 1000 \= ( 13000 ) 5 , exercise 40 tells us that a · 2 249 \= 1000 ! /5 249 ≡ − 1 (mod 5 ). Also 2 249 ≡ 2 , hence a ≡ 2 , hence a mod 10 \= 2 or 7 ; hence the answer is 2 · 10 249 .

4.55 One way is to prove by induction that Image is an integer; this stronger result helps the induction go through. Another way is based on showing that each prime p divides the numerator at least as often as it divides the denominator. This reduces to proving the inequality

Image

which follows from

Image .

The latter is true when 0 ⩽ n < m , and both sides increase by 4 when n is increased by m .

4.56 Let f ( m ) = Image min ( k , 2 n – k )[ m \ k ], g ( m ) = Image (2 n –2 k –1) × [ m \(2 k + 1)]. The number of times p divides the numerator of the stated fraction is f ( p ) + f ( p 2 ) + f ( p 3 ) + · · · , and the number of times p divides the denominator is g ( p ) + g ( p 2 ) + g ( p 3 ) + · · · . But f ( m ) \= g ( m ) whenever m is odd, by exercise 2.32 . The stated fraction therefore reduces to 2 n ( n − 1 ) , by exercise 3.22 .

4.57 The hint suggests a standard interchange of summation, since

Image

Calling the hinted sum Σ ( n ) , we have

Image

On the other hand, we know from ( 4.54 ) that ∑( n ) = Image n ( n + 1). Hence Σ ( m + n ) − Σ ( m ) − Σ ( n ) \= mn .

4.58 The function f ( m ) is multiplicative, and when m \= p k it equals 1 + p + · · · + p k . This is a power of 2 if and only if p is a Mersenne prime and k \= 1 . For k must be odd, and in that case the sum is

(1 + p) (1 + p 2 + p 4 + · · · + p k –1 )

and ( k − 1 ) /2 must be odd, etc. The necessary and sufficient condition is that m be a product of distinct Mersenne primes.

4.59 Proof of the hint: If n \= 1 we have x 1 \= α \= 2 , so there’s no problem. If n > 1 we can assume that x 1 ⩽ · · · ⩽ x n . Case 1: Image + ( x n – 1) –1 ⩾ 1 and x n > x n – 1 . Then we can find β ⩾ x n − 1 ⩾ x n – 1 such that Image ; hence x n ⩽ β + 1 ⩽ e n and x 1 . . . x n ⩽ x 1 . . . x n – 1 ( β + 1 ) ⩽ e 1 . . . e n , by induction. There is a positive integer m such that α \= x 1 . . . x n /m ; hence α ⩽ e 1 . . . e n \= e n + 1 − 1 , and we have x 1 . . . x n ( α + 1 ) ⩽ e 1 . . . e n e n + 1 . Case 2: Image and x n \= x n – 1 . Let a \= x n and a − 1 + ( a − 1 ) − 1 \= ( a − 2 ) − 1 + ζ − 1 . Then we can show that a ⩾ 4 and ( a − 2 )( ζ + 1 ) ⩾ a 2 . So there’s a β ⩾ ζ such that Image ; it follows by induction that x 1 . . . x n ⩽ x 1 . . . x n – 2 ( a − 2 )( ζ + 1 ) ⩽ x 1 . . . x n – 2 ( a − 2 )( β + 1 ) ⩽ e 1 . . . e n , and we can finish as before. Case 3: Image . Let a \= x n , and let a − 1 + α − 1 \= ( a − 1 ) − 1 + β − 1 . It can be shown that ( a − 1 )( β + 1 ) > a ( α + 1 ) , because this identity is equivalent to

aα 2 − a 2 α + aα − a 2 + α + a > 0 ,

which is a consequence of aα ( α − a ) + ( 1 + a ) α ⩾ ( 1 + a ) α > a 2 − a . Hence we can replace x n and α by a − 1 and β , repeating this transformation until cases 1 or 2 apply.

Another consequence of the hint is that 1/x 1 + · · · + 1/x n < 1 implies 1/x 1 + · · · + 1/x n ⩽ 1/e 1 + · · · + 1/e n ; see exercise 16 .

4.60 The main point is that Image . Then we can take p 1 sufficiently large (to meet the conditions below) and p n to be the least prime greater than Image . With this definition let a n \= 3 − n ln p n and b n \= 3 − n ln ( p n + 1 ) . If we can show that a n – 1 ⩽ a n < b n ⩽ b n – 1 , we can take P \= lim n →∞ e a n as in exercise 37 . But this hypothesis is equivalent to Image ⩽ p n < ( p n–1 + 1) 3 . If there’s no prime p n in this range, there must be a prime Image such that p + p θ > ( p n – 1 + 1 ) 3 . But this implies that p θ > 3p 2/3 , which is impossible when p is sufficiently large.

We can almost certainly take p 1 \= 2 , since all available evidence indicates that the known bounds on gaps between primes are much weaker than the truth (see exercise 69 ). Then p 2 \= 11 , p 3 \= 1361 , p 4 \= 2521008887 , and 1.306377883863 < P < 1.306377883869 .

“Man made the integers: All else is Dieudonné.”

—R. K. Guy

4.61 Let Image and Image be the right-hand sides; observe that Image , hence Image . Also Image and N = (( n + N )/ n ′) n ′ – n ⩾ Image > (( n + N )/ n ′ – 1 ) n ′ – n = N – n ′ ⩾ 0. So we have Image . If equality doesn’t hold, we have Image , a contradiction.

Incidentally, this exercise implies that ( m + m ″ ) / ( n + n ″ ) \= m ′ /n ′, although the former fraction is not always reduced.

4.62 2 − 1 + 2 − 2 + 2 − 3 − 2 − 6 − 2 − 7 + 2 − 12 + 2 − 13 − 2 − 20 − 2 − 21 + 2 − 30 + 2 − 31 − 2 − 42 − 2 − 43 + · · · can be written

Image

This sum, incidentally, can be expressed in closed form using the “ theta function” θ ( z , λ ) \= ∑ k e − πλk 2 + 2izk ; we have

Image

4.63 Any n > 2 either has a prime divisor d > 2 or is divisible by d \= 4 . In either case, a solution with exponent n implies a solution ( a n/d ) d +( b n/d ) d \= ( c n/d ) d with exponent d . Since d \= 4 has no solutions, d must be prime.

The hint follows from the binomial theorem, since ( a p + ( x − a ) p ) /x ≡ pa p − 1 (mod x ) when p is odd. The smallest counterexample, if ( 4.46 ) fails, has a ⊥ x . If x is not divisible by p then x is relatively prime to c p /x ; this means that whenever q is prime and q e \\ x and q f \\ c , we have e \= fp . Hence x \= m p for some m . On the other hand if x is divisible by p , then c p /x is divisible by p but not by p 2 , and c p has no other factors in common with x .

I have discovered a wonderful proof of Fermat’s Last Theorem, but there’s no room for it here.

4.64 Equal fractions in Image N appear in “ organ-pipe order”:

Image

Suppose that Image N is correct; we want to prove that Image N + 1 is correct. This means that if kN is odd, we want to show that

Image

if kN is even, we want to show that

Image

In both cases it will be helpful to know the number of fractions that are strictly less than ( k − 1 ) / ( N + 1 ) in Image N ; this is

Image

by ( 3.32 ), where d \= gcd ( k − 1 , N + 1 ) . And this reduces to Image ( kN – d + 1), since N mod d \= d − 1 .

Furthermore, the number of fractions equal to ( k − 1 ) / ( N + 1 ) in Image N that should precede it in Image N + 1 is Image , by the nature of organpipe order.

If kN is odd, then d is even and ( k − 1 ) / ( N + 1 ) is preceded by Image elements of Image N ; this is just the correct number to make things work. If kN is even, then d is odd and ( k − 1 ) / ( N + 1 ) is preceded by Image elements of Image N . If d \= 1 , none of these equals ( k − 1 ) / ( N + 1 ) and Image N,kN is ‘ < ’; otherwise ( k − 1 ) / ( N + 1 ) falls between two equal elements and Image N,kN is ‘ \= ’. (C. S. Peirce [ 288 ] independently discovered the Stern–Brocot tree at about the same time as he discovered Image N .)

“No square less than 25 × 10 14 divides a Euclid number.”

—Ilan Vardi

4.65 The analogous question for the (analogous) Fermat numbers f n is a famous unsolved problem. This one might be easier or harder.

4.66 It is known that no square less than 36 × 10 18 divides a Mersenne number or Fermat number. But there has still been no proof of Schinzel’s conjecture that there exist infinitely many squarefree Mersenne numbers. It is not even known if there are infinitely many p such that p \\ ( a ± b ) , where all prime factors of a and b are ⩽ 31 .

4.67 M. Szegedy proved this conjecture for all large n ; then R. Balasubramanian and K. Soundararajan found a complete solution. See [ 95 , pp. 78–79], [ 348 ], [ 55 ], and [ 19′ ].

4.68 This is a much weaker conjecture than the result in the following exercise.

4.69 Cramér [ 66 ] showed that this conjecture is plausible on probabilistic grounds, and computational experience bears this out: Brent [ 37 ] has shown that P n + 1 − P n ⩽ 602 for P n + 1 < 2.686 × 10 12 . But the much weaker bounds in exercise 60 are the best that were known in 1994 [ 255 ]. Exercise 68 has a “yes” answer if Image for all sufficiently large n . According to Guy [ 169 , problem A8], Paul Erd ő s offers $10,000 for proof that there are infinitely many n such that

Image

for all c > 0 .

Late-breaking news: The $10,000 prize has been won! See Kevin Ford, Ben Green, Sergei Konyagin, James Maynard, and Terence Tao, “Long gaps between primes,” Journal of the American Mathematical Society, vol. 31 (2018), pages 65–105.

4.70 This holds if and only if ν 2 ( n ) \= ν 3 ( n ) , according to exercise 24 . The methods of [ 96 ] may help to crack this conjecture.

4.71 When k \= 3 the smallest solution is n \= 4700063497 \= 19 · 47 · 5263229 ; no other solutions are known in this case.

4.72 This is known to be true for infinitely many values of a , including − 1 (of course) and 0 (not so obviously). Lehmer [ 244 ] has a famous conjecture that φ ( n ) \ ( n − 1 ) if and only if n is prime.

4.73 This is known to be equivalent to the Riemann hypothesis (that the complex zeta function ζ ( z ) is nonzero when the real part of z is greater than 1/2 ).

4.74 Experimental evidence suggests that there are about p ( 1 − 1/e ) distinct values, just as if the factorials were randomly distributed modulo p .

5.1 Image , in any number system of radix r ⩾ 7 , because of the binomial theorem.

What’s 11 4 in radix 11 ?

5.2 The ratio Image is ⩽ 1 when k ⩾ Image n/2 Image and ⩾ 1 when k < Image n/2 Image , so the maximum occurs when k \= Image n/2 Image and k \= Image n/2 Image .

5.3 Expand into factorials. Both products are equal to f ( n ) /f ( n − k ) f ( k ) , where f ( n ) \= ( n + 1 )! n ! ( n − 1 )! .

5.4 Image

5.5 If 0 < k < p , there’s a p in the numerator of Image with nothing to cancel it in the denominator. Since Image , we must have Image , for 0 ⩽ k < p .

5.6 The crucial step (after second down) should be

Image

The original derivation forgot to include this extra term, which is [ n \= 0 ] .

5.7 Yes, because Image . We also have

Image

5.8 f ( k ) \= ( k/n − 1 ) n is a polynomial of degree n whose leading coefficient is n − n . By ( 5.40 ), the sum is n ! /n n . When n is large, Stirling’s approximation says that this is approximately Image . (This is quite different from ( 1 − 1/e ) , which is what we get if we use the approximation ( 1 − k/n ) n ∼ e − k , valid for fixed k as n → ∞ .)

5.9 ℇ t ( z ) t \= ∑ k ⩾ 0 t ( tk + t ) k − 1 z k /k ! \= ∑ k ⩾ 0 ( k + 1 ) k − 1 ( tz ) k /k ! \= ℇ 1 ( tz ) , by ( 5.60 ).

5.10 ∑ k ⩾ 0 2z k / ( k + 2 ) \= F ( 2 , 1 ; 3 ; z ) , since t k + 1 /t k \= ( k + 2 ) z/ ( k + 3 ) .

But not Im besselian.

5.11 The first is Besselian and the second is Gaussian:

Image

5.12 (a) Yes, if n ≠ 0 , since the term ratio is n . (b) Yes, when n is an integer; the term ratio is ( k + 1 ) n /k n . Notice that we get this term from ( 5.115 ) by setting m \= n + 1 , a 1 \= · · · \= a m \= 1 , b 1 \= · · · \= b n \= 0 , z \= 1 , and multiplying by 0 n . (c) Yes, the term ratio is ( k + 1 )( k + 3 ) / ( k + 2 ) . (d) No, the term ratio is 1 + 1/ ( k + 1 ) H k ; and H k ∼ ln k isn’t a rational function. (e) Yes, the reciprocal of any hypergeometric term is a hypergeometric term. The fact that t ( k ) \= ∞ when k < 0 or k > n does not exclude t ( k ) from hypergeometric termhood. (f) Of course. (g) Not when, say, t ( k ) \= 2 k and T ( k ) \= 1 . (h) Yes; the term ratio t ( n − 1 − k ) /t ( n − 1 − ( k + 1 )) is a rational function (the reciprocal of the term ratio for t , with k replaced by n − 1 − k ), for arbitrary n . (i) Yes; the term ratio can be written

Image

and t ( k + m ) /t ( k ) \= (t ( k + m ) /t ( k + m − 1 )) . . . (t ( k + 1 ) /t ( k )) is a rational function of k . (j) No. Whenever two rational functions p 1 ( k ) /q 1 ( k ) and p 2 ( k ) /q 2 ( k ) are equal for infinitely many k , they are equal for all k , because p 1 ( k ) q 2 ( k ) \= q 1 ( k ) p 2 ( k ) is a polynomial identity. Therefore the term ratio Image ( k + 1 ) /2 Image / Image k/2 Image would have to equal 1 if it were a rational function. (k) No. The term ratio would have to be ( k + 1 ) /k , since it is ( k + 1 ) /k for all k > 0 ; but then t (– 1 ) can be zero only if t ( 0 ) is a multiple of 0 2 , while t ( 1 ) can be 1 only if t ( 0 ) \= 0 1 .

Each value of a hypergeometric term t ( k ) can be written 0 e(k) v(k) , where e ( k ) is an integer and v ( k ) ≠ 0 . Suppose the term ratio t ( k + 1 ) /t ( k ) is p ( k ) /q ( k ) , and that p and q have been completely factored over the complex numbers. Then, for each k , e ( k + 1 ) is e ( k ) plus the number of zero factors of p ( k ) minus the number of zero factors of q ( k ) , and v ( k + 1 ) is v ( k ) times the product of the nonzero factors of p ( k ) divided by the product of the nonzero factors of q ( k ) .

5.13 Image

5.14 The first factor in ( 5.25 ) is Image when k ⩽ l , so it’s Image . The sum for k ⩽ l is the sum over all k , since m ⩾ 0 . (The condition n ⩾ 0 isn’t really needed, although k must assume negative values if n < 0 .)

To go from ( 5.25 ) to ( 5.26 ), first replace s by − 1 − n − q .

5.15 If n is odd, the sum is zero, since we can replace k by n − k . If n \= 2m , the sum is (– 1 ) m ( 3m )! /m ! 3 , by ( 5.29 ) with a \= b \= c \= m .

5.16 This is just ( 2a )! ( 2b )! ( 2c )! / ( a + b )! ( b + c )! ( c + a )! times ( 5.29 ), if we write the summands in terms of factorials.

5.17 The formulas Image and Image yield Image .

5.18 Image

5.19 Image , by ( 5.60 ), and this is Image .

5.20 It equals F (– a 1 , . . . , − a m ; − b 1 , . . . , − b n ; (– 1 ) m + n z ) ; see exercise 2.17 .

5.21 lim n →∞ ( n + m ) m /n m \= 1 .

5.22 Multiplying and dividing instances of ( 5.83 ) gives

Image

by ( 5.34 ) and ( 5.36 ). Also

Image

Hence, etc. The Gamma function equivalent, incidentally, is

Image

5.23 (– 1 ) n n ¡, see ( 5.50 ).

5.24 This sum is Image , by ( 5.35 ) and ( 5.93 ).

5.25 This is equivalent to the easily proved identity

Image

as well as to the operator formula a − b \= ( ϑ + a ) − ( ϑ + b ) .

Similarly, we have

Image

because a 1 − a 2 \= ( a 1 + k )–( a 2 + k ) . If a 1 − b 1 is a nonnegative integer d , this second identity allows us to express F ( a 1 , . . . , a m ; b 1 , . . . , b n ; z ) as a linear combination of F ( a 2 + j , a 3 , . . . , a m ; b 2 , . . . , b n ; z ) for 0 ⩽ j ⩽ d , thereby eliminating an upper parameter and a lower parameter. Thus, for example, we get closed forms for F ( a , b ; a − 1 ; z ) , F ( a , b ; a − 2 ; z ) , etc.

Gauss [ 143 , §7] derived analogous relations between F ( a , b ; c ; z ) and any two “ contiguous” hypergeometrics in which a parameter has been changed by ± 1 . Rainville [ 301 ] generalized this to cases with more parameters.

5.26 If the term ratio in the original hypergeometric series is t k + 1 /t k \= r ( k ) , the term ratio in the new one is t k + 2 /t k + 1 \= r ( k + 1 ) . Hence

Image

5.27 This is the sum of the even terms of F ( 2a 1 , . . . , 2a m ; 2b 1 , . . . , 2b m ; z ) . We have Image , etc.

Equating coefficients of z n gives the Pfaff-Saalschütz formula ( 5.97 ).

5.28 Image . ( Euler proved the identity by showing that both sides satisfy the same differential equation. The reflection law is often attributed to Euler, but it does not seem to appear in his published papers.)

5.29 The coefficients of z n are equal, by Vandermonde’s convolution. ( Kummer’s original proof was different: He considered lim m →∞ F ( m , b − a ; b ; z/m ) in the reflection law ( 5.101 ).)

5.30 Differentiate again to get z ( 1 − z ) F″ ( z ) + ( 2 − 3z ) F′ ( z ) − F ( z ) \= 0 . Therefore F ( z ) \= F ( 1, 1 ; 2 ; z ) by ( 5.108 ).

5.31 The condition f ( k ) \= T ( k + 1 ) − T ( k ) implies that f ( k + 1 ) /f ( k ) \= (T ( k + 2 ) /T ( k + 1 ) − 1 )/ (1 − T ( k ) /T ( k + 1 )) is a rational function of k .

5.32 When summing a polynomial in k , Gosper’s method reduces to the “method of undetermined coefficients.” We have q ( k ) \= r ( k ) \= 1 , and we try to solve p ( k ) \= s ( k + 1 ) − s ( k ) . The method suggests letting s ( k ) be a polynomial whose degree is d \= deg ( p ) + 1 .

5.33 The solution to k = (k – 1)s(k + 1) – (k + 1) is Image ; hence the answer is ( 1 − 2k ) /2k ( k − 1 ) + C .

5.34 The limiting relation holds because all terms for k > c vanish, and Image − c cancels with − c in the limit of the other terms. Therefore the second partial sum is lim Image →0 F(– m , – n ; Image – m ; 1) Image .

5.35 (a) 2 − n 3 n [ n ⩾ 0 ] . (b) (1 – Image ) – k–1 [ k ⩾0] = 2 k+1 [ k ⩾ 0].

5.36 The sum of the digits of m + n is the sum of the digits of m plus the sum of the digits of n , minus p − 1 times the number of carries, because each carry decreases the digit sum by p − 1 . [See [ 226 ] for extensions of this result to generalized binomial coefficients.]

5.37 Dividing the first identity by n ! yields Image , Vandermonde’s convolution. The second identity follows, for example, from the formula Image if we negate both x and y .

5.38 Choose c as large as possible such that Image . Then Image ; replace n by Image and continue in the same fashion. Conversely, any such representation is obtained in this way. (We can do the same thing with

Image

for any fixed m .)

5.39 Image for all m > 0 and n > 0 , by induction on m + n .

5.40 Image .

5.41 Image , which is 2 2n n ! / ( 2n + 1 )! .

5.42 We treat n as an indeterminate real variable. Gosper’s method with q ( k ) \= k + 1 and r ( k ) \= k − 1 − n has the solution s ( k ) \= 1/ ( n + 2 ) ; hence the desired indefinite sum is Image . And if 0 ⩽ m ⩽ n ,

Image

This exercise, incidentally, implies the formula

Image

a “ dual” to the basic recurrence ( 5.8 ).

5.43 After the hinted first step we can apply ( 5.21 ) and sum on k . Then ( 5.21 ) applies again and Vandermonde’s convolution finishes the job. (A combinatorial proof of this identity has been given by Andrews [ 10 ]. There’s a quick way to go from this identity to a proof of ( 5.29 ), explained in [ 207 , exercise 1.2.6–62].)

5.44 Cancellation of factorials shows that

Image

so the second sum is Image times the first. And the first is just the special case l \= 0 , n \= b , r \= a , s \= m + n − b of ( 5.32 ), so it is Image .

5.45 According to ( 5.9 ), Image . If this form of the answer isn’t “closed” enough, we can apply ( 5.35 ) and get Image .

5.46 By ( 5.69 ), this convolution is the negative of the coefficient of z 2n in Image –1 (z) Image –1 (–z). Now Image ; hence Image . By the binomial theorem,

Image

so the answer is Image .

The boxed sentence on the other side of this page is true.

5.47 It’s the coefficient of z n in ( Image r (z) s /Q r (z))( Image r (z) –s /Q r (z)) = Q r (z) –2 , where Q r (z) = 1 – r + r Image r (z) –1 , by ( 5.61 ).

5.48 Image , a special case of ( 5.111 ).

5.49 Saalschütz’s identity ( 5.97 ) yields

Image

5.50 The left-hand side is

Image

and the coefficient of z n is

Image

by Vandermonde’s convolution ( 5.92 ).

5.51 (a) Reflection gives F ( a, − n ; 2a ; 2 ) \= (– 1 ) n F ( a, − n ; 2a ; 2 ) . (Incidentally, this formula implies the remarkable identity Δ 2m + 1 f ( 0 ) \= 0 , when f ( n ) \= 2 n x n / ( 2x ) n .)

(b) The term-by-term limit is Image plus an additional term for k \= 2m − 1 . The additional term is

Image

hence, by ( 5.104 ), this limit is Image , the negative of what we had.

Term limits?

5.52 The terms of both series are zero for k > N . This identity corresponds to replacing k by N − k . Notice that

Image

5.53 When Image , the left side of ( 5.110 ) is 1 − 2z and the right side is ( 1 − 4z + 4z 2 ) 1/2 , independent of a . The right side is the formal power series

Image

which can be expanded and rearranged to give 1 − 2z + 0z 2 + 0z 3 + · · · ; but the rearrangement involves divergent series in its intermediate steps when z \= 1 , so it is not legitimate.

The boxed sentence on the other side of this page is false.

5.54 If m + n is odd, say 2N − 1 , we want to show that

Image

Equation ( 5.92 ) applies, since − m + Image > − m − Image + Image , and the denominator factor Γ ( c − b ) \= Γ ( N − m ) is infinite since N ⩽ m ; the other factors are finite. Otherwise m + n is even; setting n \= m − 2N we have

Image

by ( 5.93 ). The remaining job is to show that

Image

and this is the case x \= N of exercise 22 .

5.55 Let Q ( k ) \= ( k + A 1 ) . . . ( k + A M ) Z and R ( k ) \= ( k + B 1 ) . . . ( k + B N ) ( k + 1 ) . Then t ( k + 1 ) /t ( k ) \= P ( k + 1 ) Q ( k ) /P ( k ) R ( k + 1 ) , where P ( k ) \= Q ( k ) − R ( k ) is a nonzero polynomial.

5.56 The solution to –( k + 1 )( k + 2 ) \= s ( k + 1 )+ s ( k ) is s( k ) = – Image k 2 – k – Image ; hence Image δ k = Image (–1) k–1 (2 k 2 + 4 k + 1) + C. Also

Image

5.57 We have t ( k + 1 ) /t ( k ) \= ( k − n )( k + 1 + θ )(– z ) / ( k + 1 )( k + θ ) . Therefore we let p ( k ) \= k + θ , q ( k ) \= ( k − n )(– z ) , r ( k ) \= k . The secret function s ( k ) must be a constant α 0 , and we have

k + θ \= (– z ( k − n ) − k ) α 0 ;

hence α 0 \= − 1/ ( 1 + z ) and θ \= − nz/ ( 1 + z ) . The sum is

Image

(The special case z \= 1 was mentioned in ( 5.18 ).)

5.58 If m > 0 we can replace Image by Image and derive the formula Image . The summation factor Image is therefore appropriate:

Image

We can unfold this to get

Image

Finally T 0 , n–m \= H n–m , so Image . (It’s also possible to derive this result by using generating functions; see Example 2 in Section 7.5 .)

5.59 Image , which is Image .

5.60 Image is the case m \= n of

Image

5.61 Let Image n/p Image \= q and n mod p \= r . The polynomial identity ( x + 1 ) p ≡ x p + 1 (mod p ) implies that

( x + 1 ) pq+r ≡ ( x + 1 ) r ( x p + 1 ) q     (mod p ).

The coefficient of x m on the left is Image . On the right it’s Image , which is just Image because 0 ⩽ r < p .

5.62 Image , because all terms of the sum are multiples of p 2 except for the Image terms in which exactly m of the k ’s are equal to p . ( Stanley [ 335 , exercise 1.6(d)] shows that the congruence actually holds modulo p 3 when p > 3 .)

5.63 This is Image . The denominator of ( 5.74 ) is zero when z \= − 1/4 , so we can’t simply plug into that formula. The recurrence S n \= − 2S n – 1 − S n – 2 leads to the solution S n \= (– 1 ) n ( 2n + 1 ) .

5.64 Image , which is Image

5.65 Multiply both sides by n n − 1 and replace k by n − 1 − k to get

Image

(The partial sums can, in fact, be found by Gosper’s algorithm.) Alternatively, Image can be interpreted as the number of mappings of { 1 , . . . , n } into itself with f ( 1 ) , . . . , f ( k ) distinct but f ( k + 1 ) ∈ { f ( 1 ) , . . . , f ( k ) } ; summing on k must give n n .

5.66 This is a walk-the-garden-path problem where there’s only one “obvious” way to proceed at every step. First replace k − j by l , then replace Image by k , getting

Image

The infinite series converges because the terms for fixed j are dominated by a polynomial in j divided by 2 j . Now sum over k , getting

Image

Absorb the j + 1 and apply ( 5.57 ) to get the answer, 4 ( m + 1 ) .

5.67 Image by ( 5.26 ), because

Image

5.68 Using the fact that

Image

we get Image .

The boxed sentence on the other side of this page is not a sentence.

5.69 Since Image , the minimum occurs when the k ’s are as equal as possible. Hence, by the equipartition formula of Chapter 3 , the minimum is

Image

A similar result holds for any lower index in place of 2 .

5.70 This is Image ; but it’s also Image if we replace k by n − k . Now Image by Gauss’s identity ( 5.111 ). (Alternatively, Image by the reflection law ( 5.101 ), and Kummer’s formula ( 5.94 ) relates this to ( 5.55 ).) The answer is 0 when n is odd, Image when n is even. (See [ 164 , §1.2] for another derivation. This sum arises in the study of a simple search algorithm [ 195 ].)

5.71 (a) Observe that

Image

(b) Here Image , so we have A(z/ ( 1 − z ) 2 ) \= 1 − z . Thus Image .

5.72 The stated quantity is m ( m − n ) . . . (m − ( k − 1 ) n) n k − ν ( k ) /k ! . Any prime divisor p of n divides the numerator at least k − ν ( k ) times and divides the denominator at most k − ν ( k ) times, since this is the number of times 2 divides k ! . A prime p that does not divide n must divide the product m ( m − n ) . . . (m − ( k − 1 ) n) at least r times if p r divides k ! , because we have Image when nn′ ≡ 1 .

5.73 Plugging in X n \= n ! yields α \= β \= 1 ; plugging in X n \= n ¡ yields α \= 1 , β \= 0 . Therefore the general solution is X n \= αn ¡ + β ( n ! − n ¡ ) .

5.74 Image

5.75 The recurrence S k ( n + 1 ) \= S k ( n )+ S ( k − 1 ) mod 3 ( n ) makes it possible to verify inductively that two of the S ’s are equal and that S (– n ) mod 3 ( n ) differs from them by (– 1 ) n . These three values split their sum S 0 ( n ) + S 1 ( n ) + S 2 ( n ) \= 2 n as equally as possible, so there must be 2 n mod 3 occurrences of Image 2 n /3 Image and 3 − ( 2 n mod 3 ) occurrences of Image 2 n /3 Image .

5.76 Image

5.77 The terms are zero unless k 1 ⩽ · · · ⩽ k m , when the product is the multinomial coefficient

Image

Therefore the sum over k 1 , . . . , k m – 1 is m k m , and the final sum over k m yields ( m n + 1 − 1 ) / ( m − 1 ) .

The boxed sentence on the other side of this page is not boxed.

5.78 Extend the sum to k \= 2m 2 + m − 1 ; the new terms are Image . Since m ⊥ ( 2m + 1 ) , the pairs (k mod m , k mod ( 2m + 1 )) are distinct. Furthermore, the numbers ( 2j + 1 ) mod ( 2m + 1 ) as j varies from 0 to 2m are the numbers 0 , 1 , . . . , 2m in some order. Hence the sum is

Image

5.79 (a) The sum is 2 2n − 1 , so the gcd must be a power of 2 . If n \= 2 k q where q is odd, Image is divisible by 2 k + 1 and not by 2 k + 2 . Each Image is divisible by 2 k + 1 (see exercise 36 ), so this must be the gcd. (b) If p r ⩽ n + 1 < p r + 1 , we get the most radix p carries by adding k to n − k when k \= p r − 1 . The number of carries in this case is r − Image p ( n + 1 ) , and r \= Image p (L ( n + 1 )) .

5.80 First prove by induction that k ! ⩾ ( k/e ) k .

5.81 Let f l,m,n ( x ) be the left-hand side. It is sufficient to show that we have f l,m,n ( 1 ) > 0 and that Image . The value of f l,m,n ( 1 ) is Image by ( 5.23 ), and this is positive because the binomial coefficient has exactly n − m − 1 negative factors. The inequality is true when l \= 0 , for the same reason. If l > 0 , we have Image , which is negative by induction.

5.82 Let Image p ( a ) be the exponent by which the prime p divides a , and let m \= n − k . The identity to be proved reduces to

min( Image p ( m )– Image p ( m+k ), Image p ( m+k+1 )– Image p ( k+ 1 ), Image p ( k )– Image p ( m+ 1 ))

    = min( Image p ( k )– Image p ( m+k ), Image p ( m )– Image p ( k+ 1 ), Image p ( m+k+ 1 )– Image p ( m+ 1 )) .

For brevity let’s write this as min ( x 1 , y 1 , z 1 ) \= min ( x 2 , y 2 , z 2 ) . Notice that x 1 + y 1 + z 1 \= x 2 + y 2 + z 2 . The general relation

Image p ( a ) < Image p ( b )     ⇒      Image p ( a ) = Image p (| a ± b |)

allows us to conclude that x 1 ≠ x 2 ⇒ min ( x 1 , x 2 ) \= 0 ; the same holds also for ( y 1 , y 2 ) and ( z 1 , z 2 ) . It’s now a simple matter to complete the proof.

5.83 (Solution by P. Paule.) Let r be a nonnegative integer. The given sum is the coefficient of x l y m in

Image

so it is clearly Image . (See also exercise 106 .)

5.84 Following the hint, we get

Image

and a similar formula is obtained for ℇ t (z). Thus the respective formulas Image and Image give the respective right-hand sides of ( 5.61 ). We must therefore prove that

Image

and these follow from ( 5.59 ).

5.85 If f ( x ) \= a n x n + · · · + a 1 x + a 0 is any polynomial of degree ⩽ n , we can prove inductively that

Image

The stated identity is the special case where a n \= 1/n ! and x k \= k 3 .

5.86 (a) First expand with n ( n − 1 ) index variables l ij for all i ≠ j . Setting k ij \= l ij − l ji for 1 ⩽ i < j < n and using the constraints ∑ i ≠ j ( l ij − l ji ) \= 0 for all i < n allows us to carry out the sums on l jn for 1 ⩽ j < n and then on l ji for 1 ⩽ i < j < n by Vandermonde’s convolution. (b) f ( z ) − 1 is a polynomial of degree < n that has n roots, so it must be zero. (c) Consider the constant terms in

Image

5.87 The first term is Image , by ( 5.61 ). The summands in the second term are

Image

Since ∑ 0 ⩽ j<m ( ζ 2j + 1 ) k \= m (– 1 ) l [ k \= ml ] , these terms sum to

Image

Incidentally, the functions Image m (z m ) and ς 2j+1 z Image 1+1/m (ς 2j+1 z) 1/m are the m + 1 complex roots of the equation w m + 1 − w m \= z m .

5.88 Use the facts that Image and ( 1 − e − t ) /t ⩽ 1 . (We have Image as k → ∞ , by ( 5.83 ); so this bound implies that Stirling’s series Image converges when x > − 1 . Hermite [ 186 ] showed that the sum is ln Γ ( 1 + x ).)

5.89 Adding this to ( 5.19 ) gives y − r ( x + y ) m + r on both sides, by the binomial theorem. Differentiation gives

Image

and we can replace k by k + m + 1 and apply ( 5.15 ) to get

Image

In hypergeometric form, this reduces to

Image

which is the special case ( a , b , c , z ) \= ( n + 1 , m + 1 + r , m + 2, − x/y ) of the reflection law ( 5.101 ). (Thus ( 5.105 ) is related to reflection and to the formula in exercise 52 .)

The boxed sentence on the other side of this page is self-referential.

5.90 If r is a nonnegative integer, the sum is finite, and the derivation in the text is valid as long as none of the terms of the sum for 0 ⩽ k ⩽ r has zero in the denominator. Otherwise the sum is infinite, and the k th term Image is approximately k s − r (– s − 1 )! / (– r − 1 )! by ( 5.83 ). So we need r > s + 1 if the infinite series is going to converge. (If r and s are complex, the condition is ℜ r > ℜ s + 1 , because | k z | \= k ℜz .) The sum is

Image

by ( 5.92 ); this is the same formula we found when r and s were integers.

5.91 (It’s best to have computer help for this.) Incidentally, when c \= ( a + 1 ) /2 , this reduces to an identity that’s equivalent to Gauss’s identity ( 5.110 ), in view of Pfaff’s reflection law. For if w \= − z/ ( 1 − z ) we have 4w ( 1 − w ) \= − 4z/ ( 1 − z ) 2 , and

Image

5.92 The identities can be proved, as Clausen proved them more than 150 years ago, by showing that both sides satisfy the same differential equation. One way to write the resulting equations between coefficients of z n is in terms of binomial coefficients:

Image

Another way is in terms of hypergeometrics:

Image

The boxed sentence on the other side of this page is not self-referential.

5.93 Image

5.94 Gosper’s algorithm finds the answer Image . Consequently, when m ⩾ 0 is an integer less than n , we have

Image

5.95 The leading coefficients of p and r should be unity, and p should have no factors in common with q or r . It is easy to fulfill these additional conditions by shuffling factors around.

Now suppose p ( k + 1 ) q ( k ) /p ( k ) r ( k + 1 ) \= P ( k + 1 ) Q ( k ) /P ( k ) R ( k + 1 ) , where the polynomials ( p , q , r ) and ( P , Q , R ) both satisfy the new criteria. Let p 0 ( k ) \= p ( k ) /g ( k ) and P 0 ( k ) \= P ( k ) /g ( k ) , where g ( k ) \= gcd (p ( k ) , P ( k )) is the product of all common factors of p and P . Then

p 0 ( k + 1 ) q ( k ) P 0 ( k ) R ( k + 1 ) \= p 0 ( k ) r ( k + 1 ) P 0 ( k + 1 ) Q ( k ) .

Suppose p 0 ( k ) ≠ 1 . Then there is a complex number α such that p 0 ( α ) \= 0 ; this implies q ( α ) ≠ 0 , r ( α ) ≠ 0 , and P 0 ( α ) ≠ 0 . Hence we must have p 0 ( α + 1 ) R ( α + 1 ) \= 0 and p 0 ( α − 1 ) Q ( α − 1 ) \= 0 . Let N be a positive integer such that p 0 ( α + N ) ≠ 0 and p 0 ( α − N ) ≠ 0 . Repeating the argument N times, we find R ( α + 1 ) . . . R ( α + N ) \= 0 \= Q ( α − 1 ) . . . Q ( α − N ) , contradicting ( 5.118 ). Therefore p 0 ( k ) \= 1 . Similarly P 0 ( k ) \= 1 , so p ( k ) \= P ( k ) . Now q ( α ) \= 0 implies r ( α + 1 ) ≠ 0 , by ( 5.118 ), hence q ( k ) \ Q ( k ) . Similarly Q ( k ) \ q ( k ) , so q ( k ) \= Q ( k ) since they have the same leading coefficient. That leaves r ( k ) \= R ( k ) .

5.96 If r ( k ) is a nonzero rational function and T ( k ) is a hypergeometric term, then r ( k ) T ( k ) is a hypergeometric term, which is called similar to T ( k ) . (We allow r ( k ) to be ∞ and T ( k ) to be 0 , or vice versa, for finitely many values of k .) In particular, T ( k + 1 ) is always similar to T ( k ) . If T 1 ( k ) and T 2 ( k ) are similar hypergeometric terms, then T 1 ( k ) + T 2 ( k ) is a hypergeometric term. If T 1 ( k ) , . . . , T m ( k ) are mutually dissimilar, and m > 1 , then T 1 ( k ) + · · · + T m ( k ) cannot be zero for all but finitely many k . For if it could, consider a counterexample for which m is minimum, and let r j ( k ) \= T j ( k + 1 ) /T j ( k ) . Since T 1 ( k ) + · · · + T m ( k ) \= 0 , we have r m ( k ) T 1 ( k ) + · · · + r m ( k ) T m ( k ) \= 0 and r 1 ( k ) T 1 ( k ) + · · · + r m ( k ) T m ( k ) \= T 1 ( k + 1 ) + · · · + T m ( k + 1 ) \= 0 ; hence (r m ( k ) − r 1 ( k )) T 1 ( k ) + · · · + (r m ( k ) − r m – 1 ( k )) T m – 1 ( k ) \= 0 . We cannot have r m ( k ) − r j ( k ) \= 0 , for any j < m , since T j and T m are dissimilar. But m was minimum, so this cannot be a counterexample; it follows that m \= 2 . But then T 1 ( k ) and T 2 ( k ) must be similar, since they are both zero for all but finitely many k .

Now let t ( k ) be any hypergeometric term with t ( k + 1 ) /t ( k ) \= r ( k ) , and suppose that t ( k ) \= (T 1 ( k + 1 ) + · · · + T m ( k + 1 )) − (T 1 ( k ) + · · · + T m ( k )) , where m is minimal. Then T 1 , . . . , T m must be mutually dissimilar. Let r j ( k ) be the rational function such that

r ( k ) (T j ( k + 1 ) − T j ( k )) − (T j ( k + 2 ) − T j ( k + 1 )) \= r j ( k ) T j ( k ) .

Suppose m > 1 . Since 0 \= r ( k ) t ( k )– t ( k + 1 ) \= r 1 ( k ) T 1 ( k )+ · · · + r m ( k ) T m ( k ) , we must have r j ( k ) \= 0 for all but at most one value of j . If r j ( k ) \= 0 , the function Image satisfies Image . So Gosper’s algorithm will find a solution.

Burma-Shave

5.97 Suppose first that z is not equal to − d − 1/d for any integer d > 0 . Then in Gosper’s algorithm we have p ( k ) \= 1 , q ( k ) \= ( k + 1 ) 2 , r ( k ) \= k 2 + kz + 1 . Since deg ( Q ) < deg ( R ) and deg ( p ) − deg ( R ) + 1 \= − 1 , the only possibility is z \= d + 2 where d is a nonnegative integer. Trying s ( k ) \= α d k d + · · · + α 0 fails when d \= 0 but succeeds whenever d > 0 . (The linear equations obtained by equating coefficients of k d , k d − 1 , . . . , k 1 in ( 5.122 ) express α d – 1 , . . . , α 0 as positive multiples of α d , and the remaining equation 1 \= α d + · · · + α 1 then defines α d .) For example, when z \= 3 the indefinite sum is Image .

If z \= − d − 1/d , on the other hand, the stated terms t ( k ) are infinite for k ⩾ d . There are two reasonable ways to proceed: We can cancel the zero in the denominator by redefining

Image

thereby making t ( k ) \= 0 for 0 ⩽ k < d and positive for k ⩾ d . Then Gosper’s algorithm gives p ( k ) \= k d , q ( k ) \= k + 1 , r ( k ) \= k − 1/d , and we can solve ( 5.122 ) for s ( k ) because the coefficient of k j on the right is ( j + 1 + 1/d ) α j plus multiples of { α j + 1 , . . . , α d } . For example, when d \= 2 the indefinite sum is Image .

Alternatively, we can try to sum the original terms, but only in the range 0 ⩽ k < d . Then we can replace p ( k ) \= k d by

Image

This is justified since ( 5.117 ) still holds for 0 ⩽ k < d − 1 ; we have Image , so this trick essentially cancels a 0 from the numerator and denominator of ( 5.117 ) as in L’Hospital’s rule. Gosper’s method now yields an indefinite sum.

Look, any finite sequence is trivially summable, because we can find a polynomial that matches t ( k ) for 0 ⩽ k < d .

5.98 nS n + 1 \= 2nS n . (Beware: This gives no information about S 1 /S 0 .)

5.99 Let p(n, k) = (n + 1 + k)β 0 (n) + (n + 1 + a + b + c + k)β 1 (n) = Image (n, k), Image (n, k) = t(n, k)/(n + 1 + k), q(n, k) = (n + 1 + a + b + c + k)(a – k)(b – k), r(n, k) = (n + 1 + k)(c + k)k. Then ( 5.129 ) is solved by β 0 ( n ) \= ( n + 1 + a + b + c )( n + 1 + a + b ) , β 1 ( n ) \= –( n + 1 + a )( n + 1 + b ) , α 0 ( n ) \= s ( n , k ) \= − 1 . We discover ( 5.134 ) by observing that it is true when n \= − a and using induction on n .

5.100 The Gosper–Zeilberger algorithm discovers easily that

Image

Summing from k \= 0 to n − 1 yields Image . Hence ( 2n + 2 ) S n + 1 \= ( n + 2 ) S n + 2n + 2 . Applying a summation factor now leads to the expression Image .

5.101 (a) If we hold m fixed, the Gosper–Zeilberger algorithm discovers that ( n + 2 ) S m,n + 2 ( z ) \= ( z − 1 )( n + 1 ) S m,n ( z ) + ( 2n + 3 − z ( n − m + 1 )) S m,n + 1 ( z ) . We can also apply the method to the term

β 0 ( m , n ) t ( m , n , k ) + β 1 ( m , n ) t ( m + 1 , n , k ) + β 2 ( m , n ) t ( m , n + 1 , k ) ,

in which case we get a simpler recurrence,

( m + 1 ) S m + 1,n ( z ) − ( n + 1 ) S m,n + 1 ( z ) \= ( 1 − z )( m − n ) S m,n ( z ) .

(b) Now we must work a little harder, with five equations in six unknowns. The algorithm finds

Image

Therefore ( n + 1 )( z − 1 ) 2 S n ( z ) − ( 2n + 3 )( z + 1 ) S n + 1 ( z ) + ( n + 2 ) S n + 2 ( z ) \= 0 . Incidentally, this recurrence holds also for negative n , and we have S – n – 1 ( z ) \= S n ( z ) / ( 1 − z ) 2n + 1 .

The sum S n ( z ) can be regarded as a modified form of the Legendre polynomial Image , since we can write Image . Similarly, Image is a modified Jacobi polynomial.

How about z \= 0 ?

5.102 The sum is Image , so we need not consider the case z \= − 1 . Let n \= 3m . We seek solutions to ( 5.129 ) when

p ( m , k ) \= ( 3m + 3 − k ) 3 ( m + 1 − k ) β 0 + ( 4m + 4 − b − k ) 4 β 1 ,

q ( m , k ) \= ( 3m + 3 − k )( m + 1 − a − k ) z ,

r ( m , k ) \= k ( 4m + 1 − b − k ) ,

s ( m , k ) \= α 2 k 2 + α 1 k + α 0 .

The resulting five homogeneous equations have a nonzero solution ( α 0 , α 1 , α 2 , β 0 , β 1 ) if and only if the determinant of coefficients is zero; and this determinant, a polynomial in m , vanishes only in eight cases. One of those cases is, of course, ( 5.113 ); but we can now evaluate the sum for all nonnegative integers n , not just n ≢ 2 (mod 3 ):

Image

Here the notation [ c 0 , c 1 , c 2 ] stands for the single value c n mod 3 . Another case, Image , yields the identity

Image

(This sum, amazingly, is zero unless n is a multiple of 3 ; and then the identity can be written

Image

which might even be useful.) The remaining six cases generate even weirder sums

Image

where the respective values of ( a , b , z , c 0 , c 1 , c 2 , a′ , b′ , x ) are

Image

5.103 We assume that each Image and Image is nonzero, since the corresponding factors would otherwise have no influence on the degrees in k . Let Image where

Image

Then we have Image , Image , except in unusual cases where cancellation occurs in the leading coefficient. And Image , again except in unusual cases.

(These estimates can be used to show directly that, as l increases, the degree of Image eventually becomes large enough to make a polynomial s ( n , k ) possible, and the number of unknown α j and β j eventually becomes larger than the number of homogeneous linear equations to be solved. So we obtain another proof that the Gosper–Zeilberger algorithm succeeds, if we argue as in the text that there must be a solution with β 0 ( n ) , . . . , β l ( n ) not all zero.)

5.104 Let t ( n , k ) \= (– 1 ) k ( r − s − k )! ( r − 2k )! / (( r − s − 2k )! ( r − n − k + 1 )! ( n − k )! k !) . Then β 0 ( n ) t ( n , k ) + β 1 ( n ) t ( n + 1 , k ) is not summable in hypergeometric terms, because deg( Image ) = 1, deg ( q − r ) \= 3 , deg ( q + r ) \= 4 , λ \= − 8 , λ′ \= − 4 ; but β 0 ( n ) t ( n , k ) + β 1 ( n ) t ( n + 1 , k ) + β 2 ( n ) t ( n + 2 , k ) is—basically because λ′ \= 0 when q ( n , k ) \= –( r − s − 2k )( r − s − 2k − 1 )( n + 2 − k )( r − n − k + 1 ) and r ( k ) \= ( r − s − k + 1 )( r − 2k + 2 )( r − 2k + 1 ) k . The solution is

β 0 ( n ) \= ( s − n )( r − n + 1 )( r − 2n + 1 ) ,

β 1 ( n ) \= ( rs − s 2 − 2rn + 2n 2 − 2r + 2n )( r − 2n − 1 ) ,

β 2 ( n ) \= ( s − r + n + 1 )( n + 2 )( r − 2n − 3 ) ,

α 0 ( n ) \= r − 2n − 1 ,

and we may conclude that β 0 ( n ) S n + β 1 ( n ) S n + 1 + β 2 ( n ) S n + 2 \= 0 when S n denotes the stated sum. This suffices to prove the identity by induction, after verifying the cases n \= 0 and n \= 1 .

But S n also satisfies the simpler recurrence Image , where Image and Image . Why didn’t the method discover this? Well, nobody ever said that such a recurrence necessarily forces the terms Image to be indefinitely summable. The surprising thing is that the Gosper–Zeilberger method actually does find the simplest recurrence in so many other cases.

Notice that the second-order recurrence we found can be factored:

Image

where N is the shift operator in ( 5.145 ).

5.105 Set a \= 1 and compare the coefficients of z 3n on both sides of Henrici’s “ friendly monster” identity,

Image

where f ( a , z ) \= F ( 1 ; a , 1 ; z ) . The identity can be proved by showing that both sides satisfy the same differential equation.

Peter Paule has found another interesting way to evaluate the sum:

Image

using the binomial theorem, Vandermonde’s convolution, and the fact that [ z 0 ] g ( az ) \= [ z 0 ] g ( z ) . We can now set N \= 3n and apply the Gosper–Zeilberger algorithm to this sum S n , miraculously obtaining the first-order recurrence ( n + 1 ) 2 S n + 1 \= 4 ( 4n + 1 )( 4n + 3 ) S n ; the result follows by induction.

If 3n is replaced by 3n + 1 or 3n + 2 , the stated sum is zero. Indeed, ∑ k + l + m \= N t ( k , l , m ) ω l − m is always zero when N mod 3 ≠ 0 and t ( k , l , m ) \= t ( l , m , k ) .

5.106 (Solution by Shalosh B Ekhad.) Let

Image

The stated equality is routinely verifiable, and ( 5.32 ) follows by summing with respect to j and k . (We sum T ( r , j + 1 , k ) − T ( r , j , k ) first with respect to j , then with respect to k ; we sum the other terms U ( r , j , k + 1 ) − U ( r , j , k ) first with respect to k , then with respect to j .)

Well, we also need to verify ( 5.32 ) when r \= 0 . In that case it reduces via trinomial revision to Image . We are assuming that l , m , and n are integers and n ⩾ 0 . Both sides are clearly zero unless n + l ⩾ 0 . Otherwise we can replace k by n − k and use ( 5.24 ).

Notice that 1/nk is proper, since it’s ( n − 1 )!( k − 1 )! / n ! k ! . Also 1/ ( n 2 − k 2 ) is proper. But 1/ ( n 2 + k 2 ) isn’t .

5.107 If it were proper, there would be a linear difference operator that annihilates it. In other words, we would have a finite summation identity

Image

where the α ’s are polynomials in n , not all zero. Choose integers i , j , and n such that n > 1 and α i,j ( n ) ≠ 0 . Then when k \= − 1/ ( n + i ) − j , the ( i , j ) term in the sum is infinite but the other terms are finite.

5.108 Replace k by m − k in the double sum, then use ( 5.28 ) to sum on k , getting

Image

trinomial revision ( 5.21 ) then yields one of the desired formulas.

It appears to be difficult to find a direct proof that the two symmetrical sums for A m,n are equal. We can, however, prove the equation indirectly with the Gosper–Zeilberger algorithm, by showing that both sums satisfy the recurrence

( n + 1 ) 3 A m,n − f ( m , n ) A m,n + 1 + ( n + 2 ) 3 A m,n + 2 \= 0 ,

where f ( m , n ) \= ( 2n + 3 )( n 2 + 3n + 2m 2 + 2m + 3 ) . Setting Image and Image , we find

( n + 1 ) 2 t j ( n , k ) − f ( m , n ) t j ( n + 1 , k ) + ( n + 2 ) 2 t j ( n + 2 , k )
\= T j ( n , k + 1 ) − T j ( n , k ) ,

where T 1 ( n , k ) \= − 2 ( 2n + 3 ) k 4 t 1 ( n , k ) / ( n + 1 − k )( n + 2 − k ) and T 2 ( n , k ) \= − (( n + 2 )( 4mn + n + 3m 2 + 8m + 2 ) − 2 ( 3mn + n + m 2 + 6m + 2 ) k + ( 2m + 1 ) k 2 ) k 2 ( m + n + 1 − k ) 2 t 2 ( n , k ) / ( n + 2 − k ) 2 . This proves the recurrence, so we need only verify equality when n \= 0 and n \= 1 . (We could also have used the simpler recurrence

m 3 A m,n – 1 − n 3 A m – 1,n \= ( m − n )( m 2 + n 2 − mn ) A m – 1,n – 1 ,

which can be discovered by the method of exercise 101 .)

The fact that the fir st formula for A m,n equals the third implies a remarkable identity between the generating functions ∑ m,n A m,n w m z n :

Image

where Image . It turns out, in fact, that

Image

this is a special case of an identity discovered by Bailey [ 19 ].

5.109 Let Image for any positive integers a 0 , a 1 , . . . , a l , and any integer x . Then if 0 ⩽ m < p we have

Image

And corresponding terms are congruent (mod p ), because exercise 36 implies that they are multiples of p when lj + m ⩾ p , exercise 61 implies that the binomials are congruent when lj + m < p , and ( 4.48 ) implies that x p ≡ x .

5.110 The congruence surely holds if 2n + 1 is prime. Steven Skiena has also found the example n \= 2953 , when 2n + 1 \= 3 · 11 · 179 .

Ilan Vardi notes that the condition holds for 2n + 1 \= p 2 , where p is prime, if and only if 2 p − 1 mod p 2 \= 1 . This yields two more examples: n \= ( 1093 2 − 1 ) /2 ; n \= ( 3511 2 − 1 ) /2 .

5.111 See [ 96 ] for partial results. The computer experiments were done by V. A. Vyssotsky.

5.112 If n is not a power of 2 , we know from exercise 36 that Image is a multiple of 4 . Otherwise the stated phenomenon was verified for all values of n ⩽ 2 22000 by A. Granville and O. Ramaré, who also sharpened a theorem of Sárközy [ 317 ] by showing that Image is divisible by the square of a prime for all n > 2 22000 . This established a long-standing conjecture that Image is never squarefree when n > 4 .

The analogous conjectures for cubes are that Image is divisible by the cube of a prime for all n > 1056 , and by either 2 3 or 3 3 for all n > 2 29 + 2 23 . This has been verified for all n < 2 10000 . Paul Erd ő s conjectures that, in fact, Image tends to infinity as n → ∞ ; this might be true even if we restrict p to the values 2 and 3 .

5.113 The theorem about generating functions in exercise 7.20 may help resolve this conjecture.

5.114 Strehl [ 344 ] has shown that Image is a so-called Franel number [ 132 ], and that Image . In another direction, H. S. Wilf has shown that Image is an integer for all m when n ⩽ 9 .

Late-breaking news: W. Zudilin has found an explicit expression for each Image as a summation of binomial coefficients; see Electronic Journal of Combinatorics, vol. 11 (2004), #R22, pages 1–8.

6.1 2314 , 2431 , 3241 , 1342 , 3124 , 4132 , 4213 , 1423 , 2143 , 3412 , 4321 .

6.2 Image , because every such function partitions its domain into k nonempty subsets, and there are m k ways to assign function values for each partition. (Summing over k gives a combinatorial proof of ( 6.10 ).)

6.3 Now d k + 1 ⩽ ( center of gravity ) − Image \= 1 − Image + ( d 1 + · · · + d k ) /k . This recurrence is like ( 6.55 ) but with 1 − Image in place of 1 ; hence the optimum solution is d k + 1 \= ( 1 − Image ) H k . This is unbounded as long as Image < 1 .

6.4 Image . (Similarly Image .)

6.5 U n ( x , y ) is equal to

Image

and the first sum is

Image

The remaining k − 1 can be absorbed, and we have

Image

This proves ( 6.75 ). Let R n ( x , y ) \= x − n U n ( x , y ) ; then R 0 ( x , y ) \= 0 and R n ( x , y ) \= R n – 1 ( x , y )+ 1/n + y/x , hence R n ( x , y ) \= H n + ny/x . (Incidentally, the original sum U n \= U n ( n, − 1 ) doesn’t lead to a recurrence such as this; therefore the more general sum, which detaches x from its dependence on n , is easier to solve inductively than its special case. This is another instructive example where a strong induction hypothesis makes the difference between success and failure.)

The Fibonacci recurrence is additive, but the rabbits are multiplying.

6.6 Each pair of babies bb present at the end of a month becomes a pair of adults aa at the end of the next month; and each pair aa becomes an aa and a bb . Thus each bb behaves like a drone in the bee tree and each aa behaves like a queen, except that the bee tree goes backward in time while the rabbits are going forward. There are F n + 1 pairs of rabbits after n months; F n of them are adults and F n – 1 are babies. (This is the context in which Fibonacci originally introduced his numbers.)

6.7 (a) Set k \= 1 − n and apply ( 6.107 ). (b) Set m \= 1 and k \= n − 1 and apply ( 6.128 ).

6.8 55 + 8 + 2 becomes 89 + 13 + 3 \= 105 ; the true value is 104.60736 .

That “true value” is the length of 65 international miles, but the international mile is actually only .999998 as big as a U. S. statute mile. There are exactly 6336 kilometers in 3937 U. S. statute miles; the Fibonacci method converts 3937 to 6370.

6.9 21 . (We go from F n to F n + 2 when the units are squared. The true answer is about 20.72 .)

6.10 The partial quotients a 0 , a 1 , a 2 , . . . are all equal to 1 , because ϕ \= 1 + 1/ϕ . (The Stern–Brocot representation is therefore RLRLRLRLRL . . . .)

6.11 Image ; see ( 6.11 ).

6.12 This is a consequence of ( 6.31 ) and its dual in Table 264 .

6.13 The two formulas are equivalent, by exercise 12 . We can use induction. Or we can observe that z n D n applied to f ( z ) \= z x gives x n z x while ϑ n applied to the same function gives x n z x ; therefore the sequence Image ϑ 0 , ϑ 1 , ϑ 2 , . . . Image must relate to Image z 0 D 0 , z 1 D 1 , z 2 D 2 , . . . Image as Image x 0 , x 1 , x 2 , . . . Image relates to Image x 0 , x 1 , x 2 , . . . Image .

6.14 We have

Image

because ( n + 1 ) x \= ( k + 1 )( x + k − n ) + ( n − k )( x + k + 1 ) . (It suffices to verify the latter identity when k \= 0 , k \= − 1 , and k \= n .)

6.15 Since Image , we have the general formula

Image

Set x \= 0 and appeal to ( 6.19 ).

6.16 Image ; this sum is always finite.

6.17 (a) Image (b) Image (c) Image

6.18 This is equivalent to ( 6.3 ) or ( 6.8 ).

6.19 Use Table 272 .

6.20 Image

6.21 The hinted number is a sum of fractions with odd denominators, so it has the form a/b with b odd. (Incidentally, Bertrand’s postulate implies that b n is also divisible by at least one odd prime, whenever n > 2 .)

6.22 | z /k ( k + z ) | ⩽ 2| z | /k 2 when k > 2 | z | , so the sum is well defined when the denominators are not zero. If z \= n we have Image , which approaches H n as m → ∞ . (The quantity H z – 1 − γ is often called the psi function ψ ( z ) .)

6.23 z/ ( e z + 1 ) \= z/ ( e z − 1 ) − 2z/ ( e 2z − 1 ) \= ∑ n ⩾ 0 ( 1 − 2 n ) B n z n /n ! .

6.24 When n is odd, T n ( x ) is a polynomial in x 2 , hence its coefficients are multiplied by even numbers when we form the derivative and compute T n + 1 ( x ) by ( 6.95 ). (In fact we can prove more: The Bernoulli number B 2n always has 2 to the first power in its denominator, by exercise 54 ; hence 2 2n − k \\ T 2n + 1 ⇔ 2 k \\ ( n + 1 ) . The odd positive integers ( n + 1 ) T 2n + 1 /2 2n are called Genocchi numbers Image 1 , 1 , 3 , 17 , 155 , 2073, . . . Image , after Genocchi [ 145 ].)

(Of course Euler knew the Genocchi numbers long before Genocchi was born; see [ 110 ], Volume 2, Chapter 7 , § 181.)

6.25 100n − nH n < 100 ( n − 1 ) − ( n − 1 ) H n – 1 ⇔ H n – 1 > 99 . (The least such n is approximately e 99 − γ , while he finishes at N ≈ e 100 − γ , about e times as long. So he is getting closer during the final 63% of his journey.)

6.26 Let u ( k ) \= H k – 1 and Δv ( k ) \= 1/k , so that u ( k ) \= v ( k ) . Then we have Image .

6.27 Observe that when m > n we have gcd ( F m , F n ) \= gcd ( F m – n , F n ) by ( 6.108 ). This yields a proof by induction.

6.28 (a) Q n \= α ( L n − F n ) /2 + βF n . (The solution can also be written Image .

6.29 When k \= 0 the identity is ( 6.133 ). When k \= 1 it is, essentially,

Image

in Morse code terms, the second product on the right subtracts out the cases where the first product has intersecting dashes. When k > 1 , an induction on k suffices, using both ( 6.127 ) and ( 6.132 ). (The identity is also true when one or more of the subscripts on K become − 1 , if we adopt the convention that K – 1 \= 0 . When multiplication is not commutative, Euler’s identity remains valid for k \= n − 1 if we write it in the form

Image

For example, we obtain the somewhat surprising noncommutative factorizations

( abc + a + c )( 1 + ba ) \= ( ab + 1 )( cba + a + c )

from the case m \= 0 , n \= 3 .)

6.30 The derivative of K ( x 1 , . . . , x n ) with respect to x m is

K ( x 1 , . . . , x m – 1 ) K ( x m + 1 , . . . , x n ) ,

and the second derivative is zero; hence the answer is

K ( x 1 , . . . , x n ) + K ( x 1 , . . . , x m – 1 ) K ( x m + 1 , . . . , x n ) y .

6.31 Since Image , we have Image . These coefficients, incidentally, satisfy the recurrence

Image .

Image

6.32 Image generalizes ( 6.22 ) to negative n; and Image , generalizes ( 6.20 ) to negative m , n .

6.33 If n > 0 , we have Image , by ( 6.71 ); Image , by ( 6.19 ).

6.34 We have Image ; and in general Image is given by ( 6.38 ) for all integers n .

6.35 Let n be the least integer > 1/ Image such that Image H n Image > Image H n – 1 Image .

6.36 Now d k + 1 \= (100 +( 1 + d 1 )+ · · · +( 1 + d k )) / ( 100 + k ) , and the solution is d k + 1 \= H k + 100 − H 101 + 1 for k ⩾ 1 . This exceeds 2 when k ⩾ 176 .

6.37 The sum (by parts) is Image . The infinite sum is therefore ln m . (It follows that

Image

because ν m ( k ) \= ( m − 1 ) ∑ j ⩾ 1 ( k mod m j ) /m j .)

6.38 Image . (By parts, using ( 5.16 ).)

6.39 Write it as ∑ 1 ⩽ j ⩽ n j − 1 ∑ j ⩽ k ⩽ n H k and sum first on k via ( 6.67 ), to get

Image

6.40 If 6n − 1 is prime, the numerator of

Image

is divisible by 6n − 1 , because the sum is

Image

Similarly if 6n + 1 is prime, the numerator of Image is a multiple of 6n + 1. For 1987 we sum up to k = 1324.

6.41 Image , hence we have S n + 1 + Image . The answer is F n + 2 .

6.42 F n .

6.43 Set Image in Σ n⩾0 F n z n = z/(1 – z – z 2 ) to get Image . The sum is a repeating decimal with period length 44:

0.11235 95505 61797 75280 89887 64044 94382 02247 19101 12359 55 + .

6.44 Replace ( m , k ) by (– m, − k ) or ( k, − m ) or (– k , m ) , if necessary, so that m ⩾ k ⩾ 0 . The result is clear if m \= k . If m > k , we can replace ( m , k ) by ( k , m − k ) and use induction.

6.45 X n \= A ( n ) α + B ( n ) β + C ( n ) γ + D ( n ) δ , where B ( n ) \= F n , A ( n ) \= F n – 1 , A ( n ) + B ( n ) − D ( n ) \= 1 , and B ( n ) − C ( n ) + 3D ( n ) \= n .

6.46 ϕ/2 and ϕ − 1 /2 . Let u \= cos 72 ° and v \= cos 36 °; then u \= 2v 2 − 1 and v \= 1 − 2 sin 2 18 ° \= 1 − 2u 2 . Hence u + v \= 2 ( u + v )( v − u ) , and 4v 2 − 2v − 1 \= 0 . We can pursue this investigation to find the five complex fifth roots of unity:

Image

“Let p be any old prime.”
(See [ 171 ], p. 419.)

6.47 Image , and the even powers of Image cancel out. Now let p be an odd prime. Then Image except when k \= ( p − 1 ) /2 , and Image except when k \= 0 or k \= ( p − 1 ) /2 ; hence F p ≡ 5 ( p − 1 ) /2 and 2F p + 1 ≡ 1 + 5 ( p − 1 ) /2 (mod p ). It can be shown that 5 ( p − 1 ) /2 ≡ 1 when p has the form 10k ± 1 , and 5 ( p − 1 ) /2 ≡ − 1 when p has the form 10k ± 3 .

6.48 Let K i,j \= K j – i + 1 ( x i , . . . , x j ) . Using ( 6.133 ) repeatedly, both sides expand to ( K 1,m – 2 ( x m – 1 + x m + 1 ) + K 1,m – 3 ) K m + 2,n + K 1,m – 2 K m + 3,n .

6.49 Set Image in ( 6.146 ); the partial quotients are 0 , 2 F 0 , 2 F 1 , 2 F 2 , . . .  . ( Knuth [ 206 ] noted that this number is transcendental.)

6.50 (a) f ( n ) is even ⇔ 3 \ n . (b) If the binary representation of n is ( 1 a 1 0 a 2 . . . 1 a m − 1 0 a m ) 2 , where m is even, we have f ( n )= K ( a 1 , a 2 , . . . , a m – 1 ) .

6.51 (a) Combinatorial proof: The arrangements of { 1 , 2 , . . . , p } into k subsets or cycles are divided into “orbits” of 1 or p arrangements each, if we add 1 to each element modulo p . For example,

Image

We get an orbit of size 1 only when this transformation takes an arrangement into itself; but then k \= 1 or k \= p . Alternatively, there’s an algebraic proof: We have x p ≡ x p + x 1 and x p ≡ x p − x (mod p ), since Fermat’s theorem tells us that x p − x is divisible by ( x − 0 )( x − 1 ) . . . (x − ( p − 1 )) .

(b) This result follows from (a) and Wilson’s theorem; or we can use Image .

(c) We have Image for 3 ⩽ k ⩽ p , then Image for 4 ⩽ k ⩽ p , etc. (Similarly, we have Image .)

(d) Image . But Image , so

Image

is a multiple of p 2 . (This is called Wolstenholme’s theorem.)

(Attention, computer programmers: Here’s an interesting condition to test, for as many primes as you can.)

6.52 (a) Observe that Image , where Image . (b) Working mod 5 we have H r \= Image 0 , 1 , 4 , 1 , 0 Image for 0 ⩽ r ⩽ 4 . Thus the first solution is n \= 4 . By part (a) we know that 5 \ a n ⇒ 5 \ a Image n/5 Image ; so the next possible range is n \= 20 + r , 0 ⩽ r ⩽ 4 , when we have H n = Image . The numerator of Image , like the numerator of H 4 , is divisible by 25 . Hence the only solutions in this range are n \= 20 and n \= 24 . The next possible range is n \= 100 + r ; now Image , which is Image plus a fraction whose numerator is a multiple of 5 . If Image , where m is an integer, the harmonic number H 100 + r will have a numerator divisible by 5 if and only if m + H r ≡ 0 (mod 5 ); hence m must be ≡ 0 , 1 , or 4 . Working modulo 5 we find Image ; hence there are no solutions for 100 ⩽ n ⩽ 104 . Similarly there are none for 120 ⩽ n ⩽ 124 ; we have found all three solutions.

(By exercise 6.51 ( d ), we always have p 2 \ a p – 1 , p \ a p 2 − p , and p \ a p 2 − 1 , if p is any prime ⩾ 5 . The argument just given shows that these are the only solutions to p \ a n if and only if there are no solutions to p − 2 H p – 1 + H r ≡ 0 (mod p ) for 0 ⩽ r < p . The latter condition holds not only for p \= 5 but also for p \= 13 , 17 , 23 , 41 , and 67 —perhaps for infinitely many primes. The numerator of H n is divisible by 3 only when n \= 2 , 7 , and 22 ; it is divisible by 7 only when n \= 6 , 42 , 48 , 295 , 299 , 337 , 341 , 2096 , 2390 , 14675 , 16731 , 16735 , and 102728 . See the answer to exercise 92 .)

6.53 Summation by parts yields

Image

(The numerators of Bernoulli numbers played an important role in early studies of Fermat’s Last Theorem; see Ribenboim [ 308 ].)

6.54 (a) If m ⩾ p we have S m ( p ) ≡ S m –( p – 1 ) ( p ) (mod p ), since k p − 1 ≡ 1 when 1 ⩽ k < p . Also S p – 1 ( p ) ≡ p − 1 ≡ − 1 . If 0 < m < p − 1 , we can write

Image

(b) The condition in the hint implies that the denominator of I 2n is not divisible by any prime p ; hence I 2n must be an integer. To prove the hint, we may assume that n>1 . Then

Image

is an integer, by ( 6.78 ), ( 6.84 ), and part (a). So we want to verify that none of the fractions Image has a denominator divisible by p . The denominator of Image isn’t divisible by p , since B k has no p 2 in its denominator (by induction); and the denominator of p 2n − k − 1 / ( 2n − k + 1 ) isn’t divisible by p , since 2n − k + 1 < p 2n − k when k ⩽ 2n − 2 ; QED. (The numbers I 2n are tabulated in [ 224 ]. Hermite calculated them through I 18 in 1875 [ 184 ]. It turns out that I 2 \= I 4 \= I 6 \= I 8 \= I 10 \= I 12 \= 1 ; hence there is actually a “simple” pattern to the Bernoulli numbers displayed in the text, including Image . But the numbers I 2n don’t seem to have any memorable features when 2n > 12 . For example, Image , and 86579 is prime.)

(c) The numbers 2 − 1 and 3 − 1 always divide 2n . If n is prime, the only divisors of 2n are 1 , 2 , n , and 2n , so the denominator of B 2n for prime n > 2 will be 6 unless 2n + 1 is also prime. In the latter case we can try 4n + 3 , 8n + 7 , . . . , until we eventually hit a nonprime (since n divides 2 n − 1 n + 2 n − 1 − 1 ). (This proof does not need the more difficult, but true, theorem that there are infinitely many primes of the form 6k + 1 .) The denominator of B 2n can be 6 also when n has nonprime values, such as 49 .

6.55 The stated sum is Image , by Vandermonde’s convolution. To get ( 6.70 ), differentiate and set x \= 0 .

6.56 First replace k n + 1 by (( k − m ) + m) n + 1 and expand in powers of k − m ; simplifications occur as in the derivation of ( 6.72 ). If m > n or m < 0 , the answer is Image . Otherwise we need to take the limit of ( 5.41 ) minus the term for k \= m , as x → − m ; the answer comes to Image .

6.57 First prove by induction that the n th row contains at most three distinct values A n ⩾ B n ⩾ C n ; if n is even they occur in the cyclic order [ C n , B n , A n , B n , C n ] , while if n is odd they occur in the cyclic order [ C n , B n , A n , A n , B n ] . Also

A 2 n + 1 = A 2 n + B 2 n ;

A 2 n = 2 A 2 n – 1 ;

B 2 n + 1 = B 2 n + C 2 n ;

B 2 n = A 2 n – 1 + B 2 n – 1 ;

C 2 n + 1 = 2 C 2 n ;

C 2 n = B 2 n – 1 + B 2 n – 1 .

It follows that Q n \= A n − C n \= F n + 1 . (See exercise 5.75 for wraparound binomial coefficients of order 3 .)

6.58 (a) Image . (Square Binet’s formula ( 6.123 ) and sum on n , then combine terms so that ϕ and Image disappear.) (b) Similarly,

Image

It follows that Image . (The corresponding recurrence for m th powers involves the Fibonomial coefficients of exercise 86 ; it was discovered by Jarden and Motzkin [ 194 ].)

6.59 Let m be fixed. We can prove by induction on n that it is, in fact, possible to find such an x with the additional condition x ≢ 2 (mod 4 ). If x is such a solution, we can move up to a solution modulo 3 n + 1 because

Image

either x or x + 8 · 3 n − 1 or x + 16 · 3 n − 1 will do the job.

6.60 F 1 + 1 , F 2 + 1 , F 3 + 1 , F 4 − 1 , and F 6 − 1 are the only cases. Otherwise the Lucas numbers of exercise 28 arise in the factorizations

Image

(We have F m + n − (– 1 ) n F m – n \= L m F n in general.)

6.61 1/F 2m \= F m – 1 /F m − F 2m – 1 /F 2m when m is even and positive. The second sum is 5/4 − F 3 · 2 n − 1 /F 3 · 2 n , for n ⩾ 1 .

6.62 (a) Image and Image . Incidentally, we also have Image and Image . (b) A table of small values reveals that

Image

(c) B n /A n + 1 − B n – 1 /A n \= 1/ ( F 2n + 1 + 1 ) because Image and Image . Notice that B n /A n+1 = (F n /F n+1 )[n even]+(L n /L n+1 )[n odd]. (d) Similarly, Image . This quantity can also be expressed as ( 5F n /L n + 1 )[ n even ] + ( L n /F n + 1 )[ n odd ] .

6.63 (a) Image . There are Image with π n \= n and Image with π n < n . (b) Image . Each permutation ρ 1 . . . ρ n – 1 of { 1 , . . . , n − 1 } leads to n permutations π 1 π 2 . . . π n \= ρ 1 . . . ρ j – 1 n ρ j + 1 . . . ρ n – 1 ρ j . If ρ 1 . . . ρ n – 1 has k excedances, there are k + 1 values of j that yield k excedances in π 1 π 2 . . . π n ; the remaining n − 1 − k values yield k + 1 . Hence the total number of ways to get k excedances in π 1 π 2 . . . π n is Image .

6.64 The denominator of Image , by the proof in exercise 5.72 . The denominator of Image is the same, by ( 6.44 ), because Image and Image is even for k > 0 .

6.65 This is equivalent to saying that Image is the probability that we have Image x 1 + · · · + x n Image \= k , when x 1 , . . . , x n are independent random numbers uniformly distributed between 0 and 1 . Let y j \= ( x 1 + · · · + x j ) mod 1 . Then y 1 , . . . , y n are independently and uniformly distributed, and Image x 1 + · · · + x n Image is the number of descents in the y ’s. The permutation of the y ’s is random, and the probability of k descents is the same as the probability of k ascents.

6.66 2 n + 1 ( 2 n + 1 − 1 ) B n + 1 / ( n + 1 ) , if n > 0 . (See ( 7.56 ) and ( 6.92 ); the desired numbers are essentially the coefficients of 1 − tanh z .)

6.67 It is Image by ( 6.3 ) and ( 6.40 ). Now use ( 6.34 ). (This identity has a combinatorial interpretation [ 59 ].)

6.68 We have the general formula

Image

analogous to ( 6.38 ). When m \= 2 this equals

Image

6.69 Image . (It would be nice to automate the derivation of formulas such as this.)

6.70 1/k − 1/ ( k + z ) \= z/k 2 − z 2 /k 3 + · · · , which converges when | z | < 1 .

6.71 Note that Image . If Image we find f ( z ) /z ! + γ \= H z .

6.72 For tan z , we can use tan z \= cot z − 2 cot 2z (which is equivalent to the identity of exercise 23 ). Also Image has the power series ∑ n ⩾ 0 (– 1 ) n − 1 ( 4 n − 2 ) B 2n z 2n / ( 2n )! ; and

Image

because Image and Image .

6.73 cot ( z + π ) \= cot z and Image ; hence the identity is equivalent to

Image

which follows by induction from the case n \= 1 . The stated limit follows since z cot z → 1 as z → 0 . It can be shown that term-by-term passage to the limit is justified, hence ( 6.88 ) is valid. (Incidentally, the general formula

Image

is also true. It can be proved from ( 6.88 ), or from

Image

which is equivalent to the partial fraction expansion of 1/ ( z n − 1 ) .)

6.74 Since tan 2z + sec 2z \= ( sin z + cos z ) / ( cos z − sin z ) , setting x \= 1 in ( 6.94 ) gives T n ( 1 ) \= 2 n E n , where 1/ cos z \= ∑ n ⩾ 0 E 2n z 2n / ( 2n )! . (The coefficients E n are called Euler numbers in combinatorics, not to be confused with the Eulerian numbers Image . We have Image E 0 , E 1 , E 2 , . . . Image \= Image 1 , 1 , 1 , 2 , 5 , 16 , 61 , 272 , 1385 , 7936 , 50521 , . . . Image . Numerical analysts define Euler numbers differently: Their E n is (– 1 ) n/2 E n [ n even ] in the notation above.)

6.75 Let G ( w , z ) \= sin z/ cos ( w + z ) and H ( w , z ) \= cos z/ cos ( w + z ) , and let G ( w , z ) + H ( w , z ) \= ∑ m,n E m,n w m z n /m ! n ! . Then the equations G ( w , 0 ) \= 0 and Image imply that E m,0 \= 0 when m is odd, E m,n + 1 \= E m + 1,n + E m,n when m + n is even; the equations H ( 0 , z ) \= 1 and Image imply that E 0,n \= [ n \= 0 ] when n is even, E m + 1,n \= E m,n + 1 + E m,n when m + n is odd. Consequently the n th row below the apex of the triangle contains the numbers E n,0 , E n – 1,1 , . . . , E 0,n . At the left, E n,0 is the secant number E n [ n even ] ; at the right, E 0,n \= T n + [ n \= 0 ] .

6.76 Let A n denote the sum. Looking ahead to equation ( 7.49 ), we see that Image . When n > 0, it follows by exercise 23 or 72 that

A n \= ( 2 n + 1 − 4 n + 1 ) B n + 1 / ( n + 1 ) \= (– 1 ) ( n + 1 ) /2 T n + [ n \= 0 ] .

6.77 This follows by induction on m , using the recurrence in exercise 18 . It can also be proved from ( 6.50 ), using the fact that

Image

The latter equation, incidentally, is equivalent to

Image

6.78 If p ( x ) is any polynomial of degree ⩽ n , we have

Image

because this equation holds for x \= 0 , − 1 , . . . , − n . The stated identity is the special case where p ( x ) \= xσ n ( x ) and x \= 1 . Incidentally, we obtain a simpler expression for Bernoulli numbers in terms of Stirling numbers by setting k \= 1 in ( 6.99 ):

Image

6.79 Sam Loyd [ 256 , pages 288 and 378] gave the construction

Image

and claimed to have invented (but not published) the 64 \= 65 arrangement in 1858. (Similar paradoxes go back at least to the eighteenth century, but Loyd found better ways to present them.)

He also published it in the Brooklyn Daily Eagle (28 August 1904), 39; (11 September 1904), 37.

6.80 We expect A m /A m – 1 ≈ ϕ , so we try A m – 1 \= 618034 + r and A m – 2 \= 381966 − r . Then A m – 3 \= 236068 + 2r , etc., and we find A m – 18 \= 144 − 2584r , A m – 19 \= 154 + 4181r . Hence r \= 0 , x \= 154 , y \= 144 , m \= 20 .

6.81 If P ( F n + 1 , F n ) \= 0 for infinitely many even values of n , then P ( x , y ) is divisible by U ( x , y ) − 1 , where U ( x , y ) \= x 2 − xy − y 2 . For if t is the total degree of P , we can write

Image

Then

Image

and we have Image by taking the limit as n → ∞ . Hence Q ( x , y ) is a multiple of U ( x , y ) , say A ( x , y ) U ( x , y ) . But U ( F n + 1 , F n ) \= (– 1 ) n and n is even, so P 0 ( x , y ) \= P ( x , y ) − (U ( x , y ) − 1) A ( x , y ) is another polynomial such that P 0 ( F n + 1 , F n ) \= 0 . The total degree of P 0 is less than t , so P 0 is a multiple of U − 1 by induction on t .

Similarly, P ( x , y ) is divisible by U ( x , y ) + 1 if P ( F n + 1 , F n ) \= 0 for infinitely many odd values of n . A combination of these two facts gives the desired necessary and sufficient condition: P ( x , y ) is divisible by U ( x , y ) 2 − 1 .

6.82 First add the digits without carrying, getting digits 0 , 1 , and 2 . Then use the two carry rules

Image

always applying the leftmost applicable carry. This process terminates because the binary value obtained by reading ( b m . . . b 2 ) F as ( b m . . . b 2 ) 2 increases whenever a carry is performed. But a carry might propagate to the right of the “ Fibonacci point”; for example, ( 1 ) F +( 1 ) F becomes ( 10.01 ) F . Such rightward propagation extends at most two positions; and those two digit positions can be zeroed again by using the text’s “add 1 ” algorithm if necessary.

Incidentally, there’s a corresponding “ multiplication” operation on nonnegative integers: If m \= F j 1 + · · · + F j q and n \= F k 1 + · · · + F k r in the Fibonacci number system, let Image , by analogy with multiplication of binary numbers. (This definition implies that Image when m and n are large, although 1 ο n ≈ ϕ 2 n .) Fibonacci addition leads to a proof of the associative law l ο ( m ο n ) \= ( l ο m ) ο n .

Exercise: m ο n \= mn + Image ( m + 1 ) /ϕ Image n + m Image ( n + 1 ) /ϕ Image .

6.83 Yes; for example, we can take

           A 0

=

   331635635998274737472200656430763 ;

           A 1

=

1510028911088401971189590305498785 .

The resulting sequence has the property that A n is divisible by (but unequal to) p k when n mod m k \= r k , where the numbers ( p k , m k , r k ) have the following 18 respective values:

( 3 , 4 , 1 )

 

( 2 , 3 , 2 )

 

( 5 , 5 , 1 )

( 7 , 8 , 3 )

 

( 17 , 9 , 4 )

 

( 11 , 10 , 2 )

( 47 , 16 , 7 )

 

( 19 , 18 , 10 )

 

( 61 , 15 , 3 )

( 2207 , 32 , 15 )

 

( 53 , 27 , 16 )

 

( 31 , 30 , 24 )

( 1087 , 64 , 31 )

 

( 109 , 27 , 7 )

 

( 41 , 20 , 10 )

( 4481 , 64 , 63 )

 

( 5779 , 54 , 52 )

 

( 2521 , 60 , 60 )

One of these triples applies to every integer n ; for example, the six triples in the first column cover every odd value of n , and the middle column covers all even n that are not divisible by 6 . The remainder of the proof is based on the fact that A m + n \= A m F n – 1 + A m + 1 F n , together with the congruences

A 0 ≡ F m k – r k mod p k ,

A 1 ≡ F m k – r k + 1 mod p k ,

for each of the triples ( p k , m k , r k ) . (An improved solution, in which A 0 and A 1 are numbers of “only” 17 digits each, is also possible [ 218 ].)

6.84 The sequences of exercise 62 satisfy A – m \= A m , B – m \= − B m , and

A m A n \= A m + n + A m – n ;

A m B n \= B m + n − B m – n ;

B m B n \= A m + n − A m – n .

Let f k \= B mk /A mk + l and g k \= A mk /B mk + l , where Image . Then f k + 1 − f k \= A l B m / ( A 2mk + n + A m ) and g k − g k + 1 \= A l B m / ( A 2mk + n − A m ) ; hence we have

Image

6.85 The property holds if and only if N has one of the seven forms 5 k , 2 · 5 k , 4 · 5 k , 3 j · 5 k , 6 · 5 k , 7 · 5 k , 14 · 5 k .

6.86 For any positive integer m , let r ( m ) be the smallest index j such that C j is divisible by m ; if no such j exists, let r ( m ) \= ∞ . Then C n is divisible by m if and only if gcd ( C n , C r ( m ) ) is divisible by m if and only if C gcd ( n,r ( m )) is divisible by m if and only if gcd ( n , r ( m )) \= r ( m ) if and only if n is divisible by r ( m ) .

(Conversely, the gcd condition is easily seen to be implied by the condition that the sequence C 1 , C 2 , . . . has a function r ( m ) , possibly infinite, such that C n is divisible by m if and only if n is divisible by r ( m ) .)

Now let Π ( n ) \= C 1 C 2 . . . C n , so that

Image

If p is prime, the number of times p divides Π ( n ) is f p ( n ) \= ∑ k ⩾ 1 Image n/r ( p k ) Image , since Image n/p k Image is the number of elements { C 1 , . . . , C n } that are divisible by p k . Therefore f p ( m + n ) ⩾ f p ( m ) + f p ( n ) for all p , and Image is an integer.

6.87 The matrix product is

Image

This relates to products of L and R as in ( 6.137 ), because we have

Image

The determinant is K n ( x 1 , . . . , x n ) ; the more general tridiagonal determinant

Image

satisfies the recurrence D n \= x n D n – 1 − y n D n – 2 .

6.88 Let α − 1 \= a 0 + 1/ (a 1 + 1/ ( a 2 + · · · )) be the continued fraction representation of α − 1 . Then we have

Image

where

Image

A proof analogous to the text’s proof of ( 6.146 ) uses a generalization of Zeckendorf’s theorem ( Fraenkel [ 129 , §4]). If z \= 1/b , where b is an integer ⩾ 2 , this gives the continued fraction representation of the transcendental number ( b − 1 ) ∑ n ⩾ 1 b − Image nα Image , as in exercise 49 .

6.89 Let p \= K ( 0 , a 1 , a 2 , . . . , a m ) , so that p/n is the m th convergent to the continued fraction. Then α \= p/n + (– 1 ) m /nq , where q \= K ( a 1 , . . . , a m , β ) and β > 1 . The points { kα } for 0 ⩽ k < n can therefore be written

Image

where π 1 . . . π n – 1 is a permutation of { 1 , . . . , n − 1 } . Let f ( v ) be the number of such points < v ; then f ( v ) and vn both increase by 1 when v increases from k/n to ( k + 1 ) /n , except when k \= 0 or k \= n − 1 , so they never differ by 2 or more.

6.90 By ( 6.139 ) and ( 6.136 ), we want to maximize K ( a 1 , . . . , a m ) over all sequences of positive integers whose sum is ⩽ n + 1 . The maximum occurs when all the a ’s are 1 , for if j ⩾ 1 and a ⩾ 1 we have

          K j + k + 1 ( 1 , . . . , 1 , a + 1 , b 1 , . . . , b k )

                   =

K j + k + 1 ( 1 , . . . , 1 , a , b 1 , . . . , b k ) + K j ( 1 , . . . , 1 ) K k ( b 1 , . . . , b k )

⩽

K j + k + 1 ( 1 , . . . , 1 , a , b 1 , . . . , b k ) + K j + k ( 1 , . . . , 1 , a , b 1 , . . . , b k )

=

K j + k + 2 ( 1 , . . . , 1 , a , b 1 , . . . , b k ).

( Motzkin and Straus [ 278 ] show how to solve more general maximization problems on continuants.)

6.91 A candidate for the case n mod Image appears in [ 213 , §6], although it may be best to multiply the integers discussed there by some constant involving Image . An elegant and more convincing proposal has been put forward by Philippe Flajolet and Helmut Prodinger in SIAM Journal on Discrete Mathematics 12 (1999), 155–159.

6.92 (a) David Boyd has shown that there are only finitely many solutions for all p < 500 , except perhaps p \= 83 , 127 , 397 . (b) The behavior of b n is quite strange: We have b n \= lcm ( 1 , . . . , n ) for 968 ⩽ n ⩽ 1066 ; on the other hand, b 600 \= lcm ( 1 , . . . , 600 ) / ( 3 3 · 5 2 · 43 ) . Andrew Odlyzko observes that p divides lcm ( 1 , . . . , n ) /b n if and only if kp m ⩽ n < ( k + 1 ) p m for some m ⩾ 1 and some k < p such that p divides the numerator of H k . Therefore infinitely many such n exist if it can be shown, for example, that almost all primes have only one such value of k (namely k \= p − 1 ).

Another reason to remember 1066?

6.93 ( Brent [ 38 ] found the surprisingly large partial quotient 1568705 in e γ , but this seems to be just a coincidence. For example, Gosper has found even larger partial quotients in π : The 453,294th is 12996958 and the 11,504,931st is 878783625 .)

6.94 Consider the generating function Image , which equals ∑ k (wF ( α′ + β′ + γ′ , α′ + β′ , α′ ) + zF ( α + γ , α + β , α )) k ( 1 ) , where F ( a , b , c ) is the differential operator a + bϑ w + cϑ z .

6.95 An elegant solution to this research problem has been found by Manuel Kauers, Journal of Symbolic Computation 42 (2007), 948–970.

Kauers succeeded even though Stirling numbers are not “holonomic” in the sense of [ 383 ].

7.1 Substitute z 4 for Image and z for Image in the generating function, getting 1/ ( 1 − z 4 − z 2 ) . This is like the generating function for T , but with z replaced by z 2 . Therefore the answer is zero if m is odd, otherwise F m/2 + 1 .

7.2 G ( z ) \= 1/ ( 1 − 2z ) + 1/ ( 1 − 3z ) ; Ĝ ( z ) \= e 2z + e 3z .

7.3 Set z \= 1/10 in the generating function, getting Image ln Image .

7.4 Divide P ( z ) by Q ( z ) , getting a quotient T ( z ) and a remainder P 0 ( z ) whose degree is less than the degree of Q . The coefficients of T ( z ) must be added to the coefficients [ z n ] P 0 ( z ) /Q ( z ) for small n . (This is the polynomial T ( z ) in ( 7.28 ).)

7.5 This is the convolution of ( 1 + z 2 ) r with ( 1 + z ) r , so

S ( z ) \= ( 1 + z + z 2 + z 3 ) r .

Incidentally, no simple form is known for the coefficients of this generating function; hence the stated sum probably has no simple closed form. (We can use generating functions to obtain negative results as well as positive ones.)

7.6 Let the solution to g 0 \= α , g 1 \= β , g n \= g n − 1 + 2g n − 2 + (– 1 ) n γ be g n \= A ( n ) α + B ( n ) β + C ( n ) γ . The function 2 n works when α \= 1 , β \= 2 , γ \= 0 ; the function (– 1 ) n works when α \= 1 , β \= − 1 , γ \= 0 ; the function (– 1 ) n n works when α \= 0 , β \= − 1 , γ \= 3 . Hence A ( n ) + 2B ( n ) \= 2 n , A ( n ) − B ( n ) \= (– 1 ) n , and − B ( n ) + 3C ( n ) \= (– 1 ) n n .

7.7 G ( z ) \= ( z/ ( 1 − z ) 2 ) G ( z ) + 1 , hence

Image

we have g n \= F 2n + [ n \= 0 ] .

I bet that the controversial “fan of order zero” does have one spanning tree.

7.8 Differentiate ( 1 − z ) − x − 1 twice with respect to x , obtaining

Image

Now set x \= m .

7.9 Image

7.10 The identity Image implies that Image .

7.11 (a) C ( z ) \= A ( z ) B ( z 2 ) / ( 1 − z ) . (b) zB′ ( z ) \= A ( 2z ) e z , hence Image . (c) A ( z ) \= B ( z ) / ( 1 − z ) r + 1 , hence B ( z ) \= ( 1 − z ) r + 1 A ( z ) and we have Image .

7.12 C n . The numbers in the upper row correspond to the positions of + 1 ’s in a sequence of + 1 ’s and − 1 ’s that defines a “ mountain range”; the numbers in the lower row correspond to the positions of − 1 ’s. For example, the given array corresponds to

Image

7.13 Extend the sequence periodically (let x m + k \= x k ) and define s n \= x 1 + · · · + x n . We have s m \= l , s 2m \= 2l , etc. There must be a largest index k j such that s k j \= j , s k j + m \= l + j , etc. These indices k 1 , . . . , k l (mod m ) specify the cyclic shifts in question.

For example, in the sequence Image − 2, 1, − 1, 0, 1, 1, − 1, 1, 1, 1 Image with m \= 10 and l \= 2 we have k 1 \= 17 , k 2 \= 24 .

7.14 Ĝ ( z ) \= − 2z Ĝ ( z ) + Ĝ ( z ) 2 + z (be careful about the final term!) leads via the quadratic formula to

Image

Hence g 2n + 1 \= 0 and g 2n \= (– 1 ) n ( 2n )! C n − 1 , for all n > 0 .

7.15 There are Image partitions with k other objects in the subset containing n + 1 . Hence Image . The solution to this differential equation is Image , and c \= − 1 since Image . (We can also get this result by summing ( 7.49 ) on m , since Image .)

7.16 One way is to take the logarithm of

B ( z ) \= 1 /( ( 1 − z ) a 1 ( 1 − z 2 ) a 2 ( 1 − z 3 ) a 3 ( 1 − z 4 ) a 4 . . .) ,

then use the formula for ln Image and interchange the order of summation.

7.17 This follows since Image . There’s also a formula that goes in the other direction:

Image

7.18 (a) Image (b) − ζ′ ( z ) ; (c) ζ ( z ) /ζ ( 2z ) . Every positive integer is uniquely representable as m 2 q , where q is squarefree.

7.19 If n > 0 , the coefficient [ z n ] exp( x ln F ( z ) ) is a polynomial of degree n in x that’s a multiple of x . The first convolution formula comes from equating coefficients of z n in F ( z ) x F ( z ) y \= F ( z ) x + y . The second comes from equating coefficients of z n − 1 in F′ ( z ) F ( z ) x − 1 F ( z ) y \= F′ ( z ) F ( z ) x + y − 1 , because we have

Image

(Further convolutions follow by taking ∂/∂x , as in ( 7.43 ).)

Still more is true, as shown in [ 221 ]: We have

Image

for arbitrary x , y , and t . In fact, xf n ( x + tn ) / ( x + tn ) is the sequence of polynomials for the coefficients of F t ( z ) x , where

F t ( z ) \= F(z F t ( z ) t ) .

(We saw special cases in ( 5.59 ) and ( 6.52 ).)

7.20 Let G ( z ) \= ∑ n ⩾ 0 g n z n . Then

Image

for all k , l ⩾ 0 , if we regard g n \= 0 for n < 0 . Hence if P 0 ( z ) , . . . , P m ( z ) are polynomials, not all zero, having maximum degree d , then there are polynomials p 0 ( n ) , . . . , p m + d ( n ) such that

Image

Therefore a differentiably finite G ( z ) implies that

Image

The converse is similar. (One consequence is that G ( z ) is differentiably finite if and only if the corresponding egf, Ĝ ( z ) , is differentiably finite.)

7.21 This is the problem of giving change with denominations 10 and 20 , so G ( z ) \= 1/ ( 1 − z 10 )( 1 − z 20 ) \= Image ( z 10 ) , where Image ( z ) \= 1/ ( 1 − z )( 1 − z 2 ) . (a) The partial fraction decomposition of Image ( z ) is Image , so Image . Setting n \= 50 yields 26 ways to make the payment. (b) Image ( z ) \= ( 1 + z ) / ( 1 − z 2 ) 2 \= ( 1 + z )( 1 + 2z 2 + 3z 4 + · · · ) , so [ z n ] Image ( z ) \= Image n/2 Image + 1 . (Compare this with the value N n \= Image n/5 Image + 1 in the text’s coin-changing problem. The bank robber’s problem is equivalent to the problem of making change with pennies and tuppences.)

This slow method of finding the answer is just the cashier’s way of stalling until the police come.

The USA has two-cent pieces, but they haven’t been minted since 1873.

7.22 Each polygon has a “base” (the line segment at the bottom). If A and B are triangulated polygons, let A Image B be the result of pasting the base of A to the upper left diagonal of Image , and pasting the base of B to the upper right diagonal. Thus, for example,

Image

(The polygons might need to be warped a bit and/or banged into shape.) Every triangulation arises in this way, because the base line is part of a unique triangle and there are triangulated polygons A and B at its left and right.

Replacing each triangle by z gives a power series in which the coefficient of z n is the number of triangulations with n triangles, namely the number of ways to decompose an ( n + 2 ) -gon into triangles. Since P \= 1 + zP 2 , this is the generating function for Catalan numbers C 0 + C 1 z + C 2 z 2 + · · · ; the number of ways to triangulate an n -gon is Image .

7.23 Let a n be the stated number, and b n the number of ways with a 2 × 1 × 1 notch missing at the top. By considering the possible patterns visible on the top surface, we have

a n \= 2a n − 1 + 4b n − 1 + a n − 2 + [ n \= 0 ] ;
b n \= a n − 1 + b n − 1 .

Hence the generating functions satisfy A \= 2zA + 4zB + z 2 A + 1 , B \= zA + zB , and we have

Image

This formula relates to the problem of 3 × n domino tilings; we have a n = Image , which is Image rounded to the nearest integer.

“Curiously, a 2n is equal to Image , the square of the number of ways to tile a 3 × 2n rectangle with dominoes; and Image .”

—I. Kaplansky

7.24 n ∑ k 1 + ··· + k m \= n k 1 · . . . · k m /m \= F 2n + 1 + F 2n − 1 − 2 . (Consider the coefficient Image , where G ( z ) \= z/ ( 1 − z ) 2 .)

7.25 The generating function is P ( z ) / ( 1 − z m ) , where P ( z ) \= z + 2z 2 + · · · + ( m − 1 ) z m − 1 \= (( m − 1 ) z m + 1 − mz m + z ) / ( 1 − z ) 2 . The denominator is Q ( z ) \= 1 − z m \= ( 1 − ω 0 z )( 1 − ω 1 z ) . . . ( 1 − ω m − 1 z ) . By the rational expansion theorem for distinct roots, we obtain

Image

7.26 Image leads to Image as in equation ( 7.61 ).

7.27 Each oriented cycle pattern begins with Image or Image or a 2 × k cycle (for some k ⩾ 2 ) oriented in one of two ways. Hence

Q n \= Q n – 1 + Q n – 2 + 2Q n – 2 + 2Q n – 3 + · · · + 2Q 0

for n ⩾ 2 ; Q 0 \= Q 1 \= 1 . The generating function is therefore

Image

and Image .

7.28 In general if A ( z ) \= ( 1 + z + · · · + z m − 1 ) B ( z ) , we have A r + A r + m + A r + 2m + · · · \= B ( 1 ) for 0 ⩽ r < m . In this case m \= 10 and B ( z ) \= ( 1 + z + · · · + z 9 )( 1 + z 2 + z 4 + z 6 + z 8 )( 1 + z 5 ) .

7.29 Image , so the answer is Image .

7.30 Image , by exercise 5.39 .

7.31 The dgf is ζ ( z ) 2 /ζ ( z − 1 ) ; hence we find g ( n ) is the product of ( k + 1 − kp ) over all prime powers p k that exactly divide n .

7.32 We may assume that each b k ⩾ 0 . A set of arithmetic progressions forms an exact cover if and only if

Image

Subtract z b m / ( 1 − z a m ) from both sides and set z \= e 2πi/a m . The left side is infinite, and the right side will be finite unless a m − 1 \= a m .

7.33 (– 1 ) n − m + 1 [ n > m ] / ( n − m ) .

7.34 We can also write Image . In general, if

Image

we have G n \= z 1 G n − 1 + z 2 G n − 2 + · · · + z r G n − r + [ n \= 0 ] , and the generating function is 1/ ( 1 − z 1 w − z 2 w 2 − · · · − z r w r ) . In the stated special case the answer is 1/ ( 1 − w − z m w m + 1 ) . (See ( 5.74 ) for the case m \= 1 .)

7.35 (a) Image . (b) Image by ( 7.50 ) and ( 6.58 ). Another way to do part (b) is to use the rule Image with Image .

7.36 Image

7.37 (a) The amazing identity a 2 n \= a 2 n + 1 \= b n holds in the table

Image

(b) A ( z ) \= 1/ (( 1 − z )( 1 − z 2 )( 1 − z 4 )( 1 − z 8 ) . . .). (c) B ( z ) \= A ( z ) / ( 1 − z ) , and we want to show that A ( z ) \= ( 1 + z ) B ( z 2 ) . This follows from A ( z ) \= A ( z 2 ) / ( 1 − z ) .

7.38 ( 1 − wz ) M ( w , z ) \= ∑ m , n ⩾ 1 (min ( m , n ) − min ( m − 1 , n − 1 ) ) w m z n \= ∑ m,n ⩾ 1 w m z n \= wz/ ( 1 − w )( 1 − z ) . In general,

Image

7.39 The answers to the hint are

Image

respectively. Therefore: (a) We want the coefficient of z m in the product ( 1 + z )( 1 + 2z ) . . . ( 1 + nz ) . This is the reflection of Image , so it is Image and the answer is Image . (b) The coefficient of z m in 1 / (( 1 − z )( 1 − 2z ) ... ( 1 − nz )) is Image by ( 7.47 ).

7.40 The egf for Image nF n – 1 − F n Image is Image where Image . The egf for Image n ¡ Image is e − z / ( 1 − z ) . The product is

Image

We have Image . So the answer is (– 1 ) n F n .

7.41 The number of up-down permutations with the largest element n in position 2k is Image . Similarly, the number of up-down permutations with the smallest element 1 in position 2k + 1 is Image , because down-up permutations and up-down permutations are equally numerous. Summing over all possibilities gives

Image

The egf  therefore satisfies 2  ′ ( z ) \=  ( z ) 2 + 1 and  ( 0 ) \= 1 ; the given function solves this differential equation. (Consequently A n is the Euler number E n of exercise 6.74 , namely a secant number when n is even, a tangent number when n is odd.)

7.42 Let a n be the number of Martian DNA strings that don’t end with c or e ; let b n be the number that do. Then

Image

and the total number is [ z n ]( 1 + z ) / ( 1 − 4z − z 2 ) \= F 3n + 2 .

7.43 By ( 5.45 ), g n \= Δ n Ġ ( 0 ) . The n th difference of a product can be written

Image

and Image . Therefore we find

Image

This is a sum over all trinomial coefficients; it can be put into the more symmetric form

Image

The empty set is pointless.

7.44 Each partition into k nonempty subsets can be ordered in k ! ways, so b k \= k ! . Thus Image . And this is the geometric series ∑ k ⩾ 0 e kz /2 k + 1 , hence a k \= 1/2 k + 1 . Finally, c k \= 2 k ; consider all permutations when the x ’s are distinct, change each ‘ > ’ between subscripts to ‘ < ’ and allow each ‘ < ’ between subscripts to become either ‘ < ’ or ‘ \= ’. (For example, the permutation x 1 x 3 x 2 produces x 1 < x 3 < x 2 and x 1 \= x 3 < x 2 , because 1 < 3 > 2 .)

7.45 This sum is ∑ n ⩾ 1 r ( n ) /n 2 , where r ( n ) is the number of ways to write n as a product of two relatively prime factors. If n is divisible by t distinct primes, r ( n ) \= 2 t . Hence r ( n ) /n 2 is multiplicative and the sum is

Image

7.46 Let Image . Then S n \= S n – 1 + αS n – 3 + [ n \= 0 ] , and the generating function is 1/ ( 1 − z − αz 3 ) . When Image , the hint tells us that this has a nice factorization Image . The general expansion theorem now tells us that Image , and the remaining constant c turns out to be Image .

7.47 The Stern–Brocot representation of Image is R ( LR 2 ) ∞ , because

Image

The fractions are Image ; they eventually have the cyclic pattern

Image

7.48 We have g 0 \= 0 , and if g 1 \= m the generating function satisfies

Image

Hence G ( z ) \= P ( z ) / ( az 2 + bz + c )( 1 − z ) for some polynomial P ( z ) . Let ρ 1 and ρ 2 be the roots of cz 2 + bz + a , with | ρ 1 | ⩾ | ρ 2 | . If b 2 − 4ac ⩽ 0 then | ρ 1 | 2 \= ρ 1 ρ 2 \= a/c is rational, contradicting the fact that Image approaches Image . Hence Image ; and this implies that a = –c, b = –2c, Image . The generating function now takes the form

Image

where r \= d/c . Since g 2 is an integer, r is an integer. We also have

Image

and this can hold only if r \= − 1 , because Image alternates in sign as it approaches zero. Hence ( a , b , c , d ) \= ± ( 1 , 2, − 1 , 1 ) . Now we find Image , which is between 0 and 1 only if 0 ⩽ m ⩽ 2 . Each of these values actually gives a solution; the sequences Image g n Image are Image 0 , 0 , 1 , 3 , 8, . . . Image , Image 0 , 1 , 3 , 8 , 20 , . . . Image , and Image 0 , 2 , 5 , 13 , 32 , . . . Image .

7.49 (a) The denominator of Image is 1 − 2z − z 2 ; hence a n \= 2a n − 1 + a n − 2 for n ⩾ 2 . (b) True because a n is even and Image . (c) Let

Image

We would like b n to be odd for all n > 0 , and Image . Working as in part (a), we find b 0 \= 2 , b 1 \= p , and Image for n ⩾ 2 . One satisfactory solution has p \= 3 and q \= 17 .

7.50 Extending the multiplication idea of exercise 22 , we have

Image

Replace each n -gon by z n − 2 . This substitution behaves properly under multiplication, because the pasting operation takes an m -gon and an n -gon into an ( m + n − 2 ) -gon. Thus the generating function is

Image

and the quadratic formula gives Image . The coefficient of z n − 2 in this power series is the number of ways to put nonoverlapping diagonals into a convex n -gon. These coefficients apparently have no closed form in terms of other quantities that we have discussed in this book, but their asymptotic behavior is known [ 207 , exercise 2.2.1–12].

Incidentally, if each n -gon in Q is replaced by wz n − 2 we get

Image

a formula in which the coefficient of w m z n − 2 is the number of ways to divide an n -gon into m polygons by nonintersecting diagonals.

Give me Legendre polynomials and I’ll give you a closed form.

7.51 The key first step is to observe that the square of the number of ways is the number of cycle patterns of a certain kind, generalizing exercise 27 . These can be enumerated by evaluating the determinant of a matrix whose eigenvalues are not difficult to determine. When m \= 3 and n \= 4 , the fact that cos 36 ° \= ϕ/2 is helpful ( exercise 6.46 ).

7.52 The first few cases are p 0 ( y ) \= 1 , p 1 ( y ) \= y , p 2 ( y ) \= y 2 + y , p 3 ( y ) \= y 3 + 3y 2 + 3y . Let p n ( y ) \= q 2n ( x ) where y \= x ( 1 − x ) ; we seek a generating function that defines q 2n + 1 ( x ) in a convenient way. One such function is ∑ n q n ( x ) z n /n ! \= 2e ixz / ( e iz + 1 ) , from which it follows that q n ( x ) \= i n E n ( x ) , where E n ( x ) is called an Euler polynomial. We have Image , so Euler polynomials are analogous to Bernoulli polynomials, and they have factors analogous to those in ( 6.98 ). By exercise 6.23 we have Image ; this polynomial has integer coefficients by exercise 6.54 . Hence q 2n ( x ) , whose coefficients have denominators that are powers of 2 , must have integer coefficients. Hence p n ( y ) has integer coefficients. Finally, the relation Image shows that

Image

and it follows that the Image ’s are positive. (A similar proof shows that the related quantity (– 1 ) n ( 2n + 2 ) E 2n + 1 ( x ) / ( 2x − 1 ) has positive integer coefficients, when expressed as an n th degree polynomial in y .) It can be shown that Image is the Genocchi number (– 1 ) n − 1 ( 2 2n + 1 − 2 ) B 2n (see exercise 6.24 ), and that Image , etc.

7.53 It is P ( 1 + V 4n + 1 + V 4n + 3 ) /6 . Thus, for example, T 20 \= P 12 \= 210 ; T 285 \= P 165 \= 40755 .

7.54 Let E k be the operation on power series that sets all coefficients to zero except those of z n where n mod m \= k . The stated construction is equivalent to the operation

E 0 S E 0 S ( E 0 + E 1 ) S . . . S ( E 0 + E 1 + · · · + E m − 1 )

applied to 1/ ( 1 − z ) , where S means “multiply by 1/ ( 1 − z ) .” There are m ! terms

E 0 S E k 1 S E k 2 S . . . S E k m

where 0 ⩽ k j < j , and every such term evaluates to z rm / ( 1 − z m ) m + 1 if r is the number of places where k j < k j + 1 . Exactly Image terms have a given value of r , so the coefficient of z mn is Image by ( 6.37 ). (The fact that operation E k can be expressed with complex roots of unity seems to be of no help in this problem.)

7.55 Suppose that P 0 ( z ) F ( z ) + · · · + P m ( z ) F ( m ) ( z ) \= Q 0 ( z ) G ( z ) + · · · + Q n ( z ) G ( n ) ( z ) \= 0 , where P m ( z ) and Q n ( z ) are nonzero. (a) Let H ( z ) \= F ( z ) + G ( z ) . Then there are rational functions R k,l ( z ) for 0 ⩽ l < m + n such that H ( k ) ( z ) \= R k,0 ( z ) F ( 0 ) ( z ) + · · · + R k,m − 1 ( z ) F ( m − 1 ) ( z ) + R k,m ( z ) G ( 0 ) ( z ) + · · · + R k,m + n − 1 ( z ) G ( n − 1 ) ( z ) . The m + n + 1 vectors ( R k,0 ( z ) , . . . , R k,m + n − 1 ( z ) ) are linearly dependent in the ( m + n ) -dimensional vector space whose components are rational functions; hence there are rational functions S l ( z ) , not all zero, such that S 0 ( z ) H ( 0 ) ( z ) + · · · + S m + n ( z ) H ( m + n ) ( z ) \= 0 . (b) Similarly, let H ( z ) \= F ( z ) G ( z ) . There are rational R k,l ( z ) for 0 ⩽ l < mn with Image , hence S 0 ( z ) H ( 0 ) ( z ) + · · · + S mn ( z ) H ( mn ) ( z ) \= 0 for some rational S l ( z ) , not all zero. (A similar proof shows that if Image f n Image and Image g n Image are polynomially recursive, so are Image f n + g n Image and Image f n g n Image . Incidentally, there is no similar result for quotients; for example, cos z is differentiably finite, but 1/ cos z is not.)

7.56 Euler [ 113 ] showed that this number is also Image , and he gave the formula Image . He also discovered a “memorable failure of induction” while examining these numbers: Although 3t n − t n + 1 is equal to F n − 1 ( F n − 1 + 1 ) for 0 ⩽ n ⩽ 8 , this empirical law mysteriously breaks down when n is 9 or more! George Andrews [ 12 ] has explained the mystery by showing that the sum ∑ k [ z n + 10k ] ( 1 + z + z 2 ) n can be expressed as a closed form in terms of Fibonacci numbers.

H. S. Wilf observes that [ z n ] ( a + bz + cz 2 ) n = [ z n ] 1/f ( z ) , where Image (see [ 373 , page 159]), and it follows that the coefficients satisfy

( n + 1 ) A n + 1 − ( 2n + 1 ) bA n + n ( b 2 − 4ac ) A n − 1 \= 0 .

The algorithm of Petkovšek [ 291 ] can be used to prove that this recurrence has a closed form solution as a finite sum of hypergeometric terms if and only if abc ( b 2 − 4ac ) \= 0 . Therefore in particular, the middle trinomial coefficients have no such closed form. The next step is presumably to extend this result to a larger class of closed forms (including harmonic numbers and/or Stirling numbers, for example).

Give me Legendre polynomials and I’ll give you a closed form.

7.57 (Paul Erd ő s repeatedly offered $500 for a solution to this problem.)

8.1 Image . (In fact, we always get doubles with probability Image when at least one of the dice is fair.) Any two faces whose sum is 7 have the same probability in distribution Pr 1 , so S \= 7 has the same probability as doubles.

8.2 There are 12 ways to specify the top and bottom cards and 50 ! ways to arrange the others; so the probability is 12.50!/52! = 12/(51.52) = Image .

8.3 Image ( 3 + 2 + · · · + 9 + 2 ) \= 4.8 ; Image ( 3 2 + 2 2 + · · · + 9 2 + 2 2 − 10 ( 4.8 ) 2 ) \= Image , which is approximately 8.6 . The true mean and variance with a fair coin are 6 and 22 , so Stanford had an unusually heads-up class. The corresponding Princeton figures are 6.4 and Image . 12.5 (This distribution has κ 4 \= 2974 , which is rather large. Hence the standard deviation of this variance estimate when n \= 10 is also rather large, Image 20.1 according to exercise 54 . One cannot complain that the students cheated.)

8.4 This follows from ( 8.38 ) and ( 8.39 ), because F ( z ) \= G ( z ) H ( z ) . (A similar formula holds for all the cumulants, even though F ( z ) and G ( z ) may have negative coefficients.)

8.5 Replace H by p and T by q \= 1 − p . If S A \= S B \= Image we have p 2 qN \= Image and pq 2 N \= Image q + Image ; the solution is p \= 1/φ 2 , q \= 1/φ .

8.6 In this case X | y has the same distribution as X , for all y , hence E ( X | Y ) \= EX is constant and V ( E ( X | Y ) ) \= 0 . Also V ( X | Y ) is constant and equal to its expected value.

8.7 We have Image by Chebyshev’s monotonic inequality of Chapter 2 .

8.8 Let p \= Pr ( ω Image A ∩ B ) , q \= Pr ( ω ∉A ) , and r \= Pr ( ω ∉B ) . Then p + q + r \= 1 , and the identity to be proved is p \= ( p + r )( p + q ) − qr .

8.9 This is true (subject to the obvious proviso that F and G are defined on the respective ranges of X and Y ), because

Image

8.10 Two. Let x 1 < x 2 be distinct median elements; then 1 ⩽ Pr ( X ⩽ x 1 ) + Pr ( X ⩾ x 2 ) ⩽ 1 , hence equality holds. (Some discrete distributions have no median elements. For example, let Ω be the set of all fractions of the form ±1/n , with Pr(+1/n) = Pr(–1/n)= Image .)

8.11 For example, let K \= k with probability 4/ ( k + 1 )( k + 2 )( k + 3 ) , for all integers k ⩾ 0 . Then EK \= 1 , but E ( K 2 ) \= ∞ . (Similarly we can construct random variables with finite cumulants through κ m but with κ m + 1 \= ∞ .)

8.12 (a) Let p k \= Pr ( X \= k ) . If 0 < x ⩽ 1 , we have Pr ( X ⩽ r ) \= ∑ k ⩽ r p k ⩽ ∑ k ⩽ r x k − r p k ⩽ ∑ k x k − r p k \= x − r P ( x ) . The other inequality has a similar proof. (b) Let x \= α/ ( 1 − α ) to minimize the right-hand side. (A more precise estimate for the given sum is obtained in exercise 9.42 .)

8.13 (Solution by Boris Pittel.) Let us set Y \= ( X 1 + · · · + X n ) /n and Z \= ( X n + 1 + · · · + X 2n ) /n . Then

Image

Image

The last inequality is, in fact, ‘ > ’ in any discrete probability distribution, because Pr ( Y \= Z ) > 0 .

8.14 Mean ( H ) \= p Mean ( F ) + q Mean ( G ) ; Var ( H ) \= p Var ( F ) + q Var ( G ) + pq (Mean ( F )– Mean ( G )) 2 . (A mixture is actually a special case of conditional probabilities: Let Y be the coin, let X | H be generated by F ( z ) , and let X | T be generated by G ( z ) . Then VX \= EV ( X | Y ) + VE ( X | Y ) , where EV ( X | Y ) \= pV ( X | H ) + qV ( X | T ) and VE ( X | Y ) is the variance of pz Mean ( F ) + qz Mean ( G ) .)

8.15 By the chain rule, H ′ ( z ) \= G ′ ( z ) F ′ (G ( z )) ; H ″ ( z ) \= G ″ ( z ) F ′ ( G ( z ) ) + G ′ ( z ) 2 F ′′ ( G ( z ) ). Hence

Mean ( H ) \= Mean ( F ) Mean ( G ) ;

   Var ( H ) \= Var ( F ) Mean ( G ) 2 + Mean ( F ) Var ( G ) .

(The random variable corresponding to probability distribution H can be understood as follows: Determine a nonnegative integer n by distribution F ; then add the values of n independent random variables that have distribution G . The identity for variance in this exercise is a special case of ( 8.106 ), when X has distribution H and Y has distribution F .)

8.16 e w ( z − 1 ) / ( 1 − w ) .

8.17 Pr ( Y n,p ⩽ m ) \= Pr ( Y n,p + n ⩽ m + n ) \= probability that we need ⩽ m + n tosses to obtain n heads \= probability that m + n tosses yield ⩾ n heads \= Pr ( X m + n,p ⩾ n ) . Thus

Image

and this is ( 5.19 ) with n \= r , x \= q , y \= p .

8.18 (a) G X ( z ) \= e μ ( z − 1 ) . (b) The m th cumulant is μ , for all m ⩾ 1 . (The case μ \= 1 is called F ∞ in ( 8.55 ).)

8.19 (a) G X 1 + X 2 ( z ) \= G X 1 ( z ) G X 2 ( z ) \= e ( μ 1 + μ 2 )( z − 1 ) . Hence the probability is e − μ 1 − μ 2 ( μ 1 + μ 2 ) n /n ! ; the sum of independent Poisson variables is Poisson. (b) In general, if K m X denotes the m th cumulant of a random variable X , we have K m ( aX 1 + bX 2 ) \= a m ( K m X 1 ) + b m ( K m X 2 ) , when a , b ⩾ 0 . Hence the answer is 2 m μ 1 + 3 m μ 2 .

8.20 The general pgf will be G ( z ) \= z m /F ( z ) , where

Image

8.21 This is ∑ n ⩾ 0 q n , where q n is the probability that the game between Alice and Bill is still incomplete after n flips. Let p n be the probability that the game ends at the n th flip; then p n + q n \= q n − 1 . Hence the average time to play the game is ∑ n ⩾ 1 np n \= ( q 0 − q 1 ) + 2 ( q 1 − q 2 ) + 3 ( q 2 − q 3 ) + · · · \= q 0 + q 1 + q 2 + · · · \= N , since lim n →∞ nq n \= 0 .

Another way to establish this answer is to replace H and T by Image z . Then the derivative of the first equation in ( 8.78 ) tells us that Image .

By the way, Image .

8.22 By definition we have V ( X | Y ) \= E ( X 2 | Y )– ( E ( X | Y )) 2 ) and V ( E ( X | Y ) ) \= E ( ( E ( X | Y )) 2 ) − ( E ( E ( X | Y ) )) 2 ; hence E ( V ( X | Y ) ) + V ( E ( X | Y ) ) \= E ( E ( X 2 | Y ) ) − ( E ( E ( X | Y ) )) 2 . But E ( E ( X | Y ) ) \= ∑ y Pr ( Y \= y ) E ( X | y ) \= ∑ x,y Pr ( Y \= y ) × Pr( ( X | y ) \= x ) x \= EX and E ( E ( X 2 | Y ) ) \= E ( X 2 ) , so the result is just VX .

8.23 Let Image and Image ; and let Ω 2 be the other 16 elements of Ω . Then Image according as ω Image Ω 0 , Ω 1 , Ω 2 . The events A must therefore be chosen with k j elements from Ω j , where ( k 0 , k 1 , k 2 ) is one of the following: ( 0 , 0 , 0 ) , ( 0 , 2 , 7 ) , ( 0 , 4 , 14 ) , ( 1 , 4 , 4 ) , ( 1 , 6 , 11 ) , ( 2 , 6 , 1 ) , ( 2 , 8 , 8 ) , ( 2 , 10 , 15 ) , ( 3 , 10 , 5 ) , ( 3 , 12 , 12 ) , ( 4 , 12 , 2 ) , ( 4 , 14 , 9 ) , ( 4 , 16 , 16 ) . For example, there are Image events of type ( 2 , 6 , 1 ) . The total number of such events is [ z 0 ]( 1 + z 20 ) 4 ( 1 + z − 7 ) 16 ( 1 + z 2 ) 16 , which turns out to be 1304872090 . If we restrict ourselves to events that depend on S only, we get 40 solutions S Image A , where Image , and the complements of these sets. (Here the notation ‘ Image ’ means either 2 or 12 but not both.)

8.24 (a) Any one of the dice ends up in J ’s possession with probability Image ; hence Image . Let Image . Then the pgf for J ’s total holdings is ( q + pz ) 2n + 1 , with mean ( 2n + 1 ) p and variance ( 2n + 1 ) pq , by ( 8.61 ). (b) Image .

8.25 The pgf for the current stake after n rolls is G n ( z ) , where

Image

(The noninteger exponents cause no trouble.) It follows that Mean ( G n ) \= Mean ( G n − 1 ) , and Image . So the mean is always A , but the variance grows to Image .

This problem can perhaps be solved more easily without generating functions than with them.

8.26 The pgf F l,n ( z ) satisfies Image ; hence Image and Image ; the variance is easily computed. (In fact, we have

Image

which approaches a Poisson distribution with mean 1/l as n → ∞ .)

8.27 ( n 2 Σ 3 − 3nΣ 2 Σ 1 + 2Σ Image ) /n ( n − 1 )( n − 2 ) has the desired mean, where Image . This follows from the identities

EΣ 3 =

nμ 3 ;

E ( Σ 2 Σ 1 ) =

nμ 3 + n ( n − 1 ) μ 2 μ 1 ;

E ( Σ Image ) =

nμ 3 + 3n ( n − 1 ) μ 2 μ 1 + n ( n − 1 )( n − 2 ) μ Image .

Incidentally, the third cumulant is κ 3 \= E ( ( X − EX ) 3 ), but the fourth cumulant does not have such a simple expression; we have κ 4 \= E ( ( X − EX ) 4 ) − 3 ( VX ) 2 .

8.28 (The exercise implicitly calls for p = q = Image , but the general answer is given here for completeness.) Replace H by pz and T by qz , getting S A ( z ) \= p 2 qz 3 / ( 1 − pz )( 1 − qz )( 1 − pqz 2 ) and S B ( z ) \= pq 2 z 3 / ( 1 − qz )( 1 − pqz 2 ) . The pgf for the conditional probability that Alice wins at the n th flip, given that she wins the game, is

Image

This is a product of pseudo-pgf’s, whose mean is 3 + p/q + q/p + 2pq/ ( 1 − pq ) . The formulas for Bill are the same but without the factor q/ ( 1 − pz ) , so Bill’s mean is 3 + q/p + 2pq/ ( 1 − pq ) . When p = q = Image , the answer in case (a) is Image ; in case (b) it is Image . Bill wins only half as often, but when he does win he tends to win sooner. The overall average number of flips is Image , agreeing with exercise 21 . The solitaire game for each pattern has a waiting time of 8 .

8.29 Set H \= T \= Image in

1 + N ( H + T ) \= N + S A + S B + S C

  N HHTH \= S A ( HTH + 1 ) + S B ( HTH + TH ) + S C ( HTH + TH )

  N HTHH \= S A ( THH + H ) + S B ( THH + 1 ) + S C ( THH )

  N THHH \= S A ( HH ) + S B ( H ) + S C

to get the winning probabilities. In general we will have S A + S B + S C \= 1 and

S A ( A : A ) + S B ( B : A ) + S C ( C : A ) \= S A ( A : B ) + S B ( B : B ) + S C ( C : B )

            \= S A ( A : C ) + S B ( B : C ) + S C ( C : C ) .

In particular, the equations 9S A + 3S B + 3S C \= 5S A + 9S B + S C \= 2S A + 4S B + 8S C imply that Image , Image , Image .

8.30 The variance of P ( h 1 , . . . , h n ; k ) | k is the variance of the shifted binomial distribution (( m − 1 + z ) /m) k − 1 z , which is Image by ( 8.61 ). Hence the average of the variance is Mean ( S )( m − 1 ) /m 2 . The variance of the average is the variance of ( k − 1 ) /m , namely Var ( S ) /m 2 . According to ( 8.106 ), the sum of these two quantities should be VP , and it is. Indeed, we have just replayed the derivation of ( 8.96 ) in slight disguise. (See exercise 15 .)

8.31 (a) A brute force solution would set up five equations in five unknowns:

A \= 1 ;       B \= Image zA + Image zC ;       C \= Image zB + Image zD ;

D \= Image zC + Image zE ;       E \= Image zD + Image zA.

But positions C and D are equidistant from the goal, as are B and E , so we can set C \= D and B \= E in these generating functions for the probabilities. Only two equations now remain to be solved:

B \= Image z + Image zC ;       C \= Image zB + Image zC.

Hence C \= z 2 / ( 4 − 2z − z 2 ) ; we have Mean ( C ) \= 6 and Var ( C ) \= 22 . (Rings a bell? In fact, this problem is equivalent to flipping a fair coin until getting heads twice in a row: Heads means “advance toward the apple” and tails means “start over.”) (b) Chebyshev’s inequality says that Pr ( C ⩾ 100 ) \= Pr( ( C − 6 ) 2 ⩾ 94 2 ) ⩽ 22/94 2 ≈ .0025 . (c) The second tail inequality says that Pr ( C ⩾ 100 ) ⩽ 1/ ( x 98 ( 4 − 2x − x 2 )) for all x ⩾ 1 , and we get the upper bound 0.00000005 when Image . (The actual probability is ∑ n ⩾ 100 F n − 1 /2 n \= F 101 /2 99 ≈ 0.0000000009 , according to exercise 37 .)

8.32 By symmetry, we can reduce each month’s situation to one of four possibilities:

D, the states are diagonally opposite;

A, the states are adjacent and not Kansas;

K, the states are Kansas and one other;

S, the states are the same.

“ Toto, I’ve a feeling we’re not in Kansas anymore.”

— Dorothy

Considering the Markovian transitions, we get four equations

Image

whose sum is D + K + A + S \= 1 + z ( D + A + K ) . The solution is

Image

but the simplest way to find the mean and variance may be to write z \= 1 + w and expand in powers of w , ignoring multiples of w 2 :

Image

Now Image , and Image . The mean is Image and the variance is Image . (Is there a simpler way?)

8.33 First answer: Clearly yes, because the hash values h 1 , . . . , h n are independent. Second answer: Certainly no, even though the hash values h 1 , . . . , h n are independent. We have Pr ( X j \= 0 ) \= Image s k [ j ≠ k ]( m − 1 ) /m \= ( 1 − s j )( m − 1 ) /m , but Pr ( X 1 \= X 2 \= 0 ) \= Image s k [ k > 2 ]( m − 1 ) 2 /m 2 \= ( 1 − s 1 − s 2 )( m − 1 ) 2 /m 2 ≠ Pr ( X 1 \= 0 ) Pr ( X 2 \= 0 ) .

8.34 Let [ z n ] S m ( z ) be the probability that Gina has advanced < m steps after taking n turns. Then S m ( 1 ) is her average score on a par- m hole; [ z m ] S m ( z ) is the probability that she loses such a hole against a steady player; and 1 − [ z m − 1 ] S m ( z ) is the probability that she wins it. We have the recurrence

  S 0 ( z ) \= 0 ;

S m ( z ) \= 1 + pzS m – 2 ( z ) + qzS m – 1 ( z ) / ( 1 − rz ) ,       for m > 0.

To solve part (a), it suffices to compute the coefficients for m , n ⩽ 4 ; it is convenient to replace z by 100w so that the computations involve nothing but integers. We obtain the following tableau of coefficients:

S 0

0

0

0

0

0

S 1

1

4

16

64

256

S 2

1

95

744

4432

23552

S 3

1

100

9065

104044

819808

S 4

1

100

9975

868535

12964304

Therefore Gina wins with probability 1 − .868535 \= .131465 ; she loses with probability .12964304 . (b) To find the mean number of strokes, we compute

Image

(Incidentally, S 5 ( 1 ) ≈ 4.9995 ; she wins with respect to both holes and strokes on a par- 5 hole, but loses either way when par is 3 .)

8.35 The condition will be true for all n if and only if it is true for n \= 1 , by the Chinese remainder theorem. One necessary and sufficient condition is the polynomial identity

( p 2 + p 4 + p 6 + ( p 1 + p 3 + p 5 ) w )( p 3 + p 6 + ( p 1 + p 4 ) z + ( p 2 + p 5 ) z 2 ) \= ( p 1 wz + p 2 z 2 + p 3 w + p 4 z + p 5 wz 2 + p 6 ) ,

but that just more-or-less restates the problem. A simpler characterization is

(p 2 + p 4 + p 6 )(p 3 + p 6 ) = p 6 ,     (p 1 + p 3 + p 5 )(p 2 + p 5 ) = p 5 ,

which checks only two of the coefficients in the former product. The general solution has three degrees of freedom: Let a 0 + a 1 \= b 0 + b 1 + b 2 \= 1 , and put p 1 \= a 1 b 1 , p 2 \= a 0 b 2 , p 3 \= a 1 b 0 , p 4 \= a 0 b 1 , p 5 \= a 1 b 2 , p 6 \= a 0 b 0 .

8.36 (a) Image (b) If the k th die has faces with s 1 , . . . , s 6 spots, let p k ( z ) \= z s 1 + · · · + z s 6 . We want to find such polynomials with p 1 ( z ) . . . p n ( z ) \= ( z + z 2 + z 3 + z 4 + z 5 + z 6 ) n . The irreducible factors of this polynomial with rational coefficients are z n ( z + 1 ) n × ( z 2 + z + 1 ) n ( z 2 − z + 1 ) n ; hence p k ( z ) must be of the form z a k ( z + 1 ) b k × ( z 2 + z + 1 ) c k ( z 2 − z + 1 ) d k . We must have a k ⩾ 1 , since p k ( 0 ) \= 0 ; and in fact a k \= 1 , since a 1 + · · · + a n \= n . Furthermore the condition p k ( 1 ) \= 6 implies that b k \= c k \= 1 . It is now easy to see that 0 ⩽ d k ⩽ 2 , since d k > 2 gives negative coefficients. When d \= 0 and d \= 2 , we get the two dice in part (a); therefore the only solutions have k pairs of dice as in (a), plus n − 2k ordinary dice, for some Image .

8.37 The number of coin-toss sequences of length n is F n − 1 , for all n > 0 , because of the relation between domino tilings and coin flips. Therefore the probability that exactly n tosses are needed is F n − 1 /2 n , when the coin is fair. Also q n \= F n + 1 /2 n − 1 , since ∑ k ⩾ n F k z k \= ( F n z n + F n − 1 z n + 1 ) / ( 1 − z − z 2 ) . (A systematic solution via generating functions is, of course, also possible.)

8.38 When k faces have been seen, the task of rolling a new one is equivalent to flipping coins with success probability p k \= ( m − k ) /m . Hence the pgf is Image . The mean is Image ; the variance is Image ; and equation ( 7.47 ) provides a closed form for the requested probability, namely Image . (The problem discussed in this exercise is traditionally called “ coupon collecting.”)

8.39 E ( X ) \= P (– 1 ) ; V ( X ) \= P (– 2 ) − P (– 1 ) 2 ; E ( ln X ) \= − P ′ ( 0 ) .

8.40 (a) We have Image , by ( 7.49 ). Incidentally, the third cumulant is npq ( q − p ) and the fourth is npq ( 1 − 6pq ) . The identity q + pe t \= ( p + qe − t ) e t shows that f m ( p ) \= (– 1 ) m f m ( q )+[ m \= 1 ] ; hence we can write f m ( p ) \= g m ( pq )( q − p ) [ m odd ] , where g m is a polynomial of degree Image m/2 Image , whenever m > 1 . (b) Let p \= Image and F ( t ) \= ln ( Image + Image e t ) . Then ∑ m ⩾ 1 κ m t m − 1 / ( m − 1 )! \= F ′ ( t ) \= 1 − 1/ ( e t + 1 ) , and we can use exercise 6.23 .

8.41 If G ( z ) is the pgf for a random variable X that assumes only positive integer values, then Image G ( z ) dz/z \= Σ k⩾1 Pk ( X \= k ) /k \= E ( X – 1 ) . If X is the distribution of the number of flips to obtain n + 1 heads, we have G ( z ) \= (pz/ ( 1 − qz )) n + 1 by ( 8.59 ), and the integral is

Image

if we substitute w \= pz/ ( 1 − qz ) . When p \= q the integrand can be written (– 1 ) n ( ( 1 + w ) − 1 − 1 + w − w 2 + · · · +(– 1 ) n w n − 1 ), so the integral is Image . We have Image by ( 9.28 ), and it follows that Image .

8.42 Let F n ( z ) and G n ( z ) be pgf’s for the number of employed evenings, if the man is initially unemployed or employed, respectively. Let q h \= 1 − p h and q f \= 1 − p f . Then F 0 ( z ) \= G 0 ( z ) \= 1 , and

F n ( z ) \= p h zG n − 1 ( z ) + q h F n − 1 ( z ) ;

G n ( z ) \= p f F n − 1 ( z ) + q f zG n − 1 ( z ) .

The solution is given by the super generating function

Image

where B ( w ) \= w ( q f –( q f − p h ) w ) / ( 1 − q h w ) and A ( w ) \= ( 1 − B ( w ) ) / ( 1 − w ) .

Now ∑ n ⩾ 0 Image ( 1 ) w n \= αw / ( 1 − w ) 2 + β / ( 1 − w ) − β/1 − ( q f − p h ) w ) where

Image

hence Image ( 1 ) \= αn + β(1 − ( q f − p h ) n ) . (Similarly Image ( 1 ) \= α 2 n 2 + O ( n ) , so the variance is O ( n ) .)

8.43 G n ( z ) \= ∑ k ⩾ 0 Image z k /n ! \= z Image /n ! , by ( 6.11 ). This is a product of binomial pgf’s, Image , where the k th has mean 1/k and variance ( k − 1 ) /k 2 ; hence Mean ( G n ) \= H n and Var ( G n ) \= H n − Image .

8.44 (a) The champion must be undefeated in n rounds, so the answer is p n . (b,c) Players x 1 , . . . , x 2 k must be “seeded” (by chance) in distinct subtournaments and they must win all 2 k ( n − k ) of their matches. The 2 n leaves of the tournament tree can be filled in 2 n ! ways; to seed it we have 2 k !( 2 n − k ) 2 k ways to place the top 2 k players, and ( 2 n − 2 k )! ways to place the others. Hence the probability is ( 2p ) 2 k ( n − k ) / Image . When k \= 1 this simplifies to ( 2p 2 ) n − 1 / ( 2 n − 1 ) . (d) Each tournament outcome corresponds to a permutation of the players: Let y 1 be the champ; let y 2 be the other finalist; let y 3 and y 4 be the players who lost to y 1 and y 2 in the semifinals; let ( y 5 , . . . , y 8 ) be those who lost respectively to ( y 1 , . . . , y 4 ) in the quarterfinals; etc. (Another proof shows that the first round has 2 n ! /2 n − 1 ! essentially different outcomes; the second round has 2 n − 1 ! /2 n − 2 ! ; and so on.) (e) Let S k be the set of 2 k − 1 potential opponents of x 2 in the k th round. The conditional probability that x 2 wins, given that x 1 belongs to S k , is

Pr ( x 1 plays x 2 ) · p n − 1 ( 1 − p ) + Pr ( x 1 doesn’t play x 2 ) · p n

                    \= p k − 1 p n − 1 ( 1 − p ) + ( 1 − p k − 1 ) p n .

The chance that x 1 Image S k is 2 k − 1 / ( 2 n − 1 ) ; summing on k gives the answer:

Image

(f) Each of the 2 n ! tournament outcomes has a certain probability of occurring, and the probability that x j wins is the sum of these probabilities over all ( 2 n − 1 )! tournament outcomes in which x j is champion. Consider interchanging x j with x j + 1 in all those outcomes; this change doesn’t affect the probability if x j and x j + 1 never meet, but it multiplies the probability by ( 1 − p ) /p < 1 if they do meet.

8.45 (a) A ( z ) \= 1 / ( 3 − 2z ) ; B ( z ) \= zA ( z ) 2 ; C ( z ) \= z 2 A ( z ) 3 . The pgf for sherry when it’s bottled is z 3 A ( z ) 3 , which is z 3 times a negative binomial distribution with parameters n \= 3 , p \= Image . (b) Mean ( A ) \= 2 , Var ( A ) \= 6 ; Mean ( B ) \= 5 , Var ( B ) \= 2 Var ( A ) \= 12 ; Mean ( C ) \= 8 , Var ( C ) \= 18 . The sherry is nine years old, on the average. The fraction that’s 25 years old is Image . (c) Let the coefficient of w n be the pgf for the beginning of year n . Then

Image

Differentiate with respect to z and set z \= 1 ; this makes

Image

The average age of bottled sherry n years after the process started is 1 greater than the coefficient of w n − 1 , namely 9 –( Image ) n ( 3n 2 + 21n + 72 ) /8 . (This already exceeds 8 when n \= 11 .)

8.46 (a) P ( w , z ) \= 1 + Image ( wP ( w , z ) + zP ( w , z ) ) \= ( 1 − Image ( w + z ) ) – 1 , hence p m,n \= 2 – m – n Image . (b) P k ( w , z ) \= Image ( w k + z k ) P ( w , z ) ; hence

Image

(c) Image ; this can be summed using ( 5.20 ):

Image

(The methods of Chapter 9 show that this is Image – 1 + O ( n –1/2 ).

8.47 After n irradiations there are n + 2 equally likely receptors. Let the random variable X n denote the number of diphages present; then X n + 1 \= X n + Y n , where Y n \= − 1 if the ( n + 1 ) st particle hits a diphage receptor (conditional probability 2X n / ( n + 2 ) ) and Y n \= + 2 otherwise. Hence

EX n + 1 \= EX n + EY n \= EX n − 2EX n / ( n + 2 ) + 2 ( 1 − 2EX n / ( n + 2 ) ) .

The recurrence ( n + 2 ) EX n + 1 \= ( n − 4 ) EX n + 2n + 4 can be solved if we multiply both sides by the summation factor ( n + 1 ) 5 ; or we can guess the answer and prove it by induction: EX n \= ( 2n + 4 ) /7 for all n > 4 . (Incidentally, there are always two diphages and one triphage after five steps, regardless of the configuration after four.)

8.48 (a) The distance between frisbees (measured so as to make it an even number) is either 0 , 2 , or 4 units, initially 4 . The corresponding generating functions A , B , C (where, say, [ z n ] C is the probability of distance 4 after n throws) satisfy

A \= Image zB ,       B \= Image zB + Image zC ,       C \= 1 + Image zB + Image zC.

It follows that A \= z 2 / ( 16 − 20z + 5z 2 ) \= z 2 /F ( z ) , and we have Mean ( A ) \= 2 − Mean ( F ) \= 12 , Var ( A ) \= − Var ( F ) \= 100 . (A more difficult but more amusing solution factors A as follows:

Image

where Image , and p 1 + q 1 \= p 2 + q 2 \= 1 . Thus, the game is equivalent to having two biased coins whose heads probabilities are p 1 and p 2 ; flip the coins one at a time until they have both come up heads, and the total number of flips will have the same distribution as the number of frisbee throws. The mean and variance of the waiting times for these two coins are respectively Image and Image , hence the total mean and variance are 12 and 100 as before.)

(b) Expanding the generating function in partial fractions makes it possible to sum the probabilities. (Note that Image / ( 4ϕ ) + ϕ 2 /4 \= 1 , so the answer can be stated in terms of powers of φ .) The game will last more than n steps with probability 5 ( n − 1 ) /2 4 − n ( φ n + 2 − φ − n − 2 ) ; when n is even this is 5 n/2 4 − n F n + 2 . So the answer is 5 50 4 − 100 F 102 ≈ .00006 .

8.49 (a) If n > 0 , P N ( 0 , n ) \= Image [ N \= 0 ] + Image P N – 1 ( 0 , n ) + Image P N – 1 ( 1, n − 1 ) ; P N ( m , 0 ) is similar; P N ( 0 , 0 ) \= [ N \= 0 ] . Hence

g m,n \= Image zg m – 1,n + 1 + Image zg m,n + Image zg m + 1,n – 1 ;

  g 0,n = Image + Image zg 0,n + Image g 1,n – 1 ;       etc .

(b) Image ; Image ; etc. By induction on m , we have Image for all m , n ⩾ 0 . And since Image , we must have Image . (c) The recurrence is satisfied when mn > 0 , because

Image

this is a consequence of the identity sin ( x − y ) + sin ( x + y ) \= 2 sin x cos y . So all that remains is to check the boundary conditions.

8.50 (a) Using the hint, we get

Image

now look at the coefficient of z 3 + l . (b) Image . (c) Let Image . One can show that ( z − 3 + r )( z − 3 − r ) \= 4z , and hence that ( r / ( 1 − z ) + 2 ) 2 \= ( 13 − 5z + 4r ) / ( 1 − z ) \= (9 − H ( z ) )/( 1 − H ( z ) ).

(d) Evaluating the first derivative at z \= 1 shows that Mean ( H ) \= 1 . The second derivative diverges at z \= 1 , so the variance is infinite.

8.51 (a) Let H n ( z ) be the pgf for your holdings after n rounds of play, with H 0 ( z ) \= z . The distribution for n rounds is

H n + 1 ( z ) \= H n ( H ( z ) ) ,

so the result is true by induction (using the amazing identity of the preceding problem). (b) g n \= H n ( 0 ) − H n – 1 ( 0 ) \= 4/n ( n + 1 )( n + 2 ) \= 4 ( n − 1 ) − 3 . The mean is 2 , and the variance is infinite. (c) The expected number of tickets you buy on the n th round is Mean ( H n ) \= 1 , by exercise 15 . So the total expected number of tickets is infinite. (Thus, you almost surely lose eventually, and you expect to lose after the second game, yet you also expect to buy an infinite number of tickets.) (d) Now the pgf after n games is H n ( z ) 2 , and the method of part (b) yields a mean of 16 − Image π 2 ≈ 2.8 . (The sum ∑ k ⩾ 1 1/k 2 \= π 2 /6 shows up here.)

8.52 If ω and ω ′ are events with Pr ( ω ) > Pr ( ω ′ ) , then a sequence of n independent experiments will encounter ω more often than ω ′, with high probability, because ω will occur very nearly n Pr ( ω ) times. Consequently, as n → ∞ , the probability approaches 1 that the median or mode of the values of X in a sequence of independent trials will be a median or mode of the random variable X .

8.53 We can disprove the statement, even in the special case that each variable is 0 or 1 . Let p 0 \= Pr ( X \= Y \= Z \= 0 ) , Image  , Image , where Image . Then p 0 + p 1 + · · · + p 7 \= 1 , and the variables are independent in pairs if and only if we have

( p 4 + p 5 + p 6 + p 7 )( p 2 + p 3 + p 6 + p 7 ) \= p 6 + p 7 ,

( p 4 + p 5 + p 6 + p 7 )( p 1 + p 3 + p 5 + p 7 ) \= p 5 + p 7 ,

( p 2 + p 3 + p 6 + p 7 )( p 1 + p 3 + p 5 + p 7 ) \= p 3 + p 7 .

But Pr ( X + Y \= Z \= 0 ) ≠ Pr ( X + Y \= 0 ) Pr ( Z \= 0 )     Image     p 0 ≠ ( p 0 + p 1 )( p 0 + p 2 + p 4 + p 6 ) . One solution is

p 0 \= p 3 \= p 5 \= p 6 \= 1/4 ;       p 1 \= p 2 \= p 4 \= p 7 \= 0 .

This is equivalent to flipping two fair coins and letting X \= ( the first coin is heads), Y \= ( the second coin is heads), Z \= ( the coins differ). Another example, with all probabilities nonzero, is

p 0 \= 4/64 , p 1 \= p 2 \= p 4 \= 5/64 ,

p 3 \= p 5 \= p 6 \= 10/64 , p 7 \= 15/64 .

For this reason we say that n variables X 1 , . . . , X n are independent if

Pr ( X 1 \= x 1 and · · · and X n \= x n ) \= Pr ( X 1 \= x 1 ) . . . Pr ( X n \= x n ) ;

pairwise independence isn’t enough to guarantee this.

8.54 (See exercise 27 for notation.) We have

          E ( Σ Image ) \= nμ 4 + n ( n − 1 ) μ Image ;

      E ( Σ 2 Σ Image ) \= nμ 4 + 2n ( n − 1 ) μ 3 μ 1 + n ( n − 1 ) μ Image + n ( n − 1 )( n − 2 ) μ 2 μ Image ;

          E ( Σ Image ) \= nμ 4 + 4n ( n − 1 ) μ 3 μ 1 + 3n ( n − 1 ) μ Image

                            + 6n ( n − 1 )( n − 2 ) μ 2 μ Image + n ( n − 1 )( n − 2 )( n − 3 ) μ Image ;

it follows that V ( Image X ) \= κ 4 /n + 2κ Image / ( n − 1 ) .

8.55 There are Image permutations with X \= Y , and Image permutations with X ≠ Y . After the stated procedure, each permutation with X \= Y occurs with probability Image , because we return to step S1 with probability Image . Similarly, each permutation with X ≠ Y occurs with probability Image . Choosing p \= Image makes Pr ( X \= x and Y \= y ) \= Image for all x and y . (We could therefore make two flips of a fair coin and go back to S1 if both come up heads.)

8.56 If m is even, the frisbees always stay an odd distance apart and the game lasts forever. If m \= 2l + 1 , the relevant generating functions are

G m

=

Image zA 1 ;

A 1

=

Image zA 1 + Image zA 2 ,

A k

=

Image zA k – 1 + Image zA k + Image zA k + 1 ,

     for 1 < k < l,

A l

=

Image zA l – 1 + 3 4 zA l + 1.

(The coefficient [ z n ] A k is the probability that the distance between frisbees is 2k after n throws.) Taking a clue from the similar equations in exercise 49 , we set z \= 1 /cos 2 θ and A 1 \= X sin 2θ , where X is to be determined. It follows by induction (not using the equation for A l ) that A k \= X sin 2kθ . Therefore we want to choose X such that

Image

It turns out that X \= 2 cos 2 θ /sin θ cos ( 2l + 1 ) θ , hence

Image

The denominator vanishes when θ is an odd multiple of π / ( 2m ) ; thus 1 − q k z is a root of the denominator for 1 ⩽ k ⩽ l , and the stated product representation must hold. To find the mean and variance we can write

Trigonometry wins again. Is there a connection with pitching pennies along the angles of the m -gon?

Image

because tan 2 θ \= z − 1 and tan θ \= θ + Image θ 3 + · · ·. So we have Mean ( G m ) \= Image ( m 2 − 1 ) and Var ( G m ) \= Image m 2 ( m 2 − 1 ) . (Note that this implies the identities

Image

The third cumulant of this distribution is Image m 2 (m 2 –1) (4m 2 – 1); but the pattern of nice cumulant factorizations stops there. There’s a much simpler way to derive the mean: We have G m + A 1 + · · · + A l \= z ( A 1 + · · · + A l ) + 1 , hence when z \= 1 we have Image . Since G m \= 1 when z \= 1 , an easy induction shows that A k \= 4k .)

8.57 We have A : A ⩾ 2 l–1 and B : B < 2 l–1 + 2 l–3 and B : A ⩾ 2 l–2 , hence B : B − B : A ⩾ A : A − A : B is possible only if A : B > 2 l–3 . This means that Image , τ 1 \= τ 4 , τ 2 \= τ 5 , . . . , τ l – 3 \= τ l . But then A : A ≈ 2 l–1 + 2 l–4 + · · ·, A : B ≈ 2 l–3 + 2 l–6 + · · ·, B : A ≈ 2 l–2 + 2 l–5 + · · ·, and B : B ≈ 2 l–1 + 2 l–4 + · · ·; hence B : B − B : A is less than A : A − A : B after all. (Sharper results have been obtained by Guibas and Odlyzko [ 168 ], who show that Bill’s chances are always maximized with one of the two patterns H τ 1 . . . τ l – 1 or T τ 1 . . . τ l – 1 . Bill’s winning strategy is, in fact, unique; see the following exercise.)

8.58 (Solution by J. Csirik.) If A is H l or T l , one of the two sequences matches A and cannot be used. Otherwise let  \= τ 1 . . . τ l – 1 , H \= H  , and T \= T  . It is not difficult to verify that H : A \= T : A \=  :  , H : H + T : T \= 2 l–1 + 2 (  :  ) + 1 , and A : H + A : T \= 1 + 2 ( A : A ) − 2 l . Therefore the equation

Image

implies that both fractions equal

Image

Then we can rearrange the original fractions to show that

Image

where pq > 0 and p + q \= gcd ( 2 l–1 + 1 , 2 l − 1 ) \= gcd ( 3 , 2 l − 1 ) ; so we may assume that l is even and that p \= 1 , q \= 2 . It follows that A : A − A : H \= ( 2 l − 1 ) /3 and A : A − A : T \= ( 2 l+1 − 2 ) /3 , hence A : H − A : T \= ( 2 l − 1 ) /3 ⩾ 2 l–2 . We have A : H ⩾ 2 l–2 if and only if A \= ( TH ) l/2 . But then H : H − H : A \= A : A − A : H , so 2 l–1 + 1 \= 2 l − 1 and l \= 2 .

(Csirik [ 69 ] goes on to show that, when l ⩾ 4 , Alice can do no better than to play HT l–3 H 2 . But even with this strategy, Bill wins with probability nearly Image .)

8.59 According to ( 8.82 ), we want B : B − B : A > A : A − A : B . One solution is A \= TTHH , B \= HHH .

8.60 (a) Two cases arise depending on whether h k ≠ h n or h k \= h n :

Image

(b) We can either argue algebraically, taking partial derivatives of G ( w , z ) with respect to w and z and setting w \= z \= 1 ; or we can argue combinatorially: Whatever the values of h 1 , . . . , h n – 1 , the expected value of P ( h 1 , . . . , h n – 1 , h n ; n ) is the same (averaged over h n ), because the hash sequence ( h 1 , . . . , h n – 1 ) determines a sequence of list sizes ( n 1 , n 2 , . . . , n m ) such that the stated expected value is ( ( n 1 + 1 )+( n 2 + 1 )+ · · · +( n m + 1 ) /m ( n − 1 + m ) /m . Therefore the random variable EP ( h 1 , . . . , h n ; n ) is independent of ( h 1 , . . . , h n – 1 ) , hence independent of P ( h 1 , . . . , h n ; k ) .

8.61 If 1 ⩽ k < l ⩽ n , the previous exercise shows that the coefficient of s k s l in the variance of the average is zero. Therefore we need only consider the coefficient of Image , which is

Image

the variance of (( m − 1 + z ) /m ) k − 1 z ; and this is ( k − 1 )( m − 1 ) /m 2 as in exercise 30 .

8.62 The pgf D n ( z ) satisfies the recurrence

Image

We can now derive the recurrence

Image

which has the solution Image (n+2) (26n + 15) for all n ⩾ 11 (regardless of initial conditions). Hence the variance comes to Image (n + 2) for n ⩾ 11 .

8.63 (Another question asks if a given sequence of purported cumulants comes from any distribution whatever; for example, κ 2 must be nonnegative, and Image must be at least Image , etc. A necessary and sufficient condition for this other problem was found by Hamburger [ 6 ], [ 175 ].)

9.1 True if the functions are all positive. But otherwise we might have, say, f 1 ( n ) \= n 3 + n 2 , f 2 ( n ) \= − n 3 , g 1 ( n ) \= n 4 + n , g 2 ( n ) \= − n 4 .

9.2 (a) We have n lnn ≺ c n ≺ ( ln n ) n , since ( ln n ) 2 ≺ n ln c ≺ n ln ln n .

(b) n lnlnlnn ≺ ( ln n )! ≺ n lnlnn . (c) Take logarithms to show that ( n !)! wins. (d) Image ; H F n ∼ n ln φ wins because φ 2 \= φ + 1 < e .

9.3 Replacing kn by O ( n ) requires a different C for each k ; but each O stands for a single C . In fact, the context of this O requires it to stand for a set of functions of two variables k and n . It would be correct to write Image .

9.4 For example, lim n→∞ O ( 1/n ) \= 0 . On the left, O ( 1/n ) is the set of all functions f ( n ) such that there are constants C and n 0 with | f ( n ) | ⩽ C/n for all n ⩾ n 0 . The limit of all functions in that set is 0 , so the left-hand side is the singleton set { 0 } . On the right, there are no variables; 0 represents { 0 } , the (singleton) set of all “functions of no variables, whose value is zero.” (Can you see the inherent logic here? If not, come back to it next year; you probably can still manipulate O -notation even if you can’t shape your intuitions into rigorous formalisms.)

9.5 Let f ( n ) \= n 2 and g ( n ) \= 1 ; then n is in the left set but not in the right, so the statement is false.

9.6 nln + γn + O ( Image lnn ) .

9.7 ( 1 − e − 1/n ) − 1 \= nB 0 − B 1 + B 2 n − 1 /2 ! + · · · \= n + Image + O ( n − 1 ) .

9.8 For example, let f ( n ) \= Image n/2 Image ! 2 + n , g ( n ) \= ( Image n/2 Image − 1 ) ! Image n/2 Image ! + n . These functions, incidentally, satisfy f ( n ) \= O (ng ( n )) and g ( n ) \= O ) nf ( n )) ; more extreme examples are clearly possible.

9.9 (For completeness, we assume that there is a side condition n → ∞ , so that two constants are implied by each O .) Every function on the left has the form a ( n ) + b ( n ) , where there exist constants m 0 , B , n 0 , C such that | a ( n ) | ⩽ B | f ( n ) |for n ⩾ m 0 and | b ( n ) | ⩽ C | g ( n ) |for n ⩾ n 0 . Therefore the left-hand function is at most max ( B , C ) (| f ( n ) | + | g ( n ) |), for n ⩾ max ( m 0 , n 0 ) , so it is a member of the right side.

9.10 If g ( x ) belongs to the left, so that g ( x ) \= cos y for some y , where | y | ⩽ C | x | for some C , then 0 ⩽ 1 − g ( x ) \= 2 sin 2 ( y/2 ) ⩽ Image y 2 ⩽ Image C 2 x 2 ; hence the set on the left is contained in the set on the right, and the formula is true.

9.11 The proposition is true. For if, say, | x | ⩽ | y | , we have ( x + y ) 2 ⩽ 4y 2 . Thus ( x + y ) 2 \= O ( x 2 ) + O ( y 2 ) . Thus O ( x + y ) 2 \= O (( x + y ) 2 ) \= O ( O ( x 2 ) + O ( y 2 )) \= O ( O ( x 2 )) + O ( O ( y 2 )) \= O ( x 2 ) + O ( y 2 ) .

9.12 1 + 2/n + O ( n − 2 ) \= ( 1 + 2/n ) ( 1 + O ( n − 2 ) / ( 1 + 2/n )) by ( 9.26 ), and 1 / ( 1 + 2/n ) \= O ( 1 ) ; now use ( 9.26 ).

9.13 n n ( 1 + 2n − 1 + O ( n − 2 )) n \= n n exp (n(2n − 1 + O ( n − 2 ))) \= e 2 n n + O(n n–1 ) .

9.14 It is n n + β exp (( n + β ) ( α/n − Image α 2 /n 2 + O ( n − 3 ))) .

(It’s interesting to compare this formula with the corresponding result for the middle binomial coefficient, exercise 9.60 .)

9.15 Image , so the answer is

Image

9.16 If l is any integer in the range a ⩽ l < b we have

Image

Since l + x ⩾ l + 1 − x when Image , this integral is positive when f ( x ) is nondecreasing.

9.17 Image

9.18 The text’s derivation for the case α \= 1 generalizes to give

Image

the answer is 2 2nα ( πn ) ( 1 − α ) /2 α − 1/2 ( 1 + O ( n −1/2 + 3 Image )) .

9.19 H 10 \= 2.928968254 ≈ 2.928968258 ; 10 ! \= 3628800 ≈ 3628800.05 ; B 10 \= 0.0757575 ≈ 0.07575749 ; π ( 10 ) \= 4 ≈ 10.002 ; e 0.1 \= 1.1051709 ≈ 1.1051708 ; ln 1.1 \= 0.095310 ≈ 0.095308 ; 1.1111111 . . . ≈ 1.1111 ; 1.1 0.1 \= 1.0095765 ≈ 1.0095764 . (The approximation to π ( n ) gives more significant figures when n is larger; for example, π ( 10 9 ) \= 50847534 ≈ 50840742 .)

9.20 (a) Yes; the left side is o ( n ) while the right side is equivalent to O ( n ) . (b) Yes; the left side is e · e O ( 1/n ) . (c) No; the left side is about Image times the bound on the right.

9.21 We have P n \= p \= n (ln p − 1 − 1 /ln p + O ( 1 /log n ) 2 ), where

Image

It follows that

Image

(A slightly better approximation replaces this O ( 1 /log n ) 2 by the quantity − 5.5 / ( ln n ) 2 + O ( log log n /log n ) 3 ; then we estimate P 1000000 ≈ 15480992.8 .)

What does a drowning analytic number theorist say?

log log log log . . .

9.22 Replace O(n –2k ) by − Image n − 2k + O ( n − 4k ) in the expansion of H n k ; this replaces O(∑ 3 (n 2 )) by Image in ( 9.53 ). We have

Image

hence the term O ( n − 2 ) in ( 9.54 ) can be replaced by − Image n − 2 + O ( n − 3 ) .

9.23 nh n \= ∑ 0⩽k<n h k / ( n − k )+ 2cH n / ( n + 1 )( n + 2 ) . Choose c \= e π 2 /6 \= ∑ k ⩾ 0 g k so that ∑ k ⩾ 0 h k \= 0 and h n \= O ( log n ) /n 3 . The expansion of ∑ 0⩽k<n h k / ( n − k ) as in ( 9.60 ) now yields nh n \= 2cH n / ( n + 1 )( n + 2 ) + O ( n − 2 ) , hence

Image

9.24 (a) If ∑ k⩾0 | f ( k )| < ∞ and if f( n − k ) = O( f(n)) when 0 ⩽ k ⩽ n/2 , we have

Image

which is 2O(f(n) ∑ k ⩾ 0 | f ( k ) |), so this case is proved. (b) But in this case if a n \= b n \= α − n , the convolution ( n + 1 ) α − n is not O ( α − n ) .

9.25 Image . We may restrict the range of summation to 0 ⩽ k ⩽ ( log n ) 2 , say. In this range Image and Image , so the summand is

Image

Hence the sum over k is 2 − 4/n + O ( 1/n 2 ) . Stirling’s approximation can now be applied to Image , proving ( 9.2 ).

9.26 The minimum occurs at a term B 2m / ( 2m )( 2m − 1 ) n 2m − 1 where 2m ≈ 2πn + Image , and this term is approximately equal to Image . The absolute error in ln n ! is therefore too large to determine n ! exactly by rounding to an integer, when n is greater than about e 2π + 1 .

9.27 We may assume that α ≠ − 1 . Let f ( x ) \= x α ; the answer is

Image

(The constant C α turns out to be ζ (– α ) , which is in fact defined by this formula when α > − 1 .)

In particular, ζ ( 0 ) \= − 1/2 , and ζ (– n ) \= − B n + 1 / ( n + 1 ) for integer n > 0 .

9.28 In general, suppose f ( x ) \= x α ln x in Euler’s summation formula, when α ≠ − 1 . Proceeding as in the previous exercise, we find

Image

the constant Image can be shown [ 74 , §3.7] to be − ζ ′ (– α ) . (The log n factor in the O term can be removed when α is a positive integer ⩽ 2m ; in that case we also replace the k th term of the right sum by B 2k α ! ( 2k − 2 − α )! × (– 1 ) α n α–2k+1 / ( 2k )! when α < 2k − 1 .) To solve the stated problem, we let α \= 1 and m \= 1 , taking the exponential of both sides to get

Q n \= A · n n 2 /2+n/2+1/12 e − n 2 /4 ( 1 + O ( n − 2 )) ,

where A \= e 1/12 − ζ ′ (– 1 ) ≈ 1.2824271291 is “Glaisher’s constant.”

9.29 Let f ( x ) \= x − 1 ln x . A slight modification of the calculation in the previous exercise gives

Image

where γ 1 ≈ − 0.07281584548367672486 is a “Stieltjes constant” (see the answer to 9.57 ). Taking exponentials gives

Image

9.30 Let g ( x ) \= x l e –x 2 and Image . Then n − l/2 ∑ k ⩾ 0 k l e − k 2 /n is

Image

Since g ( x ) \= x l − x 2 + l /1 ! + x 4 + l /2 ! − x 6 + l /3 ! + · · · , the derivatives g (m) ( x ) obey a simple pattern, and the answer is

Image

9.31 The somewhat surprising identity 1 / ( c m–k + c m ) + 1 / ( c m+k + c m ) \= 1/c m makes the terms for 0 ⩽ k ⩽ 2m sum to Image . The remaining terms are

Image

and this series can be truncated at any desired point, with an error not exceeding the first omitted term.

9.32 Image by Euler’s summation formula, since we know the constant; and H n is given by ( 9.89 ). So the answer is

The world’s top three constants, ( e , π , γ ) , all appear in this answer.

ne γ+π 2 / 6 (1 – Image n –1 + O(n –2 )).

9.33 We have Image ; dividing by k ! and summing over k ⩾ 0 yields e − en − 1 + Image en − 2 + O ( n − 3 ) .

9.34 Image .

9.35 Since 1/k (ln k + O ( 1 )) \= 1/k ln k + O ( 1/k ( log k ) 2 ), the given sum is Image . The remaining sum is ln ln n + O ( 1 ) by Euler’s summation formula.

9.36 This works out beautifully with Euler’s summation formula:

Image

where we have R 2 = R 3 and R 3 = O ( n 3−8 ) .

Hence Image .

9.37 This is

Image

Image

The remaining sum is like ( 9.55 ) but without the factor μ ( q ) . The same method works here as it did there, but we get ζ ( 2 ) in place of 1/ζ ( 2 ) , so the answer comes to Image .

9.38 Replace k by n − k and let Image . Then ln a k ( n ) \= n ln n − ln k ! − k + O ( kn − 1 ) , and we can use tail-exchange with b k ( n ) \= n n e –k /k ! , c k ( n ) \= kb k ( n ) /n , D n \= { k | k ⩽ ln n } , to get Image .

9.39 Tail-exchange with Image , c k ( n ) \= n − 3 ( ln n ) k + 3 /k ! , D n \= { k | 0 ⩽ k ⩽ 10 ln n } . When k ≈ 10 ln n we have Image , so the k th term is O ( n − 10 ln ( 10/e ) log n ) . The answer is Image .

9.40 Combining terms two by two, we find that Image plus terms whose sum over all k ⩾ 1 is O ( 1 ) . Suppose n is even. Euler’s summation formula implies that

Image

hence the sum is Image . In general the answer is Image .

9.41 Let Image . We have

Image

The latter sum is ∑ k>n O ( α k ) \= O ( α n ) . Hence the answer is

φ n ( n + 1 ) /2 5 − n/2 C + O ( φ n ( n − 3 ) /2 5 − n/2 ) ,

where C \= ( 1 − α )( 1 − α 2 )( 1 − α 3 ) . . . ≈ 1.226742 .

9.42 The hint follows since Image . Let m \= Image αn Image \= αn − Image . Then

Image

So Image , and it remains to estimate Image . By Stirling’s approximation we have Image = \= − 1 2 ln n –( αn − Image ) ln ( α − Image /n )– – ( 1 − α ) n + Image – × ln ( 1 − α + Image /n ) + O ( 1 ) \= − 1 2 ln n − αn ln α − ( 1 − α ) n ln ( 1 − α ) + O ( 1 ) .

9.43 The denominator has factors of the form z − ω , where ω is a complex root of unity. Only the factor z − 1 occurs with multiplicity 5 . Therefore by ( 7.31 ), only one of the roots has a coefficient Ω ( n 4 ) , and the coefficient is c \= 5 / ( 5 ! · 1 · 5 · 10 · 25 · 50 ) \= 1/1500000 .

9.44 Stirling’s approximation says that ln( x –α x ! / ( x − α )!) has an asymptotic series

Image

in which each coefficient of x –k is a polynomial in α . Hence x –α x ! / ( x − α )! \= c 0 ( α ) + c 1 ( α ) x − 1 + · · · + c n ( α ) x − n + O ( x –n–1 ) as x → ∞ , where c n ( α ) is a polynomial in α . We know that Image whenever α is an integer, and Image is a polynomial in α of degree 2n ; hence Image for all real α . In other words, the asymptotic formulas

(See [ 220 ] for further discussion.)

Image

generalize equations ( 6.13 ) and ( 6.11 ), which hold in the all-integer case.

9.45 Let the partial quotients of α be Image a 1 , a 2 , . . . Image , and let α m be the continued fraction 1 / ( a m + α m + 1 ) for m ⩾ 1 . Then D ( α , n ) \= D ( α 1 , n ) < D(α 2 , Image α 1 n Image ) + a 1 + 3 < D ( α 3 , Image α 2 Image α 1 n Image Image ) + a 1 + a 2 + 6 < · · · < D ( α m + 1 , Image α m Image . . . Image α 1 n Image . . . Image Image ) + a 1 + · · · + a m + 3m < α 1 . . . α m n + a 1 + · · · + a m + 3m , for all m . Divide by n and let n → ∞; the limit points are bounded above by α 1 . . . α m for all m . Finally we have

Image

9.46 For convenience we write just m instead of m ( n ) . By Stirling’s approximation, the maximum value of k n /k ! occurs when k ≈ m ≈ n /ln n , so we replace k by m + k and find that

Image

Actually we want to replace k by Image m Image + k ; this adds a further O ( km − 1 log n ) . The tail-exchange method with | k | ⩽ m 1/2+ Image now allows us to sum on k , giving a fairly sharp asymptotic estimate in terms of the quantity Θ in ( 9.93 ):

A truly Bell-shaped summand.

Image

The requested formula follows, with relative error O ( log log n /log n ) .

9.47 Let log m n \= l + θ , where 0 ⩽ θ < 1 . The floor sum is l ( n + 1 ) + 1 − ( m l + 1 − 1 ) / ( m − 1 ) ; the ceiling sum is ( l + 1 ) n − ( m l+1 − 1 ) / ( m − 1 ) ; the exact sum is ( l + θ ) n − n /ln m + O ( log n ) . Ignoring terms that are o ( n ) , the difference between ceiling and exact is ( 1 − f ( θ ) ) n , and the difference between exact and floor is f ( θ ) n , where

Image

This function has maximum value f ( 0 ) \= f ( 1 ) \= m / ( m − 1 ) − 1 /ln m , and its minimum value is ln ln m /ln m + 1 − (ln ( m − 1 )) /ln m . The ceiling value is closer when n is nearly a power of m , but the floor value is closer when θ lies somewhere between 0 and 1 .

9.48 Let d k \= a k + b k , where a k counts digits to the left of the decimal point. Then a k \= 1 + Image log H k Image \= log log k + O ( 1 ) , where ‘log’ denotes log 10 . To estimate b k , let us look at the number of decimal places necessary to distinguish y from nearby numbers y − Image and y + Image ′: Let δ \= 10 –b be the length of the interval of numbers that round to ŷ . We have Image ; also Image and Image . Therefore Image + Image ′ > δ . And if δ < min ( Image , Image ′ ) , the rounding does distinguish ŷ from both y − Image and y + Image ′. Hence 10 –b k < 1/ ( k − 1 ) + 1/k and 10 1–b k ⩾ 1/k ; we have b k \= log k + O ( 1 ) . Finally, therefore, Image , which is n log n + n log log n + O ( n ) by Euler’s summation formula.

9.49 We have Image , where f ( x ) is increasing for all x > 0 ; hence if n ⩾ e α–γ we have H n ⩾ f ( e α–γ ) > α . Also Image , where g ( x ) is increasing for all x > 0 ; hence if n ⩽ e α–γ we have H n –1 ⩽ g ( e α–γ ) < α . Therefore H n – 1 ⩽ α ⩽ H n implies that e α–γ + 1 > n > e α+γ − 1 . (Sharper results have been obtained by Boas and Wrench [ 33 ].)

9.50 (a) The expected return is Image , and we want the asymptotic value to O ( N − 1 ) :

Image

The coefficient ( 6 ln 10 ) /π 2 ≈ 1.3998 says that we expect about 40% profit.

(b) The probability of profit is Image , and since Image this is

Image

actually decreasing with n . (The expected value in (a) is high because it includes payoffs so huge that the entire world’s economy would be affected if they ever had to be made.)

9.51 Strictly speaking, this is false, since the function represented by O ( x − 2 ) might not be integrable. (It might be ‘ [ x Image S ] /x 2 ’, where S is not a measurable set.) But if we stipulate that f ( x ) is an integrable function such that f ( x ) \= O ( x − 2 ) as x → ∞ , then Image .

(As opposed to an execrable function.)

9.52 In fact, the stack of n ’s can be replaced by any function f ( n ) that approaches infinity, however fast. Define the sequence Image m 0 , m 1 , m 2 , . . . Image by setting m 0 \= 0 and letting m k be the least integer > m k – 1 such that

Image

Now let A ( z ) \= ∑ k⩾1 ( z/k ) m k . This power series converges for all z , because the terms for k > | z | are bounded by a geometric series. Also A ( n + 1 ) ⩾ (( n + 1 ) /n ) m n ⩾ f ( n + 1 ) 2 , hence lim n→∞ f ( n ) /A ( n ) \= 0 .

9.53 By induction, the O term is Image . Since f (m+1) has the opposite sign to f (m) , the absolute value of this integral is bounded by Image ; so the error is bounded by the absolute value of the first discarded term.

9.54 Let g ( x ) \= f ( x ) /x α . Then g ′ ( x ) ∼ − αg ( x ) /x as x → ∞ . By the mean value theorem, Image for some y between Image and Image . Now g ( y ) \= g ( x ) 1 + O ( 1/x ) , so Image . Therefore

Image

Sounds like a nasty theorem.

9.55 The estimate of (n + k + Image ) ln (1 + k/n) + (n – k + Image ) ln (1 – k/n) is extended to k 2 /n + k 4 /6n 3 + O ( n − 3/2 + 5 Image ) , so we apparently want to have an extra factor e − k 4 /6n 3 in b k ( n ) , and c k ( n ) \= 2 2n n − 2+5 Image e − k 2 /n . But it turns out to be better to leave b k ( n ) untouched and to let

c k ( n ) \= 2 2n n − 2 + 5 Image e − k 2 /n + 2 2n n − 5 + 5 Image k 4 e − k 2 /n ,

thereby replacing e − k 4 /6n 3 by 1 + O ( k 4 /n 3 ) . The sum Σ k k 4 e –k 2 / n is O ( n 5/2 ) , as shown in exercise 30 .

9.56 If k ⩽ n 1/2 + Image we have Image by Stirling’s approximation, hence

n k /n k \= e – k 2 /2n ( 1 + k/2n − Image k 3 / ( 2n ) 2 + O ( n – 1 + 4 Image )).

Summing with the identity in exercise 30 , and remembering to omit the term for k \= 0 , gives Image .

9.57 Using the hint, the given sum becomes Image . The zeta function can be defined by the series

Image

where γ 0 \= γ and γ m is the Stieltjes constant [ 341 , 201 ]

Image

Hence the given sum is

ln n + γ − 2γ 1 ( ln n ) − 1 + 3γ 2 ( ln n ) − 2 − · · · .

9.58 Let 0 ⩽ θ ⩽ 1 and f ( z ) \= e 2πizθ / ( e 2πiz − 1 ) . We have

Image

Therefore | f ( z ) | is bounded on the contour, and the integral is O ( M 1 − m ) . The residue of 2πif ( z ) /z m at z \= k ≠ 0 is e 2πikθ /k m ; the residue at z \= 0 is the coefficient of z − 1 in

Image

namely ( 2πi ) m B m ( θ ) /m ! . Therefore the sum of residues inside the contour is

Image

This equals the contour integral O ( M 1 − m ) , so it approaches zero as M → ∞ .

9.59 If F ( x ) is sufficiently well behaved, we have the general identity

Image

where Image . (This is “Poisson’s summation formula,” which can be found in standard texts such as Henrici [ 182 , Theorem 10.6e].)

9.60 The stated formula is equivalent to

Image

by exercise 5.22 . Hence the result follows from exercises 6.64 and 9.44 .

9.61 The idea is to make α “almost” rational. Let a k \= 2 2 2 k be the k th partial quotient of α , and let Image , where q m \= K ( a 1 , . . . , a m ) and m is even. Then 0 < { q m α } < 1/K ( a 1 , . . . , a m + 1 ) < 1 / ( 2n ) , and if we take v \= a m + 1 / ( 4n ) we get a discrepancy Image . If this were less than n 1 − Image we would have Image ; but in fact Image .

9.62 See Canfield [ 48 ]; see also David and Barton [ 71 , Chapter 16] for asymptotics of Stirling numbers of both kinds.

9.63 Let c \= φ 2 − φ . The estimate cn φ − 1 + o ( n φ − 1 ) was proved by Fine [ 150 ]. Ilan Vardi observes that the sharper estimate stated can be deduced from the fact that the error term e ( n ) \= f ( n ) − cn φ − 1 satisfies the approximate recurrence c φ n 2 − φ e ( n ) ≈ − ∑ k e ( k )[ 1 ⩽ k < cn φ − 1 ] . The function

Image

satisfies this recurrence asymptotically, if u ( x + 1 ) \= − u ( x ) . (Vardi conjectures that

Additional progress on this problem has been made by Jean-Luc Rémy, Journal of Number Theory, vol. 66 (1997), 1–28.

Image

for some such function u .) Calculations for small n show that f ( n ) equals the nearest integer to cn φ − 1 for 1 ⩽ n ⩽ 400 except in one case: f ( 273 ) \= 39 > c · 273 φ − 1 ≈ 38.4997 . But the small errors are eventually magnified, because of results like those in exercise 2.36 . For example, e ( 201636503 ) ≈ 35.73 ; e ( 919986484788 ) ≈ − 1959.07 .

9.64 (From this identity for B 2 ( x ) we can easily derive the identity of exercise 58 by induction on m .) If 0 < x < 1 , the integral Image can be expressed as a sum of N integrals that are each O ( N − 2 ) , so it is O ( N − 1 ) ; the constant implied by this O may depend on x . Integrating

Image

and letting N → ∞ now gives Image , a relation that Euler knew ([ 107 ] and [ 110 , part 2, §92]). Integrating again yields the desired formula. (This solution was suggested by E. M. E. Wermuth [ 367 ]; Euler’s original derivation did not meet modern standards of rigor.)

9.65 Since a 0 + a 1 n − 1 + a 2 n − 2 + · · · \= 1 +( n − 1 ) − 1 ( a 0 + a 1 ( n − 1 ) − 1 + a 2 ( n − 1 ) − 2 + · · · ) , we obtain the recurrence Image , which matches the recurrence for the Bell numbers. Hence a m \= ϖ m .

A slightly longer but more informative proof can be based on the fact that 1/(n-1)…(n-m)= Image , by ( 7.47 ).

“The paradox is now fully established that the utmost abstractions are the true weapons with which to control our thought of concrete fact.”

—A. N. Whitehead [ 372 ]

9.66 The expected number of distinct elements in the sequence 1 , f ( 1 ) , f ( f ( 1 )) , . . . , when f is a random mapping of { 1 , 2 , . . . , n } into itself, is the function Q ( n ) of exercise 56 , whose value is Image ; this might account somehow for the factor Image .

9.67 It is known that Image ; the constant e − π/6 has been verified empirically to eight significant digits.

9.68 This would fail if, for example, Image for some integer m and some Image ; but no counterexamples are known.