<s>[INST] Find the thousandth number in the sequence of numbers relatively prime to $105$. 
Suppose that all positive integers which are relatively prime to $105$ are arranged into a increasing sequence: $a_1 ,  a_2 ,  a_3, . . . .$ Evaluate $a_{1000}$

By inclusion exclusion principle I found the following equation:
$n - \left( \left\lfloor \dfrac {n} {3} \right\rfloor + \left\lfloor \dfrac {n} {5} \right\rfloor + \left\lfloor \dfrac {n} {7} \right\rfloor \right) + \left( \left\lfloor \dfrac {n} {15} \right\rfloor + \left\lfloor \dfrac {n} {21} \right\rfloor + \left\lfloor \dfrac {n} {35} \right\rfloor \right) - \left\lfloor \dfrac {n} {105} \right\rfloor=1000$
I tried to solve the equation by setting $n=105k+r ; 0 \leq 0<105$.  But this method is so tiring and lengthy to solve. I thought to invoke inequalities like $a-1 <\lfloor a \rfloor \leq a$, but I couldn't do as the equation contains positive as well as negative terms .Please provide me any other method to solve such equations involving floor function. Any help would be appreciated.
 [/INST] The number of integers $n \in \{1,2,3,\dots, 105\}$ that are relatively prime to $105$ is
$$\phi(105) = \phi(3 \times 5 \times 7) = 2 \times 4 \times 6 = 48$$
We know that $\gcd(105A + n, 105) = \gcd(n, 105)$.
Since $1000 = 20\times 48 + 40$, we know that there are $20 \times 48 = 960$ numbers relatively prime to $105$ in the interval $[1, 2100]$ (where $2100 = 20 \times 105$).
$86$ is the $40^{\text{th}}$ number in that range that is relatively prime to $105$.
So the thousandth number relatively prime to $105$ is $2100 + 86 = 2186$.
</s>