Given the iterative formula:

*x*_{n+1} = sqrt(*x*_{n}) + *a*

There are some values of *a* for which a positive starting value for *x* results in this formula converging to an integer.

For example, if *a* = 2, you would observe that *x*_{n+1} = sqrt(*x*_{n}) + 2 eventually converges to 4 for any positive starting value.

What form must *a* take in order for this formula to converge to an integer?

#### Solution

*a* must be in the form *b* (*b* – 1) where *b* is an integer.

- Assuming a limit L exists, let
*x*_{n+1}=*x*_{n}= L at the limit. - Substituting back into the iterative formula, L = sqrt(L) +
*a* - To solve for L, evaluate to:
- sqrt(L) = L –
*a* - L = L
^{2}– 2*a*L + a^{2} - L
^{2}– (2*a*+ 1) L + a^{2} - L = ((2
*a*+ 1) +/– sqrt(4*a*+ 1)) / 2

- sqrt(L) = L –
- For L to be an integer, 4
*a*+ 1 has to be a perfect square- Note: division by 2 is not an issue, because 2
*a*+ 1 is odd and sqrt(4*a*+ 1) is odd whenever it is an integer, so their sum will always be even.

- Note: division by 2 is not an issue, because 2
- So 4
*a*+ 1 =*k*^{2}means*k*must be odd. So let*k*= 2*b*– 1. - 4
*a*+ 1 = (2*b*– 1)^{2}, so*a*must take the form*b*(*b*– 1)