2

I want to solve the following system of congruences: $$ x \equiv 1 \mod 2\\ x \equiv 2 \mod 3\\ x \equiv 3 \mod 5$$ By checking all small numbers, I got $x=23$ as smallest solution. I think that all $x$ of the form $23 + k \cdot 30$, $k \in \mathbb{Z}$ are solutions but I don't see how to prove it.

Also can this be generalized to divisors which aren't pairwise coprime like $2,3,5$ above? If yes, are my solutions then of the form $x_0 + k\cdot lcm(d_1,...,d_n)?$ If yes, how do I prove this?

Marc
  • 3,285
  • 2
    http://en.wikipedia.org/wiki/Chinese_remainder_theorem – Adam Hughes Jan 07 '15 at 03:39
  • There have been close to four hundred Questions related to the Chinese Remainder Theorem/solving linear congruences modulo relatively prime moduli. See this one for a representative (and early) instance. – hardmath Jan 07 '15 at 03:52
  • Thanks, this answered my first question. I'm still a bit unsure about the general case where the divisors aren't necessarily pairwise coprime. – Marc Jan 07 '15 at 03:59
  • Short story: a solution might not exist if the moduli are not pairwise coprime, but if a solution $x_0$ exists, then yes, you can get other solutions by adding multiples of the LCM of "divisors". The proof is basically just substitution (since the LCM is divisible by all the respective moduli). – hardmath Jan 07 '15 at 04:20
  • Ok, thanks! (15 chars) – Marc Jan 07 '15 at 04:44

1 Answers1

0

Say you have $x \equiv 5 \bmod{n} $ as one of your equations where $ n$ is a composite and not coprime with other moduli then factor $ n $ and replace the equation with $ x \equiv 5 \bmod {p_i}$ for each factor and proceed as normal with CRT.

  • You might want to add a few words about detecting when the resulting equations are inconsistent (and thus no solution to either the original or the rewritten system is possible). – hardmath Jan 07 '15 at 19:24