# Revision history [back]

### how can I manipulate a multiplicative group of Zmod(n)

Hi,

I want to create the multiplicative group (Z/7Z)*={1,2,3,4,5,6} so I did these steps:

sage: n=7
sage: Zn=Zmod(n)
sage: G=Zn.unit_group()
sage: list(G)
[1, f, f^2, f^3, f^4, f^5]

sage: Zn(f)
3

Then I want to create the subgroups generate by 2=f^2 which is {1,2,4} So I did the following steps:

sage: H=G.subgroup([f^2])
sage: list(H)
[1, f, f^2]

my problem is when I did sage: Zn(f)
It returns 3

But here f need to be 2 ? How can I solve this ? replaces f by value?

 2 None slelievre 17654 ●22 ●160 ●348 http://carva.org/samue...

### how can I manipulate a multiplicative group of Zmod(n)

Hi,

I want to create the multiplicative group (Z/7Z)*={1,2,3,4,5,6} $(\mathbb{Z}/7\mathbb{Z})^*={1,2,3,4,5,6}$ so I did these steps:

sage: n=7 n = 7
sage: Zn=Zmod(n) Zn = Zmod(n)
sage: G=Zn.unit_group() G = Zn.unit_group()
sage: list(G)
[1, f, f^2, f^3, f^4, f^5] f^5]

sage: Zn(f)
3
3


Then I want to create the subgroups generate generated by 2=f^2 $2=f^2$ which is {1,2,4} ${1,2,4}$ So I did the following steps:

sage: H=G.subgroup([f^2]) H = G.subgroup([f^2])
sage: list(H)
[1, f, f^2]f^2]


my problem is when I did did

sage: Zn(f)
It returns
3
3


But here f need needs to be 2 ? 2. How can I solve this ? replaces f this? Replace f by value?

 3 None slelievre 17654 ●22 ●160 ●348 http://carva.org/samue...

### how can I manipulate a multiplicative group of Zmod(n)

Hi,

I want to create the multiplicative group $(\mathbb{Z}/7\mathbb{Z})^*={1,2,3,4,5,6}$ $(\mathbb{Z}/7\mathbb{Z})^*=\{1,2,3,4,5,6\}$ so I did these steps:

sage: n = 7
sage: Zn = Zmod(n)
sage: G = Zn.unit_group()
sage: list(G)
[1, f, f^2, f^3, f^4, f^5]

sage: Zn(f)
3


Then I want to create the subgroups generated by $2=f^2$ which is ${1,2,4}$ So I did the following steps:

sage: H = G.subgroup([f^2])
sage: list(H)
[1, f, f^2]


my problem is when I did

sage: Zn(f)
3


But here f needs to be 2. How can I solve this? Replace f by value?

 4 None slelievre 17654 ●22 ●160 ●348 http://carva.org/samue...

### how can I manipulate a multiplicative group of Zmod(n)

Hi,

I want to create the multiplicative group $(\mathbb{Z}/7\mathbb{Z})^*=\{1,2,3,4,5,6\}$ so I did these steps:

sage: n = 7
7
sage: Zn = Zmod(n)
Zmod(n)
sage: G = Zn.unit_group()
sage: list(G)
Zn.unit_group()
sage: list(G)
[1, f, f^2, f^3, f^4, f^5]

sage: Zn(f)
3


Then I want to create the subgroups generated by $2=f^2$ which is ${1,2,4}$ So I did the following steps:

sage: H = G.subgroup([f^2])
sage: list(H)
[1, f, f^2]


my My problem is when I did

sage: Zn(f)
3


But here f f needs to be 2. How can I solve this? Replace f by value?

 5 None slelievre 17654 ●22 ●160 ●348 http://carva.org/samue...

### how can I manipulate a multiplicative group of Zmod(n)

Hi,

I want to create the multiplicative group $(\mathbb{Z}/7\mathbb{Z})^*=\{1,2,3,4,5,6\}$ so I did these steps:

sage: n = 7
sage: Zn = Zmod(n)
sage: G = Zn.unit_group()
sage: list(G)
[1, f, f^2, f^3, f^4, f^5]


Then I want to create the subgroups generated by $2=f^2$ which is ${1,2,4}$ $\{1,2,4\}$ So I did the following steps:

sage: H = G.subgroup([f^2])
sage: list(H)
[1, f, f^2]


My problem is when I did

sage: Zn(f)
3


But here f needs to be 2. How can I solve this? Replace f by value?

 6 None slelievre 17654 ●22 ●160 ●348 http://carva.org/samue...

### how can I manipulate a multiplicative group of Zmod(n)

Hi,

I want to create the multiplicative group $(\mathbb{Z}/7\mathbb{Z})^*=\{1,2,3,4,5,6\}$ so $(\mathbb{Z}/7\mathbb{Z})^*=\{1,2,3,4,5,6\}$.

I did these steps:

sage: n = 7
sage: Zn = Zmod(n)
sage: G = Zn.unit_group()
sage: list(G)
[1, f, f^2, f^3, f^4, f^5]


Then I want to create the subgroups generated by $2=f^2$ which is $\{1,2,4\}$ So $\{1,2,4\}$.

I did the following steps:

sage: f = G.gen()
sage: H = G.subgroup([f^2])
G.subgroup([f^2])
sage: list(H)
list(H)
[1, f, f^2]


My problem is when I did

sage: Zn(f)
Zn(f)
3


But here f needs to be 2. How can I solve this? Replace f by value?