# I need to solve one equation, but I dont know how to solve equation with floor functions

Im a student with not such a knowledge to solve equations with floor functions. I want to ask, if it is even possible and if it so, how is possible to prove this equation to be true.

- ⌊(n+m)/G⌋ = ⌊(2g-n-m)/G⌋-1


and where :

  G= b^r
g= b^r - 1


when needed , r and b can be replaced by any natural number

Edit1 : I only need to prove it when G= 2^r and g = 2^r-1 where r is variable

Edit2 : One of the variables, n or m can be fixed.

• What is n,m,a,b,g,G,r? All different variables? There are way too many variables for this to be remotely solvable. – Don Thousand Mar 31 at 13:20
• I already changed it , there are just variables n,m,G and g . But i only need to prove it when G= 2^r and g = 2^r-1 where r is variable – Patrik Bašo Mar 31 at 13:22
• also it is possible to fix one of the variable so for example n=0 – Patrik Bašo Mar 31 at 13:22

If $$G=2^r$$; $$g=2^r-1$$ and $$n+m=k$$ then we have $$- \Big\lfloor\frac{k}{2^r}\Big\rfloor = \Big\lfloor\frac{2^{r+1}-2-k}{2^r}\Big\rfloor-1$$ $$\Big\lfloor\frac{k}{2^r}\Big\rfloor+\Big\lfloor\frac{2^{r+1}-2-k}{2^r}\Big\rfloor=1$$ $$\Big\lfloor\frac{k}{2^r}\Big\rfloor+\Big\lfloor2-\frac{k+2}{2^r}\Big\rfloor=1$$ As $$k\gt0$$ we need one of the floor expressions to evaluate to $$0$$ and the other evaluate to $$1$$ in order for this to be true. This occurs when $$2^r\le k\le2^{r+1}-2$$ So a valid solution is any values of $$n,m$$ such that $$G\le n+m\le2g$$ If you fix one of the variables, for example $$n=0$$ then we have a range of solutions $$G\le m\le2g$$