Prove that a function is not a perfect square? [duplicate]

Let $(a_n)$ be a sequence of positive integers defined by

$a_n=[n+\sqrt{n}+\frac{1}{2}]$

Show that a natural number $m$ doesn't occur in the sequence iff it is a square.


The observations that you should make are

  1. The square root is an increasing function. Thus for $f(n)=n+\sqrt n+\frac12$ we have $$f(n+1)>f(n)+1.$$ Consequently $a_{n+1}>a_n$ for all $n$.
  2. We have $(m-\frac12)^2=m^2-m+\frac14$. Therefore $m-1<\sqrt{m^2-m}<m-\frac12$ and thus $$a_{m^2-m}=\left[(m^2-m)+\sqrt{m^2-m}+\frac12\right]=m^2-1.$$
  3. Similarly $m>\sqrt{m^2-m+1}>m-\frac12$, so $$a_{m^2-m+1}=\cdots m^2+1.$$
  4. Therefore $a_n\neq m^2$ for all $n,m$.
  5. We have $a_{m^2}=m^2+m$, so in view of item 1 exactly $m$ of the integers in the range $[1,m^2+m]$ are missing from the sequence. In view of item 4 we know what those are. Here $m$ is arbitrary so we are done.