$$\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.


First we will analyse the "simpler" function $\lfloor 2 x\rfloor +\lfloor 4 x\rfloor +\lfloor 8 x\rfloor$. To do this we will look at the jump points (the points where the function "jumps"). These occur at points of the form $\frac{k}{8}$ with $k$ an integer. We shall look at how much the function jumps depending on $k$. If $k$ is a multiple of $4$ then the function jumps by $2$. If $k$ is a multiple of $2$ but not of $4$ then it jumps by 2, and if $k$ is not a multiple of 2 it jumps by $1$. So if we add the first few jumps (starting at evaluating the function at $k=0$ we get:
$0$
$0+1=1$( the first jump, when $k=1$)
$1+2$ (the second jump, when $k=2$)
$3+1$ (the third jump, when $k=3$)
$4+3$ (the fourth jump, when $k=4$)
After this the magnitude of the jumps will continue to cycle. Therefore for this function $n$ has a solution if and only if $n$ leaves residue $0,1,3$ or $4$ when divided by $7$
Now let us look at the behaviour of the function $\lfloor \frac{x}{20} \rfloor$. Clearly this one jumps at points of the form $\frac{l}{20}$ when $k$ is an integer and jumps one at each point.
So now we can put both of these together by looking at jumps of the form $\frac{m}{40}$ Under the jumps for the first part of the function are the same as before. and the jumps for the second part only occur when $m$ is a multiple of $2$. Therefore we can make a new rule: if $m$ We divide into two cases: if $m$ is a multiple of $2$ but not of 5: add 1. The next case is when $m$ is a multiple of $5$:if $m$ is not a multiple of $2$ add 1,if $m$ is a multiple of $2$ but not of $4$ add $3$, if $m$ is a multiple of $4$ add $4$. So calculating the first 40 values we get: $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, 34$
So $n$ has a solutionf if and only if it leaves one of those residues when divided by $34$