0

For example:

$$11 \pmod {20}\\ 17 \pmod {38}$$

I had a question involving three congruences where 2 moduli were both divisible by 2, but the test is not released yet so I am writing a similar problem. I got the question wrong (I solved by finding the solution for the two relatively prime congruences and then finding the LCM but that didn't work) but since one of the congruences in the form $a \mod m$ had an $a < m/2$ I realized after the test I could solve instead with $a \mod m/2$ which coincidentally brought me to the correct answer. If it didn't work, I could add the LCM of all three moduli until I got to an answer that worked. Is there a way to solve this more reliably?

TLDR:
How do I modify Chinese remainder to solve for when two moduli share a common factor?

Thomas Andrews
  • 186,215
Kevin
  • 1
  • 1
    You can't always solve such equations. For example, $x\equiv 5\pmod{12}$ and $x\equiv 3\pmod 8$ has no solution, for example. – Thomas Andrews Mar 14 '25 at 16:29
  • As explained here, since $,x\equiv 11\pmod{!20},\Rightarrow,$ $x\equiv 1\pmod{!2},,$ it follows $,x\equiv 17\pmod{!38}!\iff! x\equiv 17\pmod{!19} ,$ so we've reduced to coprime moduli $,20,19.,$ The moduli Bezout equation is obvious $,20!-!19 = \color{#c00}1,,$ so scaling it by residue difference $,\color{#0a0}6 = \color{#c00}{17!-!11},$ we get $,\color{#0a0}6(20)!-!\color{#0a0}6(19) = \color{#c00}{17!-!11},,$ which rearranges to a solution $,11+6(20) = 17+6(19)=131\ \ $ – Bill Dubuque Mar 14 '25 at 17:52
  • Alternatively the simple General Easy CRT formula works with noncoprime moduli, or instead we can scale all congruences to a common multiple moduli then (Hermite) reduce the coef's to get a congruence with coef being their gcd - see the end of the prior linked answer. $\ \ $ – Bill Dubuque Mar 14 '25 at 17:52

0 Answers0