Floor function equations

139 Views Asked by At

Solve $\biggl\lfloor{\dfrac{n^2}{2}}\biggr\rfloor = \Bigl\lfloor{\dfrac{n}{2}}\Bigr\rfloor^2$, where $n$ is an integer.

$\textbf{What I tried:}$

I wrote $$ k^2 \leq \Bigl(\frac{n}{2}\Bigr)^2 < k^2+1+2k, $$ where $k$ is the largest integer less than $\smash{\dfrac{n}{2}}$. Similarly, I wrote $$ k^2 \leq \frac{n^2}{2} < k^2+1 $$ for the LHS of the given equation. I simplified and solved, and got that $k^2 < 1$ and $(k+2)^2 > 2$, but these solutions are do not quite help me find all the answers. Particularly, the answers to the original equation should be $n = 0, 1, -3$.

$\textbf{Where I need help:}$

What would be the inequalities I should write to solve this problem? In general, I struggle with this type of problem where we have an equation with floor functions to solve. What are some general strategies I can implement to solve them?

4

There are 4 best solutions below

1
On

$n$ is an integer, I presume? If so then you'll want to tackle it in cases, those being $n$ even and $n$ odd. If $n$ is even, then it can be written as $2k$ for some integer $k$, and $\lfloor \frac{n^2}{2} \rfloor = \lfloor \frac{4k^2}{2} \rfloor = 2k^2$. Meanwhile, the right side of the equation will be $\lfloor \frac{2k}{2}\rfloor^2 = \lfloor k\rfloor^2 = k^2$. The overall equation will therefore be $2k^2=k^2$ which is true only when $k=0$; since $n=2k$ this means that $n=0$ also, which is one of your solutions.

Next, suppose $n$ is odd; that is, $n=2m+1$ for some integer $m$. Then $\lfloor \frac{n^2}{2}\rfloor = \lfloor \frac{(2m+1)^2}{2}\rfloor =\lfloor \frac{4m^2+4m+1}{2}\rfloor = \lfloor 2m^2+2m+\frac{1}{2}\rfloor = 2m^2+2m$. On the right we have $\lfloor \frac{2m+1}{2}\rfloor^2 = \lfloor m+\frac{1}{2}\rfloor^2 = m^2$. So overall we have $2m^2+2m=m^2$. This implies that $m^2+2m=0$, and factoring out an $m$ yields $m(m+2)=0$; in other words, $m=0$ or $m=-2$. Since $n=2m+1$, this gives us $n=2(0)+1=1$ and $n=2(-2)+1=-3$ as solutions, which were the other two you were given.

In summary: no inequalities required, at least when dealing with integers. In such cases, even-odd arguments will always suffice.

3
On

Let $$k:=\left\lfloor\frac n2\right\rfloor.$$ On one hand, $$n=2k\text{ or }2k+1.$$ On the other hand, the equation $\left\lfloor\frac{n^2}2\right\rfloor= \left\lfloor\frac n2\right\rfloor^2$ becomes $\left\lfloor\frac{n^2}2\right\rfloor=k^2$, i.e. $$n^2=2k^2\text{ or }2k^2+1.$$

  • If $n=2k$ then $(n^2=2k^2\text{ or }2k^2+1)\iff 4k^2=2k^2\iff k=0\iff n=0.$
  • If $n=2k+1$ then $(n^2=2k^2\text{ or }2k^2+1)\iff 4k^2+4k+1=2k^2+1\iff k=-2\text{ or }0\iff n=-3\text{ or }1.$

Edit. The following is a more elaborate solution for your new more general question about the real solutions $n.$ Let again $$k:=\left\lfloor\frac n2\right\rfloor.$$ On one hand, $$2k\le n<2k+2,$$ i.e.

  • either (first case) $$k\ge0\text{ and }n\ge0\text{ and }4k^2\le n^2<4(k+1)^2,$$

  • or (second case) $$k\le-1\text{ and }n<0\text{ and }4(k+1)^2<n^2\le4k^2.$$ On the other hand, the equation $\left\lfloor\frac{n^2}2\right\rfloor= \left\lfloor\frac n2\right\rfloor^2$ becomes $$2k^2\le n^2<2k^2+2.$$ Let us analyze the conjunction of this second inequation with each of the two cases above.

  • First case: $k\ge0.$ $$4k^2\le n^2<2k^2+2\implies k^2<1\implies k=0,$$ and the conjunction of the two inequations (together with $n\ge0$) then boils down to $$0\le n<\sqrt2$$ (with two integer solutions: $n=0$, $n=1$).

  • Second case: $k\le-1.$ $$4(k+1)^2\le n^2<2k^2+2\implies (k+2)^2<3\implies k\in\{-3,-2,-1\}$$ and the conjunction of the two equations then boils down to the second one, i.e. (together with $n<0$) :

    • for $k=-3$: $$-\sqrt{20}<n\le-\sqrt{18}$$ (no integer solution)
    • for $k=-2$: $$-\sqrt{10}<n\le-\sqrt8$$ (one integer solution: $n=-3$)
    • for $k=-1$: $$-2<n\le-\sqrt2$$ (no integer solution).

To summarize, the set of real solutions $n$ is $$(-\sqrt{20},-\sqrt{18}]\cup\cup(-\sqrt{10},-\sqrt8]\cup(-2,-\sqrt2]\cup[0,\sqrt2).$$

0
On

If we examine the cases from $\,-1\le n\le 4\,$ we can see that $\,(-3,0,1)\,$ are solutions and that the results get farther apart outside of this range.

\begin{cases} n &&\dfrac{n^2}{2} &\bigg\lfloor\dfrac{n^2}{2}\bigg\rfloor &\bigg(\dfrac{n}{2}\bigg)^2 &\bigg\lfloor\dfrac{n}{2}\bigg\rfloor^2\\ \\-4&&\,\,8&\quad8&\quad4&\quad4 \\-3&&\,\,4.5&\quad4&\quad2.25&\quad4 \\-2&&\,\,2&\quad2&\quad1&\quad1 \\-1&&\,\,2&\quad2&\quad1&\quad1 \\0&&\,\,0&\quad0&\quad0&\quad0 \\1&&\,\,0.5&\quad0&\quad0.25&\quad0 \\2&&\,\,2&\quad2&\quad1&\quad1 \\3&&\,\,4.5&\quad4&\quad4.5&\quad4 \\4&&\,\,8&\quad8&\quad4&\quad4 \end{cases}

0
On

$$\lfloor\frac{{n}}{\mathrm{2}}\rfloor^{\mathrm{2}} =\lfloor\frac{{n}^{\mathrm{2}} }{\mathrm{2}}\rfloor=\lfloor\mathrm{2}\left(\frac{{n}}{\mathrm{2}}\right)^{\mathrm{2}} \rfloor=\mathrm{0} \\ $$ $$\frac{{n}}{\mathrm{2}}=\frac{{n}^{\mathrm{2}} }{\mathrm{2}}=\left[\mathrm{0};\mathrm{1}\right) \\ $$ $${n}=\left[\mathrm{0};\mathrm{2}\right)\cap\left(\left(-\sqrt{\mathrm{2}};\mathrm{0}\right]\cup\left[\mathrm{0};\sqrt{\mathrm{2}}\right)\right) \\ $$ $${n}=\left[\mathrm{0};\sqrt{\mathrm{2}}\right) \\ $$