First Order Recursions Multiplicative Identity: 1a = a

58 Chapter 4 380 Problem Shew that tan π 2 100 + 2 tan π 2 99 +2 2 tan π 2 298 + ··· + 2 98 tan π 2 2 = cot π 2 100 . 381 Problem Shew that n X k=1 k k 4 + k 2 + 1 = 1 2 · n 2 + n n 2 + n + 1 . 382 Problem Evaluate € 1 · 2 · 4 + 2 · 4 · 8 + 3 · 6 · 12 + ··· 1 · 3 · 9 + 2 · 6 · 18 + 3 · 9 · 27 + ··· Š 1 3 . 383 Problem Shew that ∞ X n=1 arctan 1 1 + n + n 2 = π 4 . Hint: From tan x − tan y = tan x − tan y 1 + tan x tan y deduce that arctan a − arctan b = arctan a − b 1 + ab for suitable a and b. 384 Problem Prove the following result due to Gramm ∞ Y n=2 n 3 − 1 n 3 + 1 = 2 3 .

4.5 First Order Recursions

We have already seen the Fibonacci numbers, defined by the recursion f = 0 , f 1 = 1 and f n+1 = f n + f n−1 , n ≥ 1. The order of the recurrence is the difference between the highest and the lowest subscripts. For example u n+2 − u n+1 = 2 is of the first order, and u n+4 + 9u 2 n = n 5 is of the fourth order. A recurrence is linear if the subscripted letters appear only to the first power. For example u n+2 − u n+1 = 2 is a linear recurrence and x 2 n + nx n−1 = 1 and x n + 2 x n−1 = 3 are not linear recurrences. A recursion is homogeneous if all its terms contain the subscripted variable to the same power. Thus x m+3 + 8x m+2 − 9x m = 0 is homogeneous. The equation x m+3 + 8x m+2 − 9x m = m 2 − 3 is not homogeneous. A closed form of a recurrence is a formula that permits us to find the n-th term of the recurrence without having to know a priori the terms preceding it. We outline a method for solving first order linear recurrence relations of the form x n = ax n−1 + f n , a 6= 1, where f is a polynomial. First Order Recursions 59 1. First solve the homogeneous recurrence x n = ax n−1 by “raising the subscripts” in the form x n = ax n−1 . This we call the characteristic equation. Cancelling this gives x = a . The solution to the homogeneous equation x n = ax n−1 will be of the form x n = Aa n , where A is a constant to be determined. 2. Test a solution of the form x n = Aa n + gn , where g is a polynomial of the same degree as f . 385 Example Let x = 7 and x n = 2x n−1 , n ≥ 1. Find a closed form for x n . Solution: Raising subscripts we have the characteristic equation x n = 2x n−1 . Cancelling, x = 2. Thus we try a solution of the form x n = A2 n , were A is a constant. But 7 = x = A2 and so A = 7 . The solution is thus x n = 72 n . Aliter: We have x = 7 x 1 = 2x x 2 = 2x 1 x 3 = 2x 2 .. . .. . .. . x n = 2x n−1 Multiplying both columns, x x 1 ··· x n = 7 · 2 n x x 1 x 2 ···x n−1 . Cancelling the common factors on both sides of the equality, x n = 7 · 2 n . 386 Example Let x = 7 and x n = 2x n−1 + 1 , n ≥ 1. Find a closed form for x n . Solution: By raising the subscripts in the homogeneous equation we obtain x n = 2x n−1 or x = 2. A solution to the homogeneous equation will be of the form x n = A2 n . Now f n = 1 is a polynomial of degree 0 a constant and so we test a particular constant solution C. The general solution will have the form x n = A2 n + B. Now, 7 = x = A2 + B = A + B. Also, x 1 = 2x + 7 = 15 and so 15 = x 1 = 2A + B. Solving the simultaneous equations A + B = 7 , 2A + B = 15 , we find A = 8 , B = −1. So the solution is x n = 82 n − 1 = 2 n+3 − 1 . Aliter: We have: x = 7 x 1 = 2x + 1 x 2 = 2x 1 + 1 x 3 = 2x 2 + 1 .. . .. . .. . x n−1 = 2x n−2 + 1 x n = 2x n−1 + 1 60 Chapter 4 Multiply the kth row by 2 n−k . We obtain 2 n x = 2 n · 7 2 n−1 x 1 = 2 n x + 2 n−1 2 n−2 x 2 = 2 n−1 x 1 + 2 n−2 2 n−3 x 3 = 2 n−2 x 2 + 2 n−3 .. . .. . .. . 2 2 x n−2 = 2 3 x n−3 + 2 2 2x n−1 = 2 2 x n−2 + 2 x n = 2x n−1 + 1 Adding both columns, cancelling, and adding the geometric sum, x n = 7 · 2 n + 1 + 2 + 2 2 + ··· + 2 n−1 = 7 · 2 n + 2 n − 1 = 2 n+3 − 1 . Aliter: Let u n = x n + 1 = 2x n−1 + 2 = 2x n−1 + 1 = 2u n−1 . We solve the recursion u n = 2u n−1 as we did on our first example: u n = 2 n u = 2 n x + 1 = 2 n · 8 = 2 n+3 . Finally, x n = u n − 1 = 2 n+3 − 1 . 387 Example Let x = 2 , x n = 9x n−1 − 56n + 63. Find a closed form for this recursion. Solution: By raising the subscripts in the homogeneous equation we obtain the characteristic equation x n = 9x n−1 or x = 9. A solution to the homogeneous equation will be of the form x n = A9 n . Now f n = −56n + 63 is a polynomial of degree 1 and so we test a particular solution of the form Bn + C. The general solution will have the form x n = A9 n + Bn + C. Now x = 2 , x 1 = 92 − 56 + 63 = 25 , x 2 = 925 − 562 + 63 = 176. We thus solve the system 2 = A + C , 25 = 9A + B + C , 176 = 81A + 2B + C . We find A = 2 , B = 7,C = 0. The general solution is x n = 29 n + 7n . 388 Example Let x = 1 , x n = 3x n−1 − 2n 2 + 6n − 3. Find a closed form for this recursion. Solution: By raising the subscripts in the homogeneous equation we obtain the characteristic equation x n = 3x n−1 or x = 9. A solution to the homogeneous equation will be of the form x n = A3 n . Now f n = −2n 2 + 6n − 3 is a polynomial of degree 2 and so we test a particular solution of the form Bn 2 + Cn + D. The general solution will have the form x n = A3 n + Bn 2 + Cn + D. Now x = 1 , x 1 = 31 − 2 + 6 − 3 = 4 , x 2 = 34 − 22 2 + 62 − 3 = 13 , x 3 = 313 − 23 2 + 63 − 3 = 36. We thus solve the system 1 = A + D , 4 = 3A + B + C + D , 13 = 9A + 4B + 2C + D , 36 = 27A + 9B + 3C + D . We find A = B = 1 ,C = D = 0. The general solution is x n = 3 n + n 2 . Practice 61 389 Example Find a closed form for x n = 2x n−1 + 3 n−1 , x = 2 . Solution: We test a solution of the form x n = A2 n + B3 n . Then x = 2 , x 1 = 22 + 3 = 5 . We solve the system 2 = A + B , 7 = 2A + 3B . We find A = 1 , B = 1. The general solution is x n = 2 n + 3 n . We now tackle the case when a = 1 . In this case, we simply consider a polynomial g of degree 1 higher than the degree of f . 390 Example Let x = 7 and x n = x n−1 + n , n ≥ 1. Find a closed formula for x n . Solution: By raising the subscripts in the homogeneous equation we obtain the characteristic equation x n = x n−1 or x = 1. A solution to the homogeneous equation will be of the form x n = A1 n = A, a constant. Now f n = n is a polynomial of degree 1 and so we test a particular solution of the form Bn 2 + Cn + D, one more degree than that of f . The general solution will have the form x n = A + Bn 2 + Cn + D. Since A and D are constants, we may combine them to obtain x n = Bn 2 + Cn + E . Now, x = 7 , x 1 = 7 + 1 = 8 , x 2 = 8 + 2 = 10 . So we solve the system 7 = E , 8 = B + C + E , 10 = 4B + 2C + E . We find B = C = 1 2 , E = 7. The general solution is x n = n 2 2 + n 2 + 7. Aliter: We have x = 7 x 1 = x + 1 x 2 = x 1 + 2 x 3 = x 2 + 3 .. . .. . .. . x n = x n−1 + n Adding both columns, x + x 1 + x 2 + ··· + x n = 7 + x + x 2 + ··· + x n−1 + 1 + 2 + 3 + ···+ n. Cancelling and using the fact that 1 + 2 + ···+ n = nn + 1 2 , x n = 7 + nn + 1 2 . Some non-linear first order recursions maybe reduced to a linear first order recursion by a suitable transformation. 391 Example A recursion satisfies u = 3 , u 2 n+1 = u n , n ≥ 1. Find a closed form for this recursion. Solution: Let v n = log u n . Then v n = log u n = log u 1 2 n−1 = 1 2 log u n−1 = v n−1 2 . As v n = v n−1 2, we have v n = v 2 n , that is, log u n = log u 2 n . Therefore, u n = 3 1 2 n . Practice 62 Chapter 4 392 Problem Find a closed form for x = 3 , x n = x n−1 + 4 3 . 393 Problem Find a closed form for x = 1 , x n = 5x n−1 − 20n + 25 . 394 Problem Find a closed form for x = 1 , x n = x n−1 + 12n . 395 Problem Find a closed form for x n = 2x n−1 + 95 n−1 , x = 5 . 396 Problem Find a closed form for a = 5 , a j+1 = a 2 j + 2a j , j ≥ 0. 397 Problem AIME, 1994 If n ≥ 1, x n + x n−1 = n 2 . Given that x 19 = 94 , find the remainder when x 94 is divided by 1000 . 398 Problem Find a closed form for x = −1; x n = x n−1 + n 2 , n 0. 399 Problem If u = 1 3 and u n+1 = 2u 2 n − 1 , find a closed form for u n . 400 Problem Let x 1 = 1 , x n+1 = x 2 n − x n + 1 , n 0. Shew that ∞ X n=1 1 x n = 1 .

4.6 Second Order Recursions