6.1 2314, 2431, 3241, 1342, 3124, 4132, 4213, 1423, 2143, 3412, 4321.
6.2 , because every such function partitions its domain into k nonempty subsets, and there are mk ways to assign function values for each partition. (Summing over k gives a combinatorial proof of (6.10).)
6.3 Now dk+1 ≤ (center of gravity) – = 1 – + (d1 + · · · + dk)/k. This recurrence is like (6.55) but with 1 – in place of 1; hence the optimum solution is dk+1 = (1 – )Hk. This is unbounded as long as < 1.
6.4 . (Similarly .)
6.5 Un(x, y) is equal to
and the first sum is
The remaining k–1 can be absorbed, and we have
This proves (6.75). Let Rn(x, y) = x–nUn(x, y); then R0(x, y) = 0 and Rn(x, y) = Rn–1(x, y)+1/n+y/x, hence Rn(x, y) = Hn+ny/x. (Incidentally, the original sum Un = Un(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 Fn+1 pairs of rabbits after n months; Fn of them are adults and Fn–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 Fn to Fn+2 when the units are squared. The true answer is about 20.72.)
6.10 The partial quotients a0, a1, a2, . . . are all equal to 1, because ϕ = 1 + 1/ϕ. (The Stern–Brocot representation is therefore RLRLRLRLRL . . . .)
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 znDn applied to f(z) = zx gives xnzx while ϑn applied to the same function gives xnzx; therefore the sequence ϑ0, ϑ1, ϑ2, . . . must relate to z0D0, z1D1, z2D2, . . . as x0, x1, x2, . . . relates to x0, x1, x2, . . . .
6.14 We have
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 , we have the general formula
Set x = 0 and appeal to (6.19).
6.16 ; this sum is always finite.
6.17 (a) (b) (c)
6.18 This is equivalent to (6.3) or (6.8).
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 bn is also divisible by at least one odd prime, whenever n > 2.)
6.22 |z/k(k + z)| ≤ 2|z|/k2 when k > 2|z|, so the sum is well defined when the denominators are not zero. If z = n we have , which approaches Hn as m → ∞. (The quantity Hz–1 – γ is often called the psi function ψ(z).)
6.23 z/(ez + 1) = z/(ez – 1) – 2z/(e2z – 1) = ∑n≥0(1 – 2n)Bnzn/n!.
6.24 When n is odd, Tn(x) is a polynomial in x2, hence its coefficients are multiplied by even numbers when we form the derivative and compute Tn+1(x) by (6.95). (In fact we can prove more: The Bernoulli number B2n always has 2 to the first power in its denominator, by exercise 54; hence 22n–k \T2n+1 ⇔ 2k\(n + 1). The odd positive integers (n + 1)T2n+1/22n are called Genocchi numbers 1, 1, 3, 17, 155, 2073, . . . , 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 – nHn < 100(n – 1) – (n – 1)Hn–1 ⇔ Hn–1 > 99. (The least such n is approximately e99–γ, while he finishes at N ≈ e100–γ, about e times as long. So he is getting closer during the final 63% of his journey.)
6.26 Let u(k) = Hk–1 and Δv(k) = 1/k, so that u(k) = v(k). Then we have .
6.27 Observe that when m > n we have gcd(Fm, Fn) = gcd(Fm–n, Fn) by (6.108). This yields a proof by induction.
6.28 (a) Qn = α(Ln – Fn)/2 + βFn. (The solution can also be written .
6.29 When k = 0 the identity is (6.133). When k = 1 it is, essentially,
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
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(x1, . . . , xn) with respect to xm is
K(x1, . . . , xm–1) K(xm+1, . . . , xn),
and the second derivative is zero; hence the answer is
K(x1, . . . , xn) + K(x1, . . . , xm–1) K(xm+1, . . . , xn)y.
6.31 Since , we have . These coefficients, incidentally, satisfy the recurrence
.
6.32 and , both of which appear in Table 265.
6.33 If n > 0, we have , by (6.71); , by (6.19).
6.34 We have ; and in general is given by (6.38) for all integers n.
6.35 Let n be the least integer > 1/ such that Hn > Hn–1.
6.36 Now dk+1 = (100+(1+d1)+· · ·+(1+dk))/(100+k), and the solution is dk+1 = Hk+100 – H101 + 1 for k ≥ 1. This exceeds 2 when k ≥ 176.
6.37 The sum (by parts) is . The infinite sum is therefore ln m. (It follows that
because νm(k) = (m – 1) ∑j≥1(k mod mj)/mj.)
6.38 . (By parts, using (5.16).)
6.39 Write it as ∑1≤j≤n j–1 ∑j≤k≤n Hk and sum first on k via (6.67), to get
6.40 If 6n – 1 is prime, the numerator of
is divisible by 6n – 1, because the sum is
Similarly if 6n + 1 is prime, the numerator of is a multiple of 6n + 1. For 1987 we sum up to k = 1324.
6.41 , hence we have Sn+1 + . The answer is Fn+2.
6.42 Fn.
6.43 Set in Σn≥0 Fnzn = z/(1 – z – z2) to get . 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 (m – k, m) and use induction.
6.45 Xn = A(n)α+B(n)β+C(n)γ+D(n)δ, where B(n) = Fn, A(n) = Fn–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 = 2v2 – 1 and v = 1–2 sin2 18° = 1–2u2. Hence u+v = 2(u+v)(v–u), and 4v2–2v–1 = 0. We can pursue this investigation to find the five complex fifth roots of unity:
“Let p be any old prime.”
(See [171], p. 419.)
6.47 , and the even powers of cancel out. Now let p be an odd prime. Then except when k = (p–1)/2, and except when k = 0 or k = (p – 1)/2; hence Fp ≡ 5(p–1)/2 and 2Fp+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 Ki,j = Kj–i+1(xi, . . . , xj). Using (6.133) repeatedly, both sides expand to (K1,m–2(xm–1 + xm+1) + K1,m–3)Km+2,n + K1,m–2Km+3,n.
6.49 Set in (6.146); the partial quotients are 0, 2F0, 2F1, 2F2, . . . . (Knuth [206] noted that this number is transcendental.)
6.50 (a) f(n) is even ⇔ 3n. (b) If the binary representation of n is (1a1 0a2 . . . 1am–1 0am )2, where m is even, we have f(n)=K(a1, a2, . . . , am–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,
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 xp ≡ xp + x1 and xp ≡ xp – x (mod p), since Fermat’s theorem tells us that xp – 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 .
(c) We have for 3 ≤ k ≤ p, then for 4 ≤ k ≤ p, etc. (Similarly, we have .)
(d) . But , so
is a multiple of p2. (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 , where . (b) Working mod 5 we have Hr = 0, 1, 4, 1, 0 for 0 ≤ r ≤ 4. Thus the first solution is n = 4. By part (a) we know that 5an ⇒ 5an/5; so the next possible range is n = 20 + r, 0 ≤ r ≤ 4, when we have Hn = . The numerator of , like the numerator of H4, 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 , which is plus a fraction whose numerator is a multiple of 5. If , where m is an integer, the harmonic number H100+r will have a numerator divisible by 5 if and only if m + Hr ≡ 0 (mod 5); hence m must be ≡ 0, 1, or 4. Working modulo 5 we find ; 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 p2ap–1, pap2–p, and pap2–1, if p is any prime ≥ 5. The argument just given shows that these are the only solutions to pan if and only if there are no solutions to p–2Hp–1 + Hr ≡ 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 Hn 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
(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 Sm(p) ≡ Sm–(p–1)(p) (mod p), since kp–1 ≡ 1 when 1 ≤ k < p. Also Sp–1(p) ≡ p – 1 ≡ –1. If 0 < m < p – 1, we can write
(b) The condition in the hint implies that the denominator of I2n is not divisible by any prime p; hence I2n must be an integer. To prove the hint, we may assume that n>1. Then
is an integer, by (6.78), (6.84), and part (a). So we want to verify that none of the fractions has a denominator divisible by p. The denominator of isn’t divisible by p, since Bk has no p2 in its denominator (by induction); and the denominator of p2n–k–1/(2n – k + 1) isn’t divisible by p, since 2n – k + 1 < p2n–k when k ≤ 2n–2; QED. (The numbers I2n are tabulated in [224]. Hermite calculated them through I18 in 1875 [184]. It turns out that I2 = I4 = I6 = I8 = I10 = I12 = 1; hence there is actually a “simple” pattern to the Bernoulli numbers displayed in the text, including . But the numbers I2n don’t seem to have any memorable features when 2n > 12. For example, , 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 B2n 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 2n–1n + 2n–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 B2n can be 6 also when n has nonprime values, such as 49.
6.55 The stated sum is , by Vandermonde’s convolution. To get (6.70), differentiate and set x = 0.
6.56 First replace kn+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 . Otherwise we need to take the limit of (5.41) minus the term for k = m, as x → –m; the answer comes to .
6.57 First prove by induction that the nth row contains at most three distinct values An ≥ Bn ≥ Cn; if n is even they occur in the cyclic order [Cn, Bn, An, Bn, Cn], while if n is odd they occur in the cyclic order [Cn, Bn, An, An, Bn]. Also
A2n+1 = | A2n + B2n ; | A2n = | 2A2n–1 ; |
B2n+1 = | B2n + C2n ; | B2n = | A2n–1 + B2n–1 ; |
C2n+1 = | 2C2n ; | C2n = | B2n–1 + B2n–1 . |
It follows that Qn = An – Cn = Fn+1. (See exercise 5.75 for wraparound binomial coefficients of order 3.)
6.58 (a) . (Square Binet’s formula (6.123) and sum on n, then combine terms so that ϕ and disappear.) (b) Similarly,
It follows that . (The corresponding recurrence for mth 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 3n+1 because
either x or x + 8·3n–1 or x + 16·3n–1 will do the job.
6.60 F1 + 1, F2 + 1, F3 + 1, F4 – 1, and F6 – 1 are the only cases. Otherwise the Lucas numbers of exercise 28 arise in the factorizations
(We have Fm+n – (–1)nFm–n = LmFn in general.)
6.61 1/F2m = Fm–1/Fm – F2m–1/F2m when m is even and positive. The second sum is 5/4 – F3·2n–1/F3·2n, for n ≥ 1.
6.62 (a) and . Incidentally, we also have and . (b) A table of small values reveals that
(c) Bn/An+1 – Bn–1/An = 1/(F2n+1 + 1) because and . Notice that Bn/An+1 = (Fn/Fn+1)[n even]+(Ln/Ln+1)[n odd]. (d) Similarly, . This quantity can also be expressed as (5Fn/Ln+1)[n even] + (Ln/Fn+1)[n odd].
6.63 (a) . There are with πn = n and with πn < n. (b) . 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 .
6.64 The denominator of , by the proof in exercise 5.72. The denominator of is the same, by (6.44), because and is even for k > 0.
6.65 This is equivalent to saying that is the probability that we have x1 + · · · + xn = k, when x1, . . . , xn are independent random numbers uniformly distributed between 0 and 1. Let yj = (x1 + · · · + xj) mod 1. Then y1, . . . , yn are independently and uniformly distributed, and x1 + · · · + xn 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 2n+1(2n+1 – 1)Bn+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 by (6.3) and (6.40). Now use (6.34). (This identity has a combinatorial interpretation [59].)
6.68 We have the general formula
analogous to (6.38). When m = 2 this equals
6.69 . (It would be nice to automate the derivation of formulas such as this.)
6.70 1/k – 1/(k + z) = z/k2 – z2/k3 + · · · , which converges when |z| < 1.
6.71 Note that . If we find f(z)/z! + γ = Hz.
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 has the power series ∑n≥0(–1)n–1(4n – 2)B2nz2n/(2n)!; and
because and .
6.73 cot(z + π) = cot z and ; hence the identity is equivalent to
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
is also true. It can be proved from (6.88), or from
which is equivalent to the partial fraction expansion of 1/(zn – 1).)
6.74 Since tan 2z + sec 2z = (sin z + cos z)/(cos z – sin z), setting x = 1 in (6.94) gives Tn(1) = 2nEn, where 1/cos z = ∑n≥0 E2nz2n/(2n)!. (The coefficients En are called Euler numbers in combinatorics, not to be confused with the Eulerian numbers . We have E0, E1, E2, . . . = 1, 1, 1, 2, 5, 16, 61, 272, 1385, 7936, 50521, . . . . Numerical analysts define Euler numbers differently: Their En is (–1)n/2En[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 Em,nwmzn/m! n!. Then the equations G(w, 0) = 0 and imply that Em,0 = 0 when m is odd, Em,n+1 = Em+1,n + Em,n when m + n is even; the equations H(0, z) = 1 and imply that E0,n = [n = 0] when n is even, Em+1,n = Em,n+1+Em,n when m+n is odd. Consequently the nth row below the apex of the triangle contains the numbers En,0, En–1,1, . . . , E0,n. At the left, En,0 is the secant number En [n even]; at the right, E0,n = Tn + [n = 0].
6.76 Let An denote the sum. Looking ahead to equation (7.49), we see that . Therefore, by exercise 23 or 72,
An = (2n+1 – 4n+1)Bn+1/(n + 1) = (–1)(n+1)/2Tn + [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
The latter equation, incidentally, is equivalent to
6.78 If p(x) is any polynomial of degree ≤ n, we have
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):
6.79 Sam Loyd [256, pages 288 and 378] gave the construction
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 Am/Am–1 ≈ ϕ, so we try Am–1 = 618034 + r and Am–2 = 381966–r. Then Am–3 = 236068+2r, etc., and we find Am–18 = 144–2584r, Am–19 = 154 + 4181r. Hence r = 0, x = 154, y = 144, m = 20.
6.81 If P(Fn+1, Fn) = 0 for infinitely many even values of n, then P(x, y) is divisible by U(x, y) – 1, where U(x, y) = x2 – xy – y2. For if t is the total degree of P, we can write
Then
and we have 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(Fn+1, Fn) = (–1)n and n is even, so P0(x, y) = P(x, y) – (U(x, y) – 1)A(x, y) is another polynomial such that P0(Fn+1, Fn) = 0. The total degree of P0 is less than t, so P0 is a multiple of U – 1 by induction on t.
Similarly, P(x, y) is divisible by U(x, y) + 1 if P(Fn+1, Fn) = 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
always applying the leftmost applicable carry. This process terminates because the binary value obtained by reading (bm . . . b2)F as (bm . . . b2)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 = Fj1 +· · ·+Fjq and n = Fk1 +· · ·+Fkr in the Fibonacci number system, let , by analogy with multiplication of binary numbers. (This definition implies that when m and n are large, although 1 ο n ≈ ϕ2n.) Fibonacci addition leads to a proof of the associative law l ο (m ο n) = (l ο m) ο n.
Exercise: m ο n = mn + (m+1)/ϕn + m (n+1)/ϕ.
6.83 Yes; for example, we can take
A0 = | 331635635998274737472200656430763 ; |
A1 = | 1510028911088401971189590305498785 . |
The resulting sequence has the property that An is divisible by (but unequal to) pk when n mod mk = rk, where the numbers (pk, mk, rk) 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 Am+n = AmFn–1 + Am+1Fn, together with the congruences
A0 ≡ Fmk–rk mod pk ,
A1 ≡ Fmk–rk+1 mod pk ,
for each of the triples (pk, mk, rk). (An improved solution, in which A0 and A1 are numbers of “only” 17 digits each, is also possible [218].)
6.84 The sequences of exercise 62 satisfy A–m = Am, B–m = –Bm, and
AmAn = Am+n + Am–n ;
AmBn = Bm+n – Bm–n ;
BmBn = Am+n – Am–n .
Let fk = Bmk/Amk+l and gk = Amk/Bmk+l, where . Then fk+1 – fk = AlBm/(A2mk+n + Am) and gk – gk+1 = AlBm/(A2mk+n – Am); hence we have
6.85 The property holds if and only if N has one of the seven forms 5k, 2·5k, 4·5k, 3j·5k, 6·5k, 7·5k, 14·5k.
6.86 For any positive integer m, let r(m) be the smallest index j such that Cj is divisible by m; if no such j exists, let r(m) = ∞. Then Cn is divisible by m if and only if gcd(Cn, Cr(m)) is divisible by m if and only if Cgcd(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 C1, C2, . . . has a function r(m), possibly infinite, such that Cn is divisible by m if and only if n is divisible by r(m).)
Now let Π(n) = C1C2 . . . Cn, so that
If p is prime, the number of times p divides Π(n) is fp(n) = ∑k≥1 n/r(pk), since n/pk is the number of elements {C1, . . . , Cn} that are divisible by pk. Therefore fp(m + n) ≥ fp(m) + fp(n) for all p, and is an integer.
6.87 The matrix product is
This relates to products of L and R as in (6.137), because we have
The determinant is Kn(x1, . . . , xn); the more general tridiagonal determinant
satisfies the recurrence Dn = xnDn–1 – ynDn–2.
6.88 Let α–1 = a0 + 1/(a1 + 1/(a2 + · · · )) be the continued fraction representation of α–1. Then we have
where
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–nα, as in exercise 49.
6.89 Let p = K(0, a1, a2, . . . , am), so that p/n is the mth convergent to the continued fraction. Then α = p/n + (–1)m/nq, where q = K(a1, . . . , am, β) and β > 1. The points {kα} for 0 ≤ k < n can therefore be written
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(a1, . . . , am) 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
Kj+k+1(1, . . . , 1, a + 1, b1, . . . , bk) | |
= | Kj+k+1(1, . . . , 1, a, b1, . . . , bk) + Kj(1, . . . , 1) Kk(b1, . . . , bk) |
≤ | Kj+k+1(1, . . . , 1, a, b1, . . . , bk) + Kj+k(1, . . . , 1, a, b1, . . . , bk) |
= | Kj+k+2(1, . . . , 1, a, b1, . . . , bk). |
(Motzkin and Straus [278] show how to solve more general maximization problems on continuants.)
6.91 A candidate for the case n mod appears in [213, §6], although it may be best to multiply the integers discussed there by some constant involving . 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 bn is quite strange: We have bn = lcm(1, . . . , n) for 968 ≤ n ≤ 1066; on the other hand, b600 = lcm(1, . . . , 600)/(33 · 52 · 43). Andrew Odlyzko observes that p divides lcm(1, . . . , n)/bn if and only if kpm ≤ n < (k + 1)pm for some m ≥ 1 and some k < p such that p divides the numerator of Hk. 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 , 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 z4 for and z for in the generating function, getting 1/(1 – z4 – z2). This is like the generating function for T, but with z replaced by z2. Therefore the answer is zero if m is odd, otherwise Fm/2+1.
7.2 G(z) = 1/(1 – 2z) + 1/(1 – 3z); Ĝ(z) = e2z + e3z.
7.3 Set z = 1/10 in the generating function, getting ln .
7.4 Divide P(z) by Q(z), getting a quotient T(z) and a remainder P0(z) whose degree is less than the degree of Q. The coefficients of T(z) must be added to the coefficients [zn] P0(z)/Q(z) for small n. (This is the polynomial T(z) in (7.28).)
7.5 This is the convolution of (1 + z2)r with (1 + z)r, so
S(z) = (1 + z + z2 + z3)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 g0 = α, g1 = β, gn = gn–1 + 2gn–2 + (–1)nγ be gn = A(n)α + B(n)β + C(n)γ. The function 2n works when α = 1, β = 2, γ = 0; the function (–1)n works when α = 1, β = –1, γ = 0; the function (–1)nn works when α = 0, β = –1, γ = 3. Hence A(n) + 2B(n) = 2n, A(n) – B(n) = (–1)n, and –B(n) + 3C(n) = (–1)nn.
7.7 G(z) = (z/(1 – z)2)G(z) + 1, hence
we have gn = F2n + [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
Now set x = m.
7.10 The identity implies that .
7.11 (a) C(z) = A(z)B(z2)/(1 – z). (b) zB′(z) = A(2z)ez, hence . (c) A(z) = B(z)/(1 – z)r+1, hence B(z) = (1 – z)r+1A(z) and we have .
7.12 Cn. 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
7.13 Extend the sequence periodically (let xm+k = xk) and define sn = x1 + · · · + xn. We have sm = l, s2m = 2l, etc. There must be a largest index kj such that skj = j, skj+m = l + j, etc. These indices k1, . . . , kl (mod m) specify the cyclic shifts in question.
For example, in the sequence –2, 1, –1, 0, 1, 1, –1, 1, 1, 1 with m = 10 and l = 2 we have k1 = 17, k2 = 24.
7.14 Ĝ(z) = –2zĜ(z) + Ĝ(z)2 + z (be careful about the final term!) leads via the quadratic formula to
Hence g2n+1 = 0 and g2n = (–1)n(2n)! Cn–1, for all n > 0.
7.15 There are partitions with k other objects in the subset containing n+1. Hence . The solution to this differential equation is , and c = –1 since . (We can also get this result by summing (7.49) on m, since .)
7.16 One way is to take the logarithm of
B(z) = 1/((1 – z)a1 (1 – z2)a2 (1 – z3)a3 (1 – z4)a4 . . .),
then use the formula for ln and interchange the order of summation.
7.17 This follows since . There’s also a formula that goes in the other direction:
7.18 (a) (b) –ζ′(z); (c) ζ(z)/ζ(2z). Every positive integer is uniquely representable as m2q, where q is squarefree.
7.19 If n > 0, the coefficient [zn] 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 zn in F(z)xF(z)y = F(z)x+y. The second comes from equating coefficients of zn–1 in F′(z)F(z)x–1F(z)y = F′(z)F(z)x+y–1, because we have
(Further convolutions follow by taking ∂/∂x, as in (7.43).)
Still more is true, as shown in [221]: We have
for arbitrary x, y, and t. In fact, xfn(x + tn)/(x + tn) is the sequence of polynomials for the coefficients of Ft(z)x, where
Ft(z) = F(zFt(z)t) .
(We saw special cases in (5.59) and (6.52).)
7.20 Let G(z) = ∑n≥0 gnzn. Then
for all k, l ≥ 0, if we regard gn = 0 for n < 0. Hence if P0(z), . . . , Pm(z) are polynomials, not all zero, having maximum degree d, then there are polynomials p0(n), . . . , pm+d(n) such that
Therefore a differentiably finite G(z) implies that
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 – z10)(1 – z20) = (z10), where (z) = 1/(1 – z)(1 – z2). (a) The partial fraction decomposition of (z) is , so . Setting n = 50 yields 26 ways to make the payment. (b) (z) = (1 + z)/(1 – z2)2 = (1 + z)(1 + 2z2 + 3z4 + · · · ), so [zn] (z) = n/2 + 1. (Compare this with the value Nn = n/5 + 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 AB be the result of pasting the base of A to the upper left diagonal of , and pasting the base of B to the upper right diagonal. Thus, for example,
(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 zn is the number of triangulations with n triangles, namely the number of ways to decompose an (n + 2)-gon into triangles. Since P = 1 + zP2, this is the generating function for Catalan numbers C0 + C1z + C2z2 + · · · ; the number of ways to triangulate an n-gon is .
7.23 Let an be the stated number, and bn 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
an = 2an–1 + 4bn–1 + an–2 + [n = 0] ;
bn = an–1 + bn–1 .
Hence the generating functions satisfy A = 2zA + 4zB + z2A + 1, B = zA + zB, and we have
This formula relates to the problem of 3 × n domino tilings; we have an = , which is rounded to the nearest integer.
“Curiously, a2n is equal to , the square of the number of ways to tile a 3 × 2n rectangle with dominoes; and .”
—I. Kaplansky
7.24 n∑k1+···+km=n k1 · . . . · km/m = F2n+1 + F2n–1 – 2. (Consider the coefficient , where G(z) = z/(1 – z)2.)
7.25 The generating function is P(z)/(1 – zm), where P(z) = z + 2z2 + · · · + (m – 1)zm–1 = ((m – 1)zm+1 – mzm + z)/(1 – z)2. The denominator is Q(z) = 1 – zm = (1 – ω0z)(1 – ω1z) . . . (1 – ωm–1z). By the rational expansion theorem for distinct roots, we obtain
7.26 leads to as in equation (7.61).
7.27 Each oriented cycle pattern begins with or or a 2 × k cycle (for some k ≥ 2) oriented in one of two ways. Hence
Qn = Qn–1 + Qn–2 + 2Qn–2 + 2Qn–3 + · · · + 2Q0
for n ≥ 2; Q0 = Q1 = 1. The generating function is therefore
and .
7.28 In general if A(z) = (1 + z + · · · + zm–1)B(z), we have Ar + Ar+m + Ar+2m + · · · = B(1) for 0 ≤ r < m. In this case m = 10 and B(z) = (1 + z + · · · + z9)(1 + z2 + z4 + z6 + z8)(1 + z5).
7.29 , so the answer is .
7.30 , 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 pk that exactly divide n.
7.32 We may assume that each bk ≥ 0. A set of arithmetic progressions forms an exact cover if and only if
Subtract zbm/(1 – zam) from both sides and set z = e2πi/am. The left side is infinite, and the right side will be finite unless am–1 = am.
7.33 (–1)n–m+1[n > m]/(n – m).
7.34 We can also write . In general, if
we have Gn = z1Gn–1 + z2Gn–2 + · · · + zrGn–r + [n = 0], and the generating function is 1/(1 – z1w – z2w2 – · · · – zrwr). In the stated special case the answer is 1/(1 – w – zmwm+1). (See (5.74) for the case m = 1.)
7.35 (a) . (b) by (7.50) and (6.58). Another way to do part (b) is to use the rule with .
7.37 (a) The amazing identity a2n = a2n+1 = bn holds in the table
(b) A(z) = 1/((1 – z)(1 – z2)(1 – z4)(1 – z8) . . .). (c) B(z) = A(z)/(1 – z), and we want to show that A(z) = (1 + z)B(z2). This follows from A(z) = A(z2)/(1 – z).
7.38 (1 – wz)M(w, z) = ∑m,n≥1(min(m, n) – min(m–1, n–1))wmzn = ∑m,n≥1 wmzn = wz/(1 – w)(1 – z). In general,
7.39 The answers to the hint are
respectively. Therefore: (a) We want the coefficient of zm in the product (1 + z)(1 + 2z) . . . (1 + nz). This is the reflection of , so it is and the answer is . (b) The coefficient of zm in 1/((1– z)(1 – 2z)...(1 – nz)) is by (7.47).
7.40 The egf for nFn–1 – Fn is where . The egf for n¡ is e–z/(1 – z). The product is
We have . So the answer is (–1)nFn.
7.41 The number of up-down permutations with the largest element n in position 2k is . Similarly, the number of up-down permutations with the smallest element 1 in position 2k + 1 is , because down-up permutations and up-down permutations are equally numerous. Summing over all possibilities gives
The egf  therefore satisfies 2Â′(z) = Â(z)2 +1 and Â(0) = 1; the given function solves this differential equation. (Consequently An is the Euler number En of exercise 6.74, namely a secant number when n is even, a tangent number when n is odd.)
7.42 Let an be the number of Martian DNA strings that don’t end with c or e; let bn be the number that do. Then
and the total number is [zn](1 + z)/(1 – 4z – z2) = F3n+2.
7.43 By (5.45), gn = ΔnĠ(0). The nth difference of a product can be written
and . Therefore we find
This is a sum over all trinomial coefficients; it can be put into the more symmetric form
The empty set is pointless.
7.44 Each partition into k nonempty subsets can be ordered in k! ways, so bk = k!. Thus . And this is the geometric series ∑k≥0 ekz/2k+1, hence ak = 1/2k+1. Finally, ck = 2k; 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 x1x3x2 produces x1 < x3 < x2 and x1 = x3 < x2, because 1 < 3 > 2.)
7.45 This sum is ∑n≥1 r(n)/n2, 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) = 2t. Hence r(n)/n2 is multiplicative and the sum is
7.46 Let . Then Sn = Sn–1 + αSn–3 + [n = 0], and the generating function is 1/(1 – z – αz3). When , the hint tells us that this has a nice factorization . The general expansion theorem now tells us that , and the remaining constant c turns out to be .
7.47 The Stern–Brocot representation of is R(LR2)∞, because
The fractions are ; they eventually have the cyclic pattern
7.48 We have g0 = 0, and if g1 = m the generating function satisfies
Hence G(z) = P(z)/(az2 + bz + c)(1 – z) for some polynomial P(z). Let ρ1 and ρ2 be the roots of cz2 + bz + a, with |ρ1| ≥ |ρ2|. If b2 – 4ac ≤ 0 then |ρ1|2 = ρ1ρ2 = a/c is rational, contradicting the fact that approaches . Hence ; and this implies that a = –c, b = –2c, . The generating function now takes the form
where r = d/c. Since g2 is an integer, r is an integer. We also have
and this can hold only if r = –1, because alternates in sign as it approaches zero. Hence (a, b, c, d) = ±(1, 2, –1, 1). Now we find , which is between 0 and 1 only if 0 ≤ m ≤ 2. Each of these values actually gives a solution; the sequences gn are 0, 0, 1, 3, 8, . . . , 0, 1, 3, 8, 20, . . . , and 0, 2, 5, 13, 32, . . . .
7.49 (a) The denominator of is 1 – 2z – z2; hence an = 2an–1 + an–2 for n ≥ 2. (b) True because an is even and . (c) Let
We would like bn to be odd for all n > 0, and . Working as in part (a), we find b0 = 2, b1 = p, and for n ≥ 2. One satisfactory solution has p = 3 and q = 17.
7.50 Extending the multiplication idea of exercise 22, we have
Replace each n-gon by zn–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
and the quadratic formula gives . The coefficient of zn–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 wzn–2 we get
a formula in which the coefficient of wmzn–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 p0(y) = 1, p1(y) = y, p2(y) = y2 + y, p3(y) = y3 + 3y2 + 3y. Let pn(y) = q2n(x) where y = x(1 – x); we seek a generating function that defines q2n+1(x) in a convenient way. One such function is ∑n qn(x)zn/n! = 2eixz/(eiz + 1), from which it follows that qn(x) = inEn(x), where En(x) is called an Euler polynomial. We have , so Euler polynomials are analogous to Bernoulli polynomials, and they have factors analogous to those in (6.98). By exercise 6.23 we have ; this polynomial has integer coefficients by exercise 6.54. Hence q2n(x), whose coefficients have denominators that are powers of 2, must have integer coefficients. Hence pn(y) has integer coefficients. Finally, the relation shows that
and it follows that the ’s are positive. (A similar proof shows that the related quantity (–1)n(2n + 2)E2n+1(x)/(2x – 1) has positive integer coefficients, when expressed as an nth degree polynomial in y.) It can be shown that is the Genocchi number (–1)n–1(22n+1 – 2)B2n (see exercise 6.24), and that , etc.
7.53 It is P(1+V4n+1+V4n+3)/6. Thus, for example, T20 = P12 = 210; T285 = P165 = 40755.
7.54 Let Ek be the operation on power series that sets all coefficients to zero except those of zn where n mod m = k. The stated construction is equivalent to the operation
E0 S E0 S (E0 + E1) S ... S (E0 + E1 + · · · + Em–1)
applied to 1/(1 – z), where S means “multiply by 1/(1 – z).” There are m! terms
E0 S Ek1 S Ek2 S ... S Ekm
where 0 ≤ kj < j, and every such term evaluates to zrm/(1 – zm)m+1 if r is the number of places where kj < kj+1. Exactly terms have a given value of r, so the coefficient of zmn is by (6.37). (The fact that operation Ek can be expressed with complex roots of unity seems to be of no help in this problem.)
7.55 Suppose that P0(z)F(z) + · · · + Pm(z)F(m)(z) = Q0(z)G(z) + · · · + Qn(z)G(n)(z) = 0, where Pm(z) and Qn(z) are nonzero. (a) Let H(z) = F(z) + G(z). Then there are rational functions Rk,l(z) for 0 ≤ l < m + n such that H(k)(z) = Rk,0(z)F(0)(z) + · · · + Rk,m–1(z)F(m–1)(z) + Rk,m(z)G(0)(z) + · · · + Rk,m+n–1(z)G(n–1)(z). The m + n + 1 vectors (Rk,0(z), . . . , Rk,m+n–1(z)) are linearly dependent in the (m + n)-dimensional vector space whose components are rational functions; hence there are rational functions Sl(z), not all zero, such that S0(z)H(0)(z) + · · · + Sm+n(z)H(m+n)(z) = 0. (b) Similarly, let H(z) = F(z)G(z). There are rational Rk,l(z) for 0 ≤ l < mn with , hence S0(z)H(0)(z) + · · · + Smn(z)H(mn)(z) = 0 for some rational Sl(z), not all zero. (A similar proof shows that if fn and gn are polynomially recursive, so are fn + gn and fngn. 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 , and he gave the formula . He also discovered a “memorable failure of induction” while examining these numbers: Although 3tn – tn+1 is equal to Fn–1(Fn–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[zn+10k] (1 + z + z2)n can be expressed as a closed form in terms of Fibonacci numbers.
H. S. Wilf observes that [zn] (a + bz + cz2)n= [zn] 1/f(z), where (see [373, page 159]), and it follows that the coefficients satisfy
(n + 1)An+1 – (2n + 1)bAn + n(b2 – 4ac)An–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(b2 – 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.)
3.144.107.191