A Sequence Problem Lee Bradley Consider the sequence (0, 3, 18, 69, 228, 711...) Find a recursive equation for the terms and a closed form solution for the nth term. It's interesting to try to figure out what the patterns are in such things. I saw that the numbers were all divisible by 3 and that each term was, roughly, 3 times the term that preceded it. So, to begin, I wrote things like
18 = 3(3) + 9 Then I saw that the number I had to add was itself divisible by 3.
18 = 3(3) + 3(3) Then I "saw it!" The recursive equation xn+1 = 3(xn) + 3(2n - 1) with x1 = 0 can be seen to generate the sequence. This equation can also be written xn+1 - 3(xn) = 3(2n - 1). This is an example of an inhomogeneous difference equation. Techniques for solving such equations parallel those for solving inhomogeneous differential equations. Let's see if a particular solution which has the form pn = A + Bn can be found. pn+1 = A + B(n+1) = 3(A + Bn) + 6n - 3 A + Bn + B = 3A + 3Bn + 6n - 3 Equating constant and variable terms A + B = 3A - 3 B = 3B + 6 And solving B = -3 A = 0 So pn = -3n. It can be proved that if pn is a particular solution to the equation xn+1 = axn + bn where bn is a function of n then can + pn is also a solution. In our case, a = 3. We evaluate c from the condition x1 = 0. c3 - 3 = 0 which implies c = 1. A closed form solution is thus xn = 3n - 3n. The first few terms of the sequence are
The above is generated using JavaScript. JavaScript can't handle integers larger than about 332. If you want to see the 999th and the 99999th terms, visit http://primepuzzle.com/tunxis/large-numbers.html! A screenshot of x.tc which computes this sequence using both the recursive and closed form methods follows. This is a program in tiny-c, a C-like language.
|