Listing elements of (Z/nZ)*
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}.
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}.
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
Asked: 2016-10-01 11:28:42 -0600
Seen: 643 times
Last updated: Oct 01 '16
get multiplicative subgroup of Z/nZ
does as_permutation_group() respect generators?
Is there a way to make sage print out all monomials of a Boolean Ring?
Why is Sage calling 1 a variable?
Get abelian group element powers. [closed]
solve(x) does not fully isolate x. Can Sympy use assume()tions?
Examining the quotients of a module $R\times R$ where $R$ is a finite ring.