Let $f(n) = n + \lfloor \sqrt{n} \rfloor$. Prove that for every positive integer $m$, the integer sequence $m, f(m), f(f(m)), \dots$ contains at least one square of an integer.
Problem
Source: 2018 Pan-African Shortlsit - A7
Tags: algebra, number theory, Iteration, Integer sequence
06.05.2019 17:51
I think this has been posted very recently on aops just cant find it.
06.05.2019 17:58
Consider the sequence of positive integers given by $a_k = f^k(m)$, for $k \geq 0$ and write $a_k = d_k^2 + c_k$, for some positive integer $d_k$ and $0 \leq c_k \leq 2d_k$. It is easy to see that, by the given condition, if $c_k$ is nonzero and not equal to $d_k + 1$ (when $a_{k+1}$ is a perfect square and we're done), either $c_k < c_{k+1}$ or $c_k < c_{k+2}$. Then, the sequence of nonnegative integers $(c_k)_{k \geq 0}$ will hit $0$ at some point, meaning that some $a_k$ is a perfect square, which is exactly what we wanted.
06.05.2019 18:40
Define $g(n)$ to be $n - k^2$, where $k^2$ is the largest square less than $n$. Define $a_n$ to be the $n$th term in the sequence. So, $a_1 = m$ and $a_{n+1} = f(a_n)$. I claim that if $g(a_k) > 0$, then either $g(a_{k+1}) < g(a_k)$ or $g(a_{k+2}) < g(a_k)$. This will quickly prove the desired result. Proof: Suppose that $a_n = c + k^2$, where $k^2$ is the largest perfect square less than $a_n$. Then $a_{n+1} = c + k + k^2$. Now, if $k + c \ge 2k + 1$, then $$g(a_{n+1}) = c - k - 1 < g(a_n) = c$$If $k + c < 2k + 1$, then $a_{n+2} = 2k + c + k^2 = (k+1)^2 + c - 1$, so $$g(a_{n+2}) = c - 1 < g(a_k) = c$$$\blacksquare$