ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 10 Feb 2014 14:31:48 +0100List members of each subgroup of integers modulo nhttps://ask.sagemath.org/question/11019/list-members-of-each-subgroup-of-integers-modulo-n/Hi - I am new to Sage so apologies if this is a dumb question.
For a given n, I would like to print out the list of subgroups of the multiplicative group modulo n as a list of the members of the subgroup. Here's one of the things I have tried so far:
R = Zmod(20)
grouplist = R.multiplicative_subgroups()
for subgroup in grouplist:
print subgroup
(11, 17)
(9, 11)
(3,)
(11,)
(19,)
(17,)
(9,)
()
As you can see, this gives me the generators of the sub-groups, but what I'd like is the complete list of members of the subgroup for each subgroup. Something along these lines - where members() is the method I would like, but don't know if it exists!:
R = Zmod(20)
grouplist = R.multiplicative_subgroups()
for subgroup in grouplist:
print subgroup.members()
(1, 3, 7, 9, 11, 13, 17, 19)
(1, 9, 11, 19)
(1, 3, 7, 9)
(1, 11)
(1, 19)
(1, 9, 13, 17)
(1, 9)
(1)
Thanks for any help, Martin
MartinMon, 10 Feb 2014 14:31:48 +0100https://ask.sagemath.org/question/11019/