taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.8-39

Exercise 1.2.8-39

not stated yet in Lean solution written

RatingM24
MarkersM (mathematical)
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.8 of Volume 1. Companion chapter: Fibonacci numbers

The task

Find a closed form for a0=0a_0 = 0, a1=1a_1 = 1, an+2=an+1+6ana_{n+2} = a_{n+1} + 6a_n.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Look for solutions of the form an=rna_n = r^n and find rr from the quadratic that you get.

Hint 2

Combine the two solutions to fit a0a_0 and a1a_1.

Solution

Show the solution

Try an=rna_n = r^n. The rule gives rn+2=rn+1+6rnr^{n+2} = r^{n+1} + 6r^n, so r2−r−6=0r^2 - r - 6 = 0 and (r−3)(r+2)=0(r - 3)(r + 2) = 0. The roots are 33 and −2-2. Since the rule is linear, an=A 3n+B(−2)na_n = A\,3^n + B(-2)^n is a solution for all constants AA, BB. The start values give A+B=0A + B = 0 and 3A−2B=13A - 2B = 1. So A=1/5A = 1/5 and B=−1/5B = -1/5, and

an=3n−(−2)n5.a_n = \frac{3^n - (-2)^n}{5}.

The sequence is determined by a0a_0 and a1a_1, so this is the only solution.

Check

The rule gives an=0,1,1,7,13,55,133a_n = 0, 1, 1, 7, 13, 55, 133. The formula gives for n=2n = 2: (9−4)/5=1(9 - 4)/5 = 1, n=3n = 3: (27+8)/5=7(27 + 8)/5 = 7, n=4n = 4: (81−16)/5=13(81 - 16)/5 = 13, n=5n = 5: (243+32)/5=55(243 + 32)/5 = 55.

Remarks

For the rule an+2=an+1+ana_{n+2} = a_{n+1} + a_n the same method gives the Binet formula. The roots 33 and −2-2 here are the roots of r2=r+6r^2 = r + 6. If the quadratic has a double root rr, the second solution is nrn−1nr^{n-1} instead of a second power.

This solution is checked, and a person has not reviewed it yet. The source.

In Lean

not stated yet The exercise is not stated in Lean yet.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.