# Chinese remainder theorem (chinese_remainder)

The number that leaves given remainders on division by given moduli.

## How to write it

### chinese_remainder(remainders, moduli)

**remainders**

The remainders. Takes a list.

**moduli**

The moduli, in the same order. Takes a list.

## Examples

- $\displaystyle \begin{cases} x \equiv 2 \pmod{3} \\ x \equiv 3 \pmod{5} \end{cases} = 8$

  `chinese_remainder([2, 3], [3, 5])`

  In the solver, `chinese_remainder([2, 3], [3, 5])` gives `8`.

  [Open in the solver](https://hilberon.com/?q=chinese_remainder%28%5B2%2C%203%5D%2C%20%5B3%2C%205%5D%29)

## Related functions

- [continued_fraction](https://hilberon.com/library/continued_fraction)

  The continued fraction of a rational number, as a list.
- [catalan_number](https://hilberon.com/library/catalan_number)

  The n-th Catalan number.
- [convergents](https://hilberon.com/library/convergents)

  The convergents of a continued fraction.
- [carmichael_lambda](https://hilberon.com/library/carmichael_lambda)

  Carmichael function: the least power that takes every number coprime to n to 1 modulo n.
- [discrete_log](https://hilberon.com/library/discrete_log)

  The exponent that takes a base to a value modulo a number.
- [bernoulli_b](https://hilberon.com/library/bernoulli_b)

  The n-th Bernoulli number.

---
Source: https://hilberon.com/library/chinese_remainder
