Find the number of positive integers $n < 2007$ such that $\Big[\frac{n}{2}\Big]$ + $\Big[\frac{n}{3}\Big]$ + $\Big[\frac{n}{6}\Big] = n$ .

ceiling-and-floor-functionslinear algebranumber theoryproblem solving

Find the number of positive integers $n < 2007$ such that $\Big[\frac{n}{2}\Big]$ + $\Big[\frac{n}{3}\Big]$ + $\Big[\frac{n}{6}\Big] = n$ . ($[]$ denotes the floor function)

What I Tried: Till now I am not able to find any good ideas on how to attack this problem. For example the LHS is an integer, and so will be the RHS, but it is of no use as it is alreadt mentioned we need to find positive integers $n$ .

Next, assume $n = 6k + a$ for $k \in \mathbb{N}$ and $0 \leq a < 6$ .
Then the equation becomes :-
$$3k + \Big[\frac{a}{2}\Big] + 2k + \Big[\frac{a}{3}\Big] + k = 6k + a$$
$$\rightarrow 6k + \Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] = 6k + a$$
$$\rightarrow \Big[\frac{a}{2}\Big] + \Big[\frac{a}{3}\Big] = a $$

Can anyone help me after this?

Best Answer

Note that the floor function satisfies the inequality $$[x] \le x$$ and equality holds if and only if $x$ is an integer. Now $$n = \left[ \frac{n}{2} \right]+\left[ \frac{n}{3} \right]+\left[ \frac{n}{6} \right] \le \frac{n}{2} + \frac{n}{3} + \frac{n}{6} =n$$ This shows that the three fractions must be integers.

Can you conclude from here?