How to find generators of $\mathbb{Z}_p$ in Sage

273 Views Asked by At

I don't know anything about Sage, but I need to compute generators of $\mathbb{Z}_p$, $p=463$. How can I do?

2

There are 2 best solutions below

6
On BEST ANSWER

It's not clear what you're asking for, but if you want the generators of the multiplicative group of units in $\mathbb{F}_{463}$, then you can do

sage: F = GF(463)
sage: [n for n in F if n.is_primitive_root()]

If you just want a single generator of $\mathbb{F}_{463}^{\times}$, you can instead do

sage: F.primitive_element()

Or maybe you're asking about generators of the additive group $\mathbb{Z}/p$, in which case another answer addresses that. Or maybe you're asking about the $p$-adics? (The notation $\mathbb{Z}_{p}$ is ambiguous.)

3
On

All the non-zero elements of $\Bbb{Z}_{463}$ are generators because 463 is prime.

For $\Bbb{Z}_m$ where $m$ is composite, then all non-zero elements of $g\in\Bbb{Z}_m$ where $\gcd{g,m}=1$ are generators.