Exercise 28 of Chapter 3(Concrete Mathematics)

219 Views Asked by At

Solve the recurrence
$a_0 = 1$
$a_n = a_{n-1} +\lfloor\sqrt{a_{n-1}}\rfloor,n>0$

I have managed to prove that:

If $a_n = m^2$ for some $m \in N^*$ then we must have
$a_{n+2k+1} =(m+k)^2+ (m-k)$ and $a_{n+2k+2} = (m+k)^2 +2m$,where $0\leqslant k \leqslant m$ (*)

using induction. However,the book also mentions:

The solution can be rewritten in a nice form:
$a_{n-1} = 2^l + $$\lfloor({n-l\over{2}})^2\rfloor$ where $2^l+l\leqslant n < 2^{l+1}+l+1$.

I do spot out the pattern of $a_n$:the sequence of $a_n,a_{n+1},...,a_{n+2m}$ described by (*) is followed by $a_{n+2m+1}=(2m)^2$,which starts a new similar sequence(with different m and n)

I've tried to understand the equivalence with this idea in mind but still haven't made any progress. Could you provide me with some hints?