How do I solve $X_n=\lfloor \sqrt{X_n} \rfloor+X_{n-1}$? The initial terms are $1,2,3,5,7,10,13,17,21,26,31$. A search on oeis.org/ gave $\lfloor n/2 \rfloor\cdot\lceil n/2 \rceil$ + 1 which should be proven by induction. Is there a different approach?
-
@MatemáticosChibchas Should be $t-\lfloor \sqrt t \rfloor$. – mrk May 07 '14 at 00:25
-
You are right! sorry. – Matemáticos Chibchas May 07 '14 at 00:26
-
Is this right, or are you computing $X_n$ from $X_{n - 1}$? – vonbrand May 07 '14 at 00:51
-
@vonbrand It's correct as it is. – mrk May 07 '14 at 00:57
-
Why not 1, 2, 4, 6, ..., instead of 1, 2, 3, 5, ...? – Did May 07 '14 at 05:34
-
@Did As long as the equation holds, I don't care what the values are. – mrk May 07 '14 at 09:12
-
Sorry but the matter is quite simple: why are you saying that the sequence starts with 1, 2, 3, 5? – Did May 07 '14 at 11:35
-
I was working on a TopCoder problem called MagicCandy and found out that those are the initial terms. – mrk May 08 '14 at 11:31
1 Answers
The difference equation \begin{align} x_{n} = \lfloor \sqrt{x_{n}} \rfloor + x_{n-1}, \end{align} where $x_{0}=1 $ and $x_{1}=2$ can, upon writing out several terms, ie $x_{2}$, $x_{3}$, $x_{4}$, and so on can the given set of values stated. It is without much difficulty to show that the difference equation for $x_{n}$ can also be seen as \begin{align} a_{n} = a_{n-2} + n \end{align} where $a_{o}=1$ and $a_{2}=2$. The set generated by $a_{n}$ is $a_{n} \in \{ 1,2,3,5,7,10,13,17,21,26,31, \cdots \}$. Now the even and odd values can be considered and yields \begin{align} a_{2n} = n^{2} +1 \end{align} for $n\geq 0$ for the even case and \begin{align} a_{2n+1} = n^{2} + n+1 = n(n+1) + 1 \end{align} for the odd case. From the two cases it can readily be sen that the general result is given by \begin{align} a_{n} = \left\lfloor \frac{n}{2} \right\rfloor \cdot \left\lceil \frac{n}{2} \right\rceil + 1. \end{align}
- 26,329
-
1"It is without much difficulty to show that the difference equation for $x_n$ can also be seen as ...". No doubt about that, but can this be done without using induction? – Matemáticos Chibchas May 07 '14 at 23:18