On Fri, Sep 23, 2011 at 12:39 AM, Santanu Sarkar
<[email protected]> wrote:
> I want to find integer such that
> x= 1 mod 3
> x=2  mod 5
> x=3  mod 7
> like this system of congruences using Chinese Remainder Theorem.
> In Sage, crt() function takes only 4 argument.

sage: help(CRT)

crt(a, b, m=None, n=None)
    Returns a solution to a Chinese Remainder Theorem problem.

    INPUT:

    - ``a``, ``b`` - two residues (elements of some ring for which
      extended gcd is available), or two lists, one of residues and
      one of moduli.
[...]

    If ``a`` and ``b`` are lists, returns a simultaneous solution to
    the congruences `x\equiv a_i\pmod{b_i}`, if one exists.

    .. SEEALSO::

        - :func:`CRT_list`


sage: CRT([1,2,3],[3,5,7])
52
sage: x = CRT([1,2,3],[3,5,7])
sage: x % 3, x % 5, x % 7
(1, 2, 3)


Doug

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to