Ask Your Question
1

Listing elements of (Z/nZ)*

asked 2016-10-01 18:28:42 +0100

nebuckandazzer gravatar image

updated 2023-01-09 23:59:41 +0100

tmonteil gravatar image

I want to find all the elements of (Z/nZ)*. Is there a command for that ? For example if the user gives input 8, the the output will be {1,3,5,7}.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2016-10-01 19:40:05 +0100

tmonteil gravatar image

updated 2016-10-01 19:46:29 +0100

You can use the method with a surprizing long but explicit name list_of_elements_of_multiplicative_group:

sage: G = Zmod(8) ; G
Ring of integers modulo 8
sage: G.list_of_elements_of_multiplicative_group()
[1, 3, 5, 7]

If you want this set as a genuine group, you can do:

sage: G.unit_group()
Multiplicative Abelian group isomorphic to C2 x C2
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-10-01 18:28:42 +0100

Seen: 1,289 times

Last updated: Oct 01 '16