This recursive sequence seems to converge to 2. On the 53rd iteration of an, an finally gets close enough to 2 so that there is a roundoff error where an = 2.0 instead of a real number that is something like 1.9999999… The sequence is bounded by 1.5 ≤ an < 2 and is infinitely increasing. This sequence approaches 2 quite slowly as it takes 53 iterations for the roundoff error to be small enough for python to round an to 2. The initial condition makes it so that the sequence increases infinitely and converges to 2. For all other values of a1, if a1 is equal to 2, an= 2 for all an, n = 1, 2, 3, … , to infinity. If a1 is greater than 2, the sequence will decrease infinitely and converge to 2. If a1 is less than 2, the sequence will increase infinitely and converge to 2.
an is never going to be greater or equal to 2 when a(1) = 1 because no matter how close an gets to 2, it will always be 1.99999… and then 1.99999…/2 is less than 1. Then a number really close to 1, but still less than 1, plus 1 is only still really close to 2.
This recursive sequence reminds me of fixed point iterations I learned in numerical analysis this year. When a(1) = 2, we get 2 in return for all an, n greater than or equal to infinity.
Below is some code I wrote in order to find out if the recursive sequence converges.
I tested to see the number of for loops so that I could see how slowly or quickly an converges. Compared to some other sequences, I believe this one converges pretty quickly. This reminds me of the function e^x where the function will converge if x is less than or equal to 1 and diverge if x is greater than 1.
Below is an array of the iterations of an, n = 1, 2, 3, … , 61.
We can see what an is with each iteration that an gets closer and closer to 2 until python’s roundoff error results in an output of 2.0 for an. Then from what we know from a fixed point iteration, for this sequence, an input of 2 will output a value of 2 for an, n is equal to 1 to infinity. The same is for the python program, since the error makes a(54) = 2.0, an will equal 2 for n = 55, 56, 57, …, to infinity. We know that this is not actually the case though because an is infinitely increasing and is only approaching 2.
Below is a graph of a(n+1) =a(n)/2 +1, a(1) =1.
It is clear that this sequence converges to 2 from this plot.
There was not really anything hard about this exercise. Coding up some lines for this recursive sequence was quite easy and even trying to figure out how many iterations it took for an to converge close enough to 2 for python to have a roundoff error was easy.