Solution (source code)

= Solution

The <greatest common divisor> is
$$
\gcd(437,1012)=\gcd(19\cdot23,44\cdot23)=23,
$$
since $19$ and $44$ are <coprime integers>. Part (b) therefore gives $\boxed{1012/23=44}$ distinct $437$th powers in the nonzero <multiplicative group of a finite field> $\mathbb F_{1013}^\times$. If “powers mod $1013$” includes all <residue classes>, the additional value $0=0^{437}$ gives \b[$\boxed{45}$ values including zero]. The distinction is relevant because part (b) explicitly works in the nonzero group.