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?