# Solving an equation with floor function

I need some help regarding this question.

Solve the following equation in natural number $x$, where $m,k$ are fixed naturals:

$m\left\lfloor \sqrt{\dfrac{x}{k}}\right\rfloor = x$.

I think the answer is $x = m\left\lfloor\dfrac{m}{k}\right\rfloor$. But I do not know how to prove this claim.

I would be happy if somebody would help me solve this problem.

Thank you,

Isomorphism

-

Since $x$ must be a multiple of $m$, write $x=my$. Then the equation becomes $$y=\left\lfloor\sqrt{\frac {my}k}\right\rfloor$$ and equivalent to $$y\le \sqrt{\frac {my}k}<y+1,$$ i.e. $$y^2\le \frac {my}k <y^2+2y+1$$ or (using $y\ne 0$, though in fact $x=0$ is a trivial solution) $$y\le \frac {m}k <y+2+\frac1y\le y+3.$$ Therefore $y=\left\lfloor \frac mk\right\rfloor$, $y=\left\lfloor \frac mk\right\rfloor-1$, and in rare cases $y=\left\lfloor \frac mk\right\rfloor-2$ are the solutions - the latter only if $m\ge 3k$ and $\frac mk-\left\lfloor \frac mk\right\rfloor<\frac 1{\left\lfloor \frac mk\right\rfloor-2}$.