Let $\mathbb{Z}^*_{463}$ the ring of integers modulo 463 without the $0$ element. I need to find an element of $(\mathbb{Z}^*_{463},\cdot)$ which have as order a power of a prime. For example, let 27 the order I want to find. I have never studied how to use Sage but I've just tried several efforts, for example
G=GF(463)
wanted_order= 27
for n in G(n):
order = n.order()-1
if ordine == wanted_order:
t=1
print("Found! ", n)
break
if t==0:
print("Not found")
Unlucky the result is always "Not found". Indeed, I've checked all the elements and it says that the order is always 462, but it's not possible.
So, I tried to change the way and I thought to find the subgroup of each element and evaluate the number of its elements with the following code.
G = IntegerModRing(463)
sigma = G("8")
H = G.subgroup([sigma])
H=list(H)
print(len(H))
However, this effort resulted in the following error:
AttributeError: 'IntegerModRing_generic_with_category' object has no attribute 'subgroup'
Can you help me?