sympy/sympy — pull request #676 by smichr (2011-10-24 03:35:38+00:00)
Title: Solve congruence

Find the integer described by the given (remainder, modulus) pairs:

assert solve_congruence(*zip([3, 4, 2], [12, 35, 17])) == (1719, 7140)
assert solve_congruence(*zip([3, 4, 2], [12, 6, 17])) is None
assert solve_congruence(*zip([3, 4, 2], [13, 7, 17])) == (172, 1547)
assert solve_congruence(*zip([-10, -3, -15], [13, 7, 17])) == (172, 1547)

Unlike the Chinese remainder theorem's requirements, the moduli need not be co-prime.