Package sage :: Package rings :: Module integer_mod_ring
[hide private]
[frames] | no frames]

Module integer_mod_ring

source code


Ring $\Z/n\Z$ of integers modulo $n$

EXAMPLES:
    sage: R = Integers(97)
    sage: a = R(5)
    sage: a**100000000000000000000000000000000000000000000000000000000000000
    61

This example illustrates the relation between $\Z/p\Z$ and $\F_p$.  In
particular, there is a canonical map to $\F_p$, but not in the other
direction.
    sage: r = Integers(7)
    sage: s = GF(7)
    sage: r.has_coerce_map_from(s)
    False
    sage: s.has_coerce_map_from(r)
    True
    sage: s(1) + r(1)
    2
    sage: parent(s(1) + r(1))
    Finite Field of size 7
    sage: parent(r(1) + s(1))
    Finite Field of size 7

We list the elements of $\Z/3\Z$
    sage: R = Integers(3)
    sage: list(R)
    [0, 1, 2]

AUTHORS
    -- William Stein (initial code)
    -- David Joyner (2005-12-22): most examples
    -- Robert Bradshaw (2006-08-24): convert to SageX
    -- William Stein (2007-04-29): square_roots_of_one    



Classes [hide private]
  IntegerModRing_generic
The ring of integers modulo N, with N composite.
Functions [hide private]
 
IntegerModRing(order=0)
Return the quotient ring $\ZZ / n\ZZ$.
source code
 
is_IntegerModRing(x)
Return True if x is an integer modulo ring.
source code
 
Zmod(order=0)
Return the quotient ring $\ZZ / n\ZZ$.
source code
 
Integers(order=0)
Return the quotient ring $\ZZ / n\ZZ$.
source code
 
crt(v)
INPUT: v -- (list) a lift of elements of rings.IntegerMod(n), for various coprime moduli n.
source code
Variables [hide private]
  _objsIntegerModRing = {}
Function Details [hide private]

IntegerModRing(order=0)

source code 

Return the quotient ring $\ZZ / n\ZZ$.

INPUT:
    order -- integer (default: 0), positive or negative

EXAMPLES:
    sage: IntegerModRing(15)
    Ring of integers modulo 15
    sage: IntegerModRing(7)
    Ring of integers modulo 7
    sage: IntegerModRing(-100)
    Ring of integers modulo 100

Note that you can also use \code{Integers}, which is a synonym
for \code{IntegerModRing}.
    sage: Integers(18)
    Ring of integers modulo 18

is_IntegerModRing(x)

source code 

Return True if x is an integer modulo ring.

EXAMPLES:
    sage: R = IntegerModRing(17)
    sage: is_IntegerModRing(R)
    True
    sage: is_IntegerModRing(GF(13))
    True
    sage: is_IntegerModRing(GF(4, 'a'))
    False
    sage: is_IntegerModRing(10)
    False
    sage: is_IntegerModRing(ZZ)
    False

Zmod(order=0)

source code 

Return the quotient ring $\ZZ / n\ZZ$.

INPUT:
    order -- integer (default: 0), positive or negative

EXAMPLES:
    sage: IntegerModRing(15)
    Ring of integers modulo 15
    sage: IntegerModRing(7)
    Ring of integers modulo 7
    sage: IntegerModRing(-100)
    Ring of integers modulo 100

Note that you can also use \code{Integers}, which is a synonym
for \code{IntegerModRing}.
    sage: Integers(18)
    Ring of integers modulo 18

Integers(order=0)

source code 

Return the quotient ring $\ZZ / n\ZZ$.

INPUT:
    order -- integer (default: 0), positive or negative

EXAMPLES:
    sage: IntegerModRing(15)
    Ring of integers modulo 15
    sage: IntegerModRing(7)
    Ring of integers modulo 7
    sage: IntegerModRing(-100)
    Ring of integers modulo 100

Note that you can also use \code{Integers}, which is a synonym
for \code{IntegerModRing}.
    sage: Integers(18)
    Ring of integers modulo 18