<s>[INST] Values of $n$ for which $\lfloor 2 x\rfloor +\lfloor 4 x\rfloor +\lfloor 8 x\rfloor +\lfloor 20 x\rfloor =n$ has a solution $$\lfloor 2 x\rfloor +\lfloor 4 x\rfloor +\lfloor 8 x\rfloor +\lfloor 20 x\rfloor =n$$
How would you find the values of $n$ for which the equation has a solution under the condition that $n \leq 500$? I haven't really worked with equations involving floors before.
 [/INST] Let's make a change of variables, that $x \mapsto \tfrac{x}{40}$, so our new function reads:
$$ f(x) = \lfloor \tfrac{x}{20} \rfloor +
\lfloor \tfrac{x}{10} \rfloor +
\lfloor \tfrac{x}{5}\rfloor +
\lfloor \tfrac{x}{2}  \rfloor $$
This is the sum of 4 step functions and we notice this function behaves kind of like a line:
$$
\begin{array}{ccc} 
f(x + 40) &=& 
\lfloor \tfrac{x + 40}{20} \rfloor +
\lfloor \tfrac{x + 40}{10} \rfloor +
\lfloor \tfrac{x + 40}{5}\rfloor +
\lfloor \tfrac{x + 40}{2}  \rfloor  \\\\
&=& 
(\lfloor \tfrac{x}{20} \rfloor + 2)+
(\lfloor \tfrac{x + 40}{10} \rfloor + 4)+
(\lfloor \tfrac{x + 40}{5}\rfloor  + 8)+
(\lfloor \tfrac{x + 40}{2}  \rfloor  + 20) \\\\
&=& \lfloor \tfrac{x}{20} \rfloor +
\lfloor \tfrac{x }{10} \rfloor +
\lfloor \tfrac{x }{5}\rfloor +
\lfloor \tfrac{x }{2}  \rfloor + 34 \\\\
&=& f(x) + 34
\end{array}
$$

Notice how the jumps are distributed like the lines on a ruler:

Here is a list of the values they obtain with some repetitions
0,  0,  1,  1,  2,  3,  4,  4,  5,  5,  8,  8,  9,  9, 10, 11, 12,
12, 13, 13, 17, 17, 18, 18, 19, 20, 21, 21, 22, 22, 25, 25, 26, 26,
27, 28, 29, 29, 30, 30

</s>