# Is $\lfloor2\sqrt{n-\lfloor \sqrt{n} \rfloor}\rfloor <\lfloor2\sqrt{n} \rfloor$ true for $n\geq 0$?

I have reasons to believe that $$\lfloor2\sqrt{n-\lfloor \sqrt{n} \rfloor}\rfloor <\lfloor2\sqrt{n} \rfloor$$ for $$n\geq 0$$. How could I go about proving (or disproving) this?

• I am afraid, you have accepted the answer too earlier. All you have to do is to change $<$ with $\leq$. – rtybase Apr 2 at 8:51
• Did you even try $n=0$ !? – Yves Daoust Apr 2 at 9:51

You could start by checking the inequality for small values of $$n$$. You would find that it is false already for $$n=2$$.

• For $n=2$ LHS=RHS, it's a corner case, other than that, it seems true – rtybase Apr 2 at 8:46
• @rtybase: there are infinitely many equalities. See my answer. – Yves Daoust Apr 2 at 9:24
• @YvesDaoust, yes, true ... I am not sure if that's what OP was after (strict $<$ or $\leq$). $n=0$ is easier to check than $n=2$. – rtybase Apr 2 at 9:33
• @rtybase: non strict is immediate. – Yves Daoust Apr 2 at 9:36
• @rtybase: I don't think so. You are hypothesizing that the question could be with $\le$. But as its stands, there is no ambiguity: it is wrong. The OP should indeed have observed that it doesn't work with $n=0$ (which he willingly included in the domain). – Yves Daoust Apr 2 at 9:42

$$\lfloor2\sqrt x\rfloor$$ is a non-decreasing function so it is obvious that

$$\left\lfloor2\sqrt{n-\lfloor\sqrt n\rfloor}\right\rfloor\le \lfloor2\sqrt n\rfloor$$ holds.

The interesting cases are equality, i.e. $$\left\lfloor2\sqrt{n-\lfloor\sqrt n\rfloor}\right\rfloor=\lfloor2\sqrt n\rfloor.$$

The function $$\lfloor2\sqrt x\rfloor$$ remains the constant $$m$$ for

$$m^2\le4n\le(m+1)^2-1.$$

So we need

$$m^2\le 4(n-\lfloor\sqrt n\rfloor)\le m^2+2m.$$

As $$\left\lfloor\frac m2\right\rfloor\le\lfloor\sqrt n\rfloor\le\left\lfloor\frac {\sqrt{m(m+2)}}2\right\rfloor,$$ by addition and taking the tightest bounds,

$$m^2+4\left\lfloor\frac m2\right\rfloor\le 4n\le m^2+2m,$$ which is not void for even $$m$$.

Every $$m=2k$$, i.e. $$n=k(k+1)$$ makes the equality, as

$$k(k+1)-\left\lfloor\sqrt{k(k+1)}\right\rfloor=k^2$$ and

$$\left\lfloor2\sqrt{k(k+1)}\right\rfloor=\left\lfloor2\sqrt{k^2}\right\rfloor=2k.$$

There are no other solutions.

• Nice answer! (+1) ... to a badly formulated question – rtybase Apr 2 at 9:41
• @rtybase: I was fearing that the inequalities couldn't be sorted out. But in the end it worked. – Yves Daoust Apr 2 at 9:45

Hint. It is true if you replace $$<$$ with $$\leq$$ and use the fact that

Proposition. If $$x\leq y \Rightarrow \lfloor x \rfloor \leq \lfloor y \rfloor$$

From that proposition, $$\forall n\geq 0$$ $$0\leq2\sqrt{n-\lfloor \sqrt{n} \rfloor} \leq 2\sqrt{n} \iff \lfloor \sqrt{n} \rfloor \geq 0$$ and as a result

$$\lfloor2\sqrt{n-\lfloor \sqrt{n} \rfloor}\rfloor \leq\lfloor2\sqrt{n} \rfloor$$