Prove that every non-square number is given by the sequence $$a(n) = n + \Big\lfloor \frac 12 + \sqrt n\Big\rfloor$$ where $\lfloor x \rfloor$ represents the greatest integer less than or equal to $x$.
Attempt: Let $n$ be some natural number. Then, we know that up to $n$, there are $\Big\lfloor \sqrt{n}\Big\rfloor$ perfect squares.
That means, the $nth$ non square number will in the range greater than or equal to $n+\Big\lfloor{\sqrt{n}}\Big\rfloor$. But some of the numbers in this range might also turn out to be square numbers! The challenge would be to weed out these square numbers.
Now, for any $n:\Big\lfloor \frac 12 + \sqrt {n}\Big\rfloor$ represents the nearest integer to $\sqrt{n}$. But, still thinking how I can use this result to prove the result above.
Any hints please? Thanks!
The sequence can only skip over an integer between $a(n)$ and $a(n+1)$ if $\Big\lfloor \frac{1}{2} + \sqrt n\Big\rfloor$ increases, i.e., there is some integer $m$ with $$\frac{1}{2} + \sqrt{n}<m\leq \frac{1}{2} +\sqrt{n+1}\text{.}$$ Subtracting $\frac{1}{2}$ and squaring gives $$n<m^2-m+\frac{1}{4}\leq n+1\text{,}$$ whereby $$n\leq m^2-m<n+1,$$ which implies $n=m^2-m$. In this case, since $\sqrt{n+1}-\sqrt{n}\leq 1$ always, we also have $$\Big\lfloor \frac{1}{2} + \sqrt n\Big\rfloor=m-1$$ and $$\Big\lfloor \frac{1}{2} + \sqrt{n+1}\Big\rfloor=m.$$ Therefore, $$a(n)=n+\Big\lfloor \frac{1}{2} +\sqrt{n}\Big\rfloor=m^2-m+m-1 = m^2-1,$$ and $$a(n+1)=n+1+\Big\lfloor \frac{1}{2} +\sqrt{n+1}\Big\rfloor=m^2-m+1+m=m^2+1,$$ so only $m^2$ is skipped.
Therefore, since the sequence certainly increases without bound, and begins with the first non-square number $a(1)=2$, it must hit all non-square numbers.