Function: znstar
Section: number_theoretical
C-Name: znstar
Prototype: G
Help: znstar(n): 3-component vector v, giving the structure of (Z/nZ)^*.
 v[1] is the order (i.e. eulerphi(n)), v[2] is a vector of cyclic components,
 and v[3] is a vector giving the corresponding generators.
Doc: gives the structure of the multiplicative group
 $(\Z/n\Z)^*$ as a 3-component row vector $v$, where $v[1]=\phi(n)$ is the
 order of that group, $v[2]$ is a $k$-component row-vector $d$ of integers
 $d[i]$ such that $d[i]>1$ and $d[i]\mid d[i-1]$ for $i \ge 2$ and
 $(\Z/n\Z)^* \simeq \prod_{i=1}^k(\Z/d[i]\Z)$, and $v[3]$ is a $k$-component row
 vector giving generators of the image of the cyclic groups $\Z/d[i]\Z$.
 \bprog
 ? G = znstar(40)
 %1 = [16, [4, 2, 2], [Mod(17, 40), Mod(21, 40), Mod(11, 40)]]
 ? G.no   \\ eulerphi(40)
 %2 = 16
 ? G.cyc  \\ cycle structure
 %3 = [4, 2, 2]
 ? G.gen  \\ generators for the cyclic components
 %4 = [Mod(17, 40), Mod(21, 40), Mod(11, 40)]
 ? apply(znorder, G.gen)
 %5 = [4, 2, 2]
 @eprog\noindent According to the above definitions, \kbd{znstar(0)} is
 \kbd{[2, [2], [-1]]}, corresponding to $\Z^*$.
