# $\lfloor 2x \rfloor \lfloor 3x \rfloor$ [closed]

From $1$ to $10000$ including both, how many of those integers can be written as:

$$\lfloor 2x \rfloor \lfloor 3x \rfloor$$

Where $x$ is a real number?

## closed as off-topic by Zev Chonoles, Daniel W. Farlow, TravisJ, graydad, Jonas MeyerMay 27 '15 at 3:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Zev Chonoles, Daniel W. Farlow, TravisJ, graydad, Jonas Meyer
If this question can be reworded to fit the rules in the help center, please edit the question.

Let $f(x) = \lfloor 2x \rfloor \lfloor 3x \rfloor$

Important Fact: $\lfloor x \rfloor$ is a function that remains constant, and only changes its value (increases by 1) when $x$ crosses an integer, say $n$.

Therefore $\lfloor 2x\rfloor$ increases when $x$ crosses $\frac{n}{2}$ and $\lfloor 3x \rfloor$ increases when $x$ crosses $\frac{n}{3}$. $\lfloor 2x \rfloor \lfloor 3x \rfloor$ will increase when $x$ crosses $\frac{n}{6}$.

Another important fact: The floor function is neither odd nor even, so we need to take two cases separately : $x$ is non-negative, and $x$ is negative.

Case 1: $x$ is non-negative

Note that when $x$ is an integer $n$, $f$ will be equal to $6n^2$. So all numbers of the form $6n^2$ can be written in this form.

Now let's see how the value of $f$ changes as $x$ varies from $n$ to $n+1$. Since the period of $f$ is $\text{lcm}( \frac{1}{2} , \frac{1}{3}) = 1$, we can be sure that the same pattern will be followed as $x$ goes from $n+1$ to $n+2$.

As we saw above, $f$ only changes when $x$ crosses and integral multiple of $\frac{1}{6}$, we can divide the interval $[n, n+1)$ into $6$ equal intervals.

$$\begin{array}{|l|c|c|c|}\hline \text{Interval} & \lfloor 2x \rfloor & \lfloor 3x \rfloor & f(x) \\\hline \left[n, n + \frac{1}{6}\right) & 2n & 3n & 6n^{2} \\ \left[n + \frac{1}{6}, n + \frac{2}{6}\right) & 2n & 3n & 6n^{2}\\ \left[n + \frac{2}{6}, n + \frac{3}{6}\right) & 2n & 3n + 1& 6n^{2} + 2n\\ \left[n + \frac{3}{6}, n + \frac{4}{6}\right) & 2n + 1& 3n + 1& 6n^{2} + 5n + 1\\ \left[n + \frac{4}{6}, n + \frac{5}{6}\right) & 2n + 1& 3n + 2& 6n^{2} + 7n + 2\\ \left[n + \frac{5}{6}, n + 1\right) & 2n + 1& 3n + 2& 6n^{2} + 7n + 2\\\hline \end{array}$$

We see that there are $4$ distinct values that $f$ takes as $x$ goes from $n$ to $n + 1$ viz. $6n^2, 6n^2 +2n, 6n^2 + 5n + 1, 6n^2 + 7n + 2$.

When $n = 0$, we only get two values - $1, 2$ since we don't want $0$. For all $n > 0$, we get $4$ values, for example for $n = 1$, we get $6, 8, 12$ and $15$. These are the numbers that can be written in the desired form. If we arrange them in ascending order, it is not hard to prove that $f(n) = 6n^2$ will be the $(4n - 1)^{\text{th}}$ term in the sequence.

$1$ is the minimum number in the range of $f$. To find the maximum number less than $10000$, the easiest way would be to find the greatest possible $n$, by setting $6n^2 \leq 10000$.

$$\implies n^2 \leq 1666$$ $$\implies n \leq 40$$ The maximum $n$ is $40$.

Now we check if $f(40 + \frac{5}{6}) < 10000$.

$f(40 + \frac{5}{6}) = 6 \times 40^2 + 7 \times 40 + 2 = 9882 \leq 10000$ which works as well.

We know that $f(40) = 6 \times 40^2 = 9600$ is the $(4 \times 40 - 1)$th term, ie $159$th term. Therefore $9882$ will be the $159 + 3 = 162$th term.

However, we mustn't forget Case 2, in which $x$ is negative.

Case 2: $x$ is negative.

For some negative integer $k$, let $m = k - \frac{1}{2}$. The motivation to do this will become clear shortly. Now let's see how $f$ varies as $x$ goes from $m$ to $m + 1$.

$$\begin{array}{|l|c|c|c|}\hline \text{Interval} & \lfloor 2x \rfloor & \lfloor 3x \rfloor & f(x) \\\hline \left[m + \frac{5}{6}, m\right) & 2k & 3k + 1 & 6k^{2} + 2k\\ \left[m + \frac{4}{6}, m + \frac{5}{6}\right) & 2k & 3k & 6k^{2}\\ \left[m + \frac{3}{6}, m + \frac{4}{6}\right) & 2k & 3k & 6k^{2}\\ \left[m + \frac{2}{6}, m + \frac{3}{6}\right) & 2k - 1& 3k - 1& 6k^{2} - 5k + 1\\ \left[m + \frac{1}{6}, m + \frac{2}{6}\right) & 2k - 1& 3k - 1& 6k^{2} - 7k + 2\\ \left[m, m + \frac{1}{6}\right) & 2k - 1& 3k - 2& 6k^{2} - 7k + 2\\\hline \end{array}$$

Since $k$ is a negative number, we can replace it by $- n$, where $n$ is a positive number. Observe for each $n$, the outputs are now $6n^2 - 2n, 6n^2 , 6n^2 + 5n + 1, 6n^2 + 7n + 2$.

That is, for each $n$, $f(- n)$ has exactly one element in its range $(6n^2 - 2n)$ which is not present in range of $f(n)$, ie a one-to-one correspondence.

Since we calculated $n$ to be $40$ in the previous case, there will be $40$ more numbers which can be written in this form if $x$ is negative.

There are $162 + 40 = 202$ integers from $1$ to $10000$ which can be written as $\lfloor 2x \rfloor \lfloor 3x \rfloor$.

If $n \le x < n+\dfrac{1}{3}$ for some integer $n$, then $\lfloor 2x \rfloor \lfloor 3x \rfloor = 2n \cdot 3n = 6n^2$.
If $n+\dfrac{1}{3} \le x < n+\dfrac{1}{2}$ for some integer $n$, then $\lfloor 2x \rfloor \lfloor 3x \rfloor = 2n(3n+1) = 6n^2+2n$.
If $n+\dfrac{1}{2} \le x < n+\dfrac{2}{3}$ for some integer $n$, then $\lfloor 2x \rfloor \lfloor 3x \rfloor = (2n+1)(3n+1) = 6n^2+5n+1$.
If $n+\dfrac{2}{3} \le x < n+1$ for some integer $n$, then $\lfloor 2x \rfloor \lfloor 3x \rfloor = (2n+1)(3n+2) = 6n^2+7n+2$.
Now, you need to figure out how many integers between $1$ and $10000$ can be written in one of these forms.