12. Proof: The sufficiency has been proved in the previous problem. Below, we only prove the necessity.
Let m⩾3,(a,m)=1, and x2≡a(modm) has exactly two solutions. We need to prove that m must have a primitive root. We use proof by contradiction. Assume m does not have a primitive root. From the discussion in Chapter §1 —§4, m must not be of the following forms:
2,4,ps,2ps(p⩾3,s⩾1)
Thus, m⩾5, and m must be one of the following forms:
(1) m=2b,b⩾3,
(2) m=2cpx,α⩾1,c⩾2,
(3) m=2cp1x1…psxs,c⩾0,s⩾2,αi⩾1(1⩽i⩽s),pi⩾3(1⩽i⩽s).
First, consider case (1). In this case,
x2≡1(mod2b)
Besides x≡1,−1, there are at least two other solutions x≡2b−1−1,2b−1+1, which are clearly pairwise incongruent (mod2b). Therefore, case (1) is impossible.
Next, consider case (2). Since c⩾2, we have
x2≡1(mod2)
which has at least two solutions x1,x2 that are incongruent mod2.
We also know that
x2≡1(modpx)
has two solutions y1,y2 that are incongruent modpα. Solving
(using the Chinese Remainder Theorem) gives
x2≡1(mod2cpx)
four solutions (mod2cpx), which are clearly pairwise incongruent (mod2cpx). Therefore, case (2) is also impossible.
Finally, consider case (3). Using the same method as in case (2), we can prove that in this case,
x2≡1(modm)
has more than 2 solutions that are pairwise incongruent (modm). Therefore, case (3) is also impossible. In any other case, m must have a primitive root, which completes the proof.
{x3≡x2(mod2c),x3≡y1(modpx),{xˉ4≡x2(mod2c),xˉ4≡y2(modpx),