crt(m, v) returns c(x, M) with x %% m[i] == v[i] %% m[i] for every i
and M the product of the moduli, or NULL when the congruences are
inconsistent; symmetric = TRUE puts x within half of M. Moduli that are
not coprime are handled by solve_congruence(), whose arguments are pairs
c(remainder, modulus). crt1(m) precomputes for repeated use with
crt2(m, v, mm, e, s). symmetric_residue(a, m) maps a in [0, m) to the
residue nearest zero.
Usage
crt(m, v, symmetric = FALSE, check = TRUE)
crt1(m)
crt2(m, v, mm, e, s, symmetric = FALSE)
symmetric_residue(a, m)
solve_congruence(..., symmetric = FALSE, check = TRUE)