Executes the Chinese Remainder Theorem (CRT).
sequence of integers, same length as
sequence of integers, relatively prime to each other.
The Chinese Remainder Theorem says that given integers a_i and natural numbers m_i, relatively prime (i.e., coprime) to each other, there exists a unique solution x = x_i such that the following system of linear modular equations is satisfied:
x_i = a_i \, mod \, m_i, \quad 1 ≤ i ≤ n
More generally, a solution exists if the following condition is satisfied:
a_i = a_j \, mod \, gcd(m_i, m_j)
This version of the CRT is not yet implemented.
Returns th (unique) solution of the system of modular equalities as an
1 2 3 4 5 6 7 8
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.