Lemma 9 Let . If the quadratic congruence
has a solution , then, the indefinite equation (20) has a primitive solution, and there must be a non-negative primitive solution , satisfying
Lemma 9 Let . If the quadratic congruence
has a solution , then, the indefinite equation (20) has a primitive solution, and there must be a non-negative primitive solution , satisfying
Proof: Clearly, we have , hence by Lemma 4, there must exist satisfying
and
From equation (37), we get
Since satisfies the congruence equation (35), from equation (38) we can deduce
From the above two equations, we obtain
Thus, is a solution to (20). Next, we prove that it is primitive, i.e., . From equation (39), we have , and from equation (38), we get
Therefore,
Here, we used . The above equation holds only when . Therefore, is a primitive solution to (20).
Finally, when have the same sign, take ; when have opposite signs, take . We can easily verify that is a non-negative (actually positive) primitive solution to (20) and satisfies equation (36) (left to the reader). The lemma is proved.