 chrem - Maple Help

chrem

Chinese Remainder Algorithm Calling Sequence chrem(u, m) Parameters

 u - list [u1,..., un] of evaluations m - list of moduli [m1,..., mn] Description

 • The list of moduli m must be pairwise relatively prime positive integers. (For the case of non-coprime moduli, see NumberTheory[ChineseRemainder].) Both lists u and m must be the same length $n$. The list of images u need not be reduced modulo m on input. In the following, $M$ denotes the product of the moduli.
 • If u is a list of integers, chrem(u, m) computes the unique positive integer a such that $a\mathbf{mod}\mathrm{m1}=\mathrm{u1},a\mathbf{mod}\mathrm{m2}=\mathrm{u2},...,a\mathbf{mod}\mathrm{mn}=\mathrm{un}$ , and $0\le a.
 • If the global variable mod has been assigned to mods then the result $a$ is returned in the symmetric range for the integers modulo $M$. For example, the symmetric range for the integers modulo $M=35$ is $-17\le a\le +17$.
 • If u is a list of polynomials, chrem is applied across the polynomials so that the output $f$ is a polynomial satisfying $f\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{m1}=\mathrm{u1}$ , ..., $f\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{mn}=\mathrm{un}$.
 • If u is a list of lists, chrem is applied across the lists so that the output will be a list $L$ satisfying $L\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{m1}=\mathrm{u1}$, ..., $L\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{mn}=\mathrm{un}$ .
 • For a definition, see Chinese remainder theorem. Examples

 > $\mathrm{chrem}\left(\left[1,2\right],\left[5,7\right]\right)$
 ${16}$ (1)
 > $\mathrm{chrem}\left(\left[3x+1,x+2y+2\right],\left[5,7\right]\right)$
 ${8}{}{x}{+}{16}{+}{30}{}{y}$ (2)
 > $\mathrm{chrem}\left(\left[\left[3,0,1\right],\left[1,2,2\right]\right],\left[5,7\right]\right)$
 $\left[{8}{,}{30}{,}{16}\right]$ (3)
 > $\mathrm{mod}≔\mathrm{mods}$
 ${\mathrm{mod}}{≔}{\mathrm{mods}}$ (4)
 > $\mathrm{chrem}\left(\left[3x+1,x+2y+2\right],\left[5,7\right]\right)$
 ${8}{}{x}{+}{16}{-}{5}{}{y}$ (5)