How to find first multiple of number in a range that isn't also a multiple of 2 or 3? Given a range of integers $[x, x+1, x+2, ... y]$ one could find the first term that is a multiple of $k$ by doing $floor(\frac{x}{k}) \times k$. If it's less than $x$, add $k$. Assume $k$ is prime.
How can one find the first term that is a multiple of $k$ that is not a multiple of 2 nor 3?
For example in $[110,111,112,113,118,119,120]$ how do you find the first term that's a multiple of $7$ but not 2 nor 3? $floor(\frac{110}{7}) \times 7=105$ which is less than the starting range so add $7$ to get $112$. But $112$ is no good because $2|112$. What we want is $119$ since it meets the criteria a) is divisible by 7  b) not a multiple of 2 c) not a multiple of 3
Another example $[10, 11, 12,...,20]$ we want to find first multiple of 5 that isn't a multiple of 2 or 3. The answer would be 20.
Is there a good way of doing this or is a linear search pretty much the only option?
 A: 
Given a range of integers $[x, x+1, x+2, ... y]$ one could find the first term that is a multiple of $k$ by doing $floor(\frac{x}{k}) \times k$

Not true. As your example later shows, $\left\lfloor\frac{x}{k}\right\rfloor\cdot k$ can be smaller than $x$ (and indeed, it is always smaller or equal to $x$, and equal only when $x$ is a multiple of $k$). To find the first term that is a multiple of $k$, if it even exists, you would have to replace the floor with the ceil.

Now to your main question.
In general, the first term that is a multiple of $k$ that is not a multiple of $2$ nor $3$ does not exist, since $k$ could itself be a multiple of $2$ or $3$. But let's focus on the case when $k$ is not divisible by $2$ and $3$.
In particular, take a look at your example $110,111, \dots, 120]$. If you divide the first number by $7$ and then ceil it, you get $$\left\lceil \frac{110}{7}\right\rceil = 16$$
$16$ is dividible by $2$, so you can be sure that $16\cdot 7$ will also be divisible by $2$. What you need now is to find the smallest number above $16$ that is not divisible by either $2$ or $3$. Looking at the number mod $6$ should get you where you need to be, since, mod $6$, you want the number to be either $1$ or $5$ (you don't want it to be $0$, $2$, $3$ or $4$ because those all imply the number is divisible by $2$ or $3$ or both).
A: Assuming of course that $k$ is not itself a multiple of $2$ or $3$, the fastest way is to calculate $n=\lceil x/k\rceil$ – $nk$ is the first multiple of $k$ in the range – and then compute $n\bmod6$. Depending on the residue, add a number $d$ to $n$ to make it not a multiple of $2$ or $3$:
$$\begin{array}{c|c}
n\bmod6&d\\
\hline
0&1\\
1&0\\
2&3\\
3&2\\
4&1\\
5&0\end{array}$$
Then $(n+d)k$ is the smallest multiple of $k$ within range not divisible by $2$ or $3$, assuming that it's not greater than $y$.
A: First, to find the first multiple of $k$, the answer is not $\lfloor \frac{x}{k} \rfloor \cdot k$, but $\lceil \frac{x}{k} \rceil \cdot k$. The former does not lie in the range (except when $k$ divides $x$). Next, to find the minimum value in the range that is divisible by $k$, but not by $2$ nor $3$, we may take $2 \nmid k$ and $3 \nmid k$ (else, the condition is impossible to satisfy). Now, we can see that $\lceil \frac{x}{k} \rceil \cdot k$ is the first value divisible by $k$. Since $\gcd(6,k)=1$, we know that the six values:
$$\lceil \frac{x}{k} \rceil \cdot k+kq \quad(0\leqslant k<6)$$
will be distinct modulo $6$. You simply need to check these six numbers and find which one is the first one not divisible by $2$ or $3$ i.e. $1 \bmod{6}$ or $5 \bmod{6}$.
A: Finding lowest unbounded non-negative integer that is solution to set of modular equations could be done by chinese remainder theory with most of comuputation done in compile time for fixed $n_{i}$. $n_{i}$ have to be pairwise coprime.
$
n \equiv r_{0} \pmod{n_{0}}
$
$
n \equiv r_{1} \pmod{n_{1}}
$
...
If you want bounded below by x inclusive you have to substitute for each $r_{i}$ value $r_{i} - x \pmod {n_{i}}$ and add it to x.
