Solving congruences using PARI I'm having trouble finding info in the docs about how to solve a system of congruences. The closest I can find is 'matsolvemod' in here: http://pari.math.u-bordeaux.fr/dochtml/html.stable/Vectors,_matrices,_linear_algebra_and_sets.html

but I'm not sure if that's exactly what it's used for because I don't really understand where the M parameter comes in with a system of congruences. Is there a function for solving a system of linear equations of the form:

x = a1 (mod b1)
x = a2 (mod b2)
...
x = an (mod bn)

(or even for just 2 or 3 congruences is fine)

EDIT: Okay, I've tried just using the algorithm and basic arithmetic instead of finding a function to do it for me automatically but am receiving an error:
Pari's "chinese" function (as in Chinese Remainder Theorem) does the solution for you, for two congruences. You can fold in more congruences via induction.

? chinese(Mod(42,91), Mod(11, 37))
%1 = Mod(3045, 3367)


The previous example solves for $x \equiv 42 \pmod{91}$ and $x \equiv 11 \pmod{37}$, which is unique modulo $91 \cdot 37 = 3367$. You can use "raise" to promote a Mod object to the integers.