Solve the floor function equation $\lfloor2x\rfloor+\lfloor3x\rfloor+\lfloor7x\rfloor=2008$

ceiling-and-floor-functions

So I was yet again looking on Michael Penn's Youtube channel to see if there were any math equations on his channel that I thought that I might be able to solve when I came across this member only video of his that I found interesting (don't worry, I also don't have access to it). The equation on the thumbnail was$$\lfloor2x\rfloor+\lfloor3x\rfloor+\lfloor7x\rfloor=2008$$which I thought that I might be able to solve. Here is my attempt at doing so:$$\begin{align}f(x)=\lfloor2x\rfloor&+\lfloor3x\rfloor+\lfloor7x\rfloor=2008\\&\approx\lfloor x\rfloor(2+3+7)\\&=12\lfloor x\rfloor=2008\end{align}$$Now, dividing by $12$ on both sides gets us$$\lfloor x\rfloor=167+\dfrac23\implies\lfloor\lfloor x\rfloor\rfloor=\lfloor x\rfloor=167\implies x\in[167,168)$$If you're confused on the last bit, it basically means that $x$ must be a number in a set (let's say set $\mathbb A$ for example) that are all numbers in $\mathbb R$ that are greater than $167$ but are less than $168$, with $167$ included in said set.

Now, let $x=a_{n,k}=167+f(n,k)$ where $f(n,k)=\dfrac{n'}{k'},2\leq n\lt k,3\leq k\require{cancel}\cancel\implies\dfrac{\dfrac{df}{dn}}{\dfrac{df}{dk}}$ however it means that any term $n_\alpha$ and $k_\beta$ where $\alpha,\beta$ are in the set of integers (with $\alpha<\beta$). Now let's have there being a set containing all of the prime numbers. (Let's call this set $\mathbb B$) Starting with $\alpha=1,\beta=2$ (so $n_1=2,k_2=3$) we let $\alpha\longrightarrow \beta-1$, and every time we hit $\alpha=\beta-1$, we let $\beta\mapsto\beta+1$ until $167+\dfrac{n_\alpha}{k_\beta}$ is a solution to $f(x)=2008$, so we have$$a_{1,2}\implies x=167+\dfrac23\implies f(x)=2011$$$$a_{1,3}\implies x=167.4\implies f(x)=2007$$$$a_{2,3}\implies x=167.6\implies f(x)=2010$$$$a_{2,4}\implies x=167+\dfrac37\implies f(x)=2008$$Which is actually our lower limit of the solution, as confirmed by Wolfram Alpha. We can actually find our upper limit by allowing $n$ and $k$ to be non-prime numbers (however in the set of natural numbers this time), while still having $n\leq k-1$, starting with $n=1$, $k=2$:$$f(167.5)=200\color{red}{9}\text{ however }\lim_{x\longrightarrow167.5^-}f(x)=2008$$which means the solution is represented by the inequality $\dfrac{1172}7\leq x\lt\dfrac{335}2$, which implies that our solution set is represented by$$x\in\left[\dfrac{1772}7,167.5\right)$$


My question


Is there anyway I could solve this more quickly, or is this already the most efficient solution possible?

Best Answer

The way I would approach it is to observe that in the interval $x \in [0,1)$, the terms $\lfloor 2x \rfloor$, $\lfloor 3x \rfloor$, and $\lfloor 7x \rfloor$ are constant in each subinterval $x \in [\frac{k}{42}, \frac{k+1}{42})$ for each fixed nonnegative integer $k \in \{0, 1, \ldots, 41\}$. For instance, when $k = 25$, then $x \in [\frac{25}{42}, \frac{26}{42})$ satisfies $\lfloor 2x \rfloor = 1$, $\lfloor 3x \rfloor = 1$, and $\lfloor 7x \rfloor = 4$.

So let us write $$x = n + \frac{k}{42}, \quad n \in \mathbb Z,$$ hence $$\begin{align} f(x) &= \lfloor 2x \rfloor + \lfloor 3x \rfloor + \lfloor 7x \rfloor \\ &= 2n + 3n + 7n + \left\lfloor \frac{k}{21}\right\rfloor + \left\lfloor \frac{k}{14}\right\rfloor + \left\lfloor \frac{k}{6}\right\rfloor \\ &= 12n + \left\lfloor \frac{k}{21}\right\rfloor + \left\lfloor \frac{k}{14}\right\rfloor + \left\lfloor \frac{k}{6}\right\rfloor. \end{align}$$ Noting that $k \le 41$, then $$0 \le \lfloor k/21 \rfloor \le 1, \quad 0 \le \lfloor k/14 \rfloor \le 2, \quad 0 \le \lfloor k/6 \rfloor \le 6.$$ So the sum of these terms is bounded below by $0$ and above by $9$; hence $f(x) = 2008$ implies $$166 < \frac{2008 - 9}{12} \le n \le \frac{2008}{12} < 168.$$ Since $n$ is an integer, we require $n = 167$, which in turn means that $k$ must satisfy $$\left\lfloor \frac{k}{21}\right\rfloor + \left\lfloor \frac{k}{14}\right\rfloor + \left\lfloor \frac{k}{6}\right\rfloor = 2008 - 12(167) = 4.$$ If the first term equals $1$, i.e. $k \ge 21$, then the second term is at least $1$ and the third term is at least $3$, which will sum to $5$. So $k \le 20$. So we know the first term must be zero. Then the second term is at most $1$ (since $k \le 20$); so the third term must be at least $3$, which implies $k \ge 18$. This leaves just three candidates which are easily checked; all of them give a sum of $0 + 1 + 3 = 4$. Consequently, the solution set corresponds to

$$x \in \left[167 + \frac{18}{42}, 167 + \frac{21}{42}\right) = \left[\frac{1172}{7}, \frac{335}{2}\right).$$

Related Question