The linear combinations $\lfloor x \rfloor - 2 \lfloor \frac{x}{2} \rfloor$ and $\lfloor x \rfloor - \lfloor \tfrac{x}{2} \rfloor - \lfloor \tfrac{x}{3} \rfloor - \lfloor \tfrac{x}{5} \rfloor + \lfloor \tfrac{x}{30} \rfloor$ can be shown to take values only in $\{ 0, 1 \}$, where $\lfloor \cdot \rfloor$ denotes the floor function.
I'd like to compute arbitrarily long linear combinations of this type, namely, $\sum_{k = 0}^{n} a_k \lfloor b_k x \rfloor$, where $a_k, b_k \in \mathbb{Q}^{\times}$. It is necessary but not sufficient that the sequence $\{a_k, b_k \}$ satisfy the condition $\sum_{k = 0}^{n} a_{k} b_k = 0$. Perhaps I'm missing something simple, but I don't quite see a general method of generating such functions beyond a brute force (and time consuming) search.