# Proving an equality with floor functions

I have a certain equation derived from another problem I was solving that includes floor functions. By plugging in different values I experimentally find that the following equation is true:

$$\left \lfloor \frac{H-S\left ( \left \lfloor \frac{H-D\left ( K - 1\right ) - 1}{S}+1 \right \rfloor - 1\right ) - 1}{D}+1 \right \rfloor = K$$

Also if I remove the floor functions, I can easily show this equality holds:

$$\frac{H-S\left ( \frac{H-D\left ( K - 1\right ) - 1}{S}\right ) - 1}{D}+1 = \frac{H-\left ( H-D\left ( K - 1\right ) - 1\right ) - 1}{D}+1 = \frac{D(K-1)}{D}+1=K$$

However, I don't think this is a complete proof because it is unclear to me why it is justified to just remove the floor functions. I don't really have experience solving equations with floor functions in them. Does anyone know how I would show this equality holds when not removing the floor functions?

Edit: H, S, D and K are all integers > 0. I don't have guarantees if they are odd or even.

I realize I can simplify the equation a little bit into this: $$\left \lfloor \frac{H-S \left \lfloor \frac{H-D\left ( K - 1\right ) - 1}{S} \right \rfloor - 1}{D} \right \rfloor +1 = K$$

Edit 2: I see now that the problem I was trying to solve is more complicated and there are many parameter combinations for which the equation doesn't hold. The equation might only be provable under certain conditions I think.

• Do yo mean true that this identity looks valid for all values of $H,S,D$ (positive, negative...) ? Oct 13 at 19:50
• Just choose any $K$ not an integer. The left hand side is an integer, the right hand side is not. So obviously you are missing some conditions. Oct 13 at 20:00
• Also, even if these are all integers, this also fails when $H=4$, $S=2$, and $D=K=1$. Oct 13 at 20:02
• @dljve It sounds like you're making some progress on your own. I'll point out that having $\lfloor x\rfloor=k$ is equivalent to $k\leq x<k+1$. This could help simplify, though it'll be more complicated when you incorporate the second floor. Oct 14 at 17:31