ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 11 Oct 2015 13:24:28 -0500Multiplicative group of integers mod n?http://ask.sagemath.org/question/29914/multiplicative-group-of-integers-mod-n/ I'm guessing this is pretty basic, but I'm also new to Sage and can't find anything about it.
I know [how to work with the ring of integers mod n](http://doc.sagemath.org/html/en/reference/rings_standard/sage/rings/finite_rings/integer_mod_ring.html). Is there something analogous for the [multiplicative group of integers mod n](https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n)?
Something like:
G = Mult_Integers(5)
list(G)
[1, 2, 3, 4]
Googling has been surprisingly fruitless.
Thanks!
EDIT: @Nathann: right, but I'm not talking about {0, 1, 2, . . ., n-1}, but {1, 2, 3, . . ., n-1}, which [is a group with multiplication](https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n).Sun, 11 Oct 2015 10:42:26 -0500http://ask.sagemath.org/question/29914/multiplicative-group-of-integers-mod-n/Answer by tmonteil for <p>I'm guessing this is pretty basic, but I'm also new to Sage and can't find anything about it.</p>
<p>I know <a href="http://doc.sagemath.org/html/en/reference/rings_standard/sage/rings/finite_rings/integer_mod_ring.html">how to work with the ring of integers mod n</a>. Is there something analogous for the <a href="https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n">multiplicative group of integers mod n</a>?</p>
<p>Something like:</p>
<pre><code>G = Mult_Integers(5)
list(G)
[1, 2, 3, 4]
</code></pre>
<p>Googling has been surprisingly fruitless.</p>
<p>Thanks!</p>
<p>EDIT: <a href="/users/30/nathann/">@Nathann</a>: right, but I'm not talking about {0, 1, 2, . . ., n-1}, but {1, 2, 3, . . ., n-1}, which <a href="https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n">is a group with multiplication</a>.</p>
http://ask.sagemath.org/question/29914/multiplicative-group-of-integers-mod-n/?answer=29917#post-id-29917This group can be found in the `.unit_group()` method of your ring of integers mod n, see the answer [on this ask question](http://ask.sagemath.org/question/29639/easiest-way-to-work-in-the-multiplicative-group-of-zmodn/).
Sun, 11 Oct 2015 13:24:28 -0500http://ask.sagemath.org/question/29914/multiplicative-group-of-integers-mod-n/?answer=29917#post-id-29917Answer by Nathann for <p>I'm guessing this is pretty basic, but I'm also new to Sage and can't find anything about it.</p>
<p>I know <a href="http://doc.sagemath.org/html/en/reference/rings_standard/sage/rings/finite_rings/integer_mod_ring.html">how to work with the ring of integers mod n</a>. Is there something analogous for the <a href="https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n">multiplicative group of integers mod n</a>?</p>
<p>Something like:</p>
<pre><code>G = Mult_Integers(5)
list(G)
[1, 2, 3, 4]
</code></pre>
<p>Googling has been surprisingly fruitless.</p>
<p>Thanks!</p>
<p>EDIT: <a href="/users/30/nathann/">@Nathann</a>: right, but I'm not talking about {0, 1, 2, . . ., n-1}, but {1, 2, 3, . . ., n-1}, which <a href="https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n">is a group with multiplication</a>.</p>
http://ask.sagemath.org/question/29914/multiplicative-group-of-integers-mod-n/?answer=29916#post-id-29916The integers modulo n are not a group with respect to multiplication. 1 is a unit element, but 0 has no inverse.Sun, 11 Oct 2015 12:25:25 -0500http://ask.sagemath.org/question/29914/multiplicative-group-of-integers-mod-n/?answer=29916#post-id-29916