I have tried finding the general form but it appears that there is no general form. I could try just brute forcing it but it just is impractical.

PS: please only use the following theorems:

  • Division Algorithm
  • Bezout's Theorem
  • Euclidean Algorithm
  • Euclid Lemma
  • Fundamental Theorem of Arithmetic
  • $\begingroup$ Welcome to Mathematics SE. Take a tour. You'll find that simple "Here's the statement of my question, solve it for me" posts will be poorly received. What is better is for you to add context (with an edit): What you understand about the problem, what you've tried so far, etc.; something both to show you are part of the learning experience and to help us guide you to the appropriate help. You can consult this link for further guidance. $\endgroup$ Mar 19 at 14:57
  • 4
    $\begingroup$ Hint: Think of $n+2$, when $n$ is such integer. $\endgroup$
    – Riemann
    Mar 19 at 15:11
  • $\begingroup$ Same as here, except you have $\,x\equiv -2\pmod{m_i}$ for all $i\ \ $ $\endgroup$ Mar 21 at 21:19


Browse other questions tagged .