Let

\[f(x) = \left\lfloor\frac{2 - 3x}{2x + 8}\right\rfloor.\]
Evaluate $f(1)+f(2) + f(3) + \dots + f(999)+f(1000).$ (This sum has $1000$ terms, one for the result when we input each integer from $1$ to $1000$ into ${}f$.)

1 answer

The expression inside the floor function simplifies as follows:
\begin{align*}
2 - 3x &= 2 - 2(x + 4) \\
&= 2\left(1 - (x + 4)\right) \\
&= -2 (x + 4 - 1) \\
&= -2 (x + 3).
\end{align*}Using the fact that $\lfloor a - b \rfloor = \lfloor a \rfloor - \lceil b \rceil$ for integers $a$ and $b$, and that $\lceil b - a \rceil = -\lfloor a - b \rfloor$ for integers $a$ and $b$, we have
\begin{align*}
f(x) &= \left\lfloor\frac{2 - 3x}{2x + 8}\right\rfloor \\
&= \left\lfloor\frac{-2(x + 3)}{2(x + 4)}\right\rfloor \\
&= \left\lfloor\frac{-x - 3}{x + 4}\right\rfloor \\
&= -\left\lfloor\frac{x + 3}{x + 4}\right\rfloor \\
&= -\left\lceil\frac{x + 3}{x + 4}\right\rceil \\
&= -\left\lceil 1 - \frac{1}{x + 4}\right\rceil \\
&= -\left(1 - \left\lfloor \frac{1}{x + 4} \right\rfloor\right).
\end{align*}The only time when $\frac{1}{x + 4}$ is an integer is when $x + 4 = 1,$ or $x = -3.$ We want to evaluate
\[f(1) + f(2) + \dots + f(1000),\]which contains the term $f(-3),$ so we cannot substitute $x = -3.$ So, we consider the integers $x$ from $1$ to $1000,$ excluding $-3.$

If $2 \le x \le 999,$ then the floor function subtracts $1$ from $\frac{1}{x + 4},$ so $\left\lfloor \frac{1}{x + 4} \right\rfloor = \frac{1}{x + 4} - 1.$ Thus,
\[f(x) = -\left(1 - \left\lfloor \frac{1}{x + 4} \right\rfloor\right) = -\left(1 - \frac{1}{x + 4} + 1\right) = \frac{1}{x + 4}.\]If $x = 1,$ then $f(1) = \frac{1}{5},$ and if $x = 1000,$ then $f(1000) = \frac{1}{1004},$ so
\[f(1) + f(2) + \dots + f(999) + f(1000) = \frac{1}{5} + \frac{1}{6} + \dots + \frac{1}{1004}.\]This telescopes as
\begin{align*}
\frac{1}{5} + \frac{1}{6} + \dots + \frac{1}{1004} &= \left( 1 - \frac{1}{6} \right) + \left( \frac{1}{6} - \frac{1}{7} \right) + \dots + \left( \frac{1}{1004} - \frac{1}{1005} \right) \\
&= 1 - \frac{1}{1005} = \frac{1005 - 1}{1005} = \boxed{\frac{1004}{1005}}.
\end{align*}