Given $n$ pairwise coprime natural numbers $m_{1}, \dots, m_{n}$ with remainders $y_{i}$, for all $i \leq n$. Furthermore, we have a target interval $I := \left[ a, b \right]$, with $1 \leq a < b \leq M$, $M := \prod_{i = 1}^{n} m_{i}$.
The task is, to find all tuples $T := \left(y_{1}, \dots, y_{n}\right)$ such that
$$ \exists \ x \in I, \forall i \in [1:n], x \equiv y_{i} \mod m_{i}. $$
- Does exist a way to find all $T$'s apart from trivial cases like $I = [1, M]$ or brute forcing?
- Or as even harder task: Does exist a way to find all $T$'s if you limit the set of allowed remainders? (Like, in our example for $m_{2} = 5$, for example only allow the remainders $y_{2}$ to be $\{ 1, 3 \}$.)
Edit:
Since the problem seems to be not clear for everybody, I want to give an example.
Be $m_{1} = 3$, and $m_{2} = 5$, so we have possible remainders $y_{1} \in \{ 0, 1, 2 \}$, and $y_{2} \in \{ 0, 1, 2, 3, 4 \}$.
It follows the two equations
$$ x = 3k_{1} + y_{1}\\ x = 5k_{2} + y_{2}, $$
with $k_{1}, k_{2} \in \mathbb{N}_{0}$. Assuming now, we only want $x$ in the interval $I := \left[ 8, 10\right]$.
This $x \in I$ can be written as
$$ x = 8 = 3\cdot 2 + 2 = 5\cdot 1 + 3\\ x = 9 = 3\cdot 3 + 0 = 5\cdot 1 + 4\\ x = 10 = 3\cdot 3 + 1 = 5\cdot 2 + 0 $$
So, we get the tuples $T_{1} = \left(2, 3\right)$, $T_{2} = \left(0, 4\right)$ and $T_{3} = \left(1, 0\right)$.