For an integral binary quadratic form with and , the reduced positive definite binary quadratic form convention is , with on either boundary or . Since , the enumeration of reduced binary quadratic forms for has . The integer is odd. For , only is retained and ; for , both give . Thus the complete list is
A proper representation of a prime uses a primitive representing vector. Completing that vector to a matrix in transforms a representing form to , so its discriminant of a binary quadratic form gives . Conversely, choose an odd satisfying this congruence and put . This is integral, and is positive definite and represents at . This proves the discriminant criterion for prime representation by a binary quadratic form here.
For , quadratic reciprocity gives . Including the ramified prime, the answer is therefore
For example supplies a proper representation of . Reduction transfers every such representation to one of the three displayed forms.
Use the reduction algorithm for a positive definite binary quadratic form. A determinant-one shear puts the middle coefficient in . If the resulting last coefficient is smaller than , the determinant-one substitution decreases the positive integer leading coefficient. Repeating terminates with a reduced positive definite binary quadratic form satisfying . These substitutions preserve proper equivalence of binary quadratic forms and the discriminant of a binary quadratic form.
The enumeration of reduced binary quadratic forms gives
Since , is odd. For , the possible values of are respectively . Each is a prime number greater than seven. But , so its positive divisor must be one. Then forces and . The two signs are properly equivalent: substituting in gives . Thus every form in question is properly equivalent to
Write an integral binary quadratic form as , with discriminant of a binary quadratic form . It is positive definite when and . Two forms are equivalent if one is obtained from the other by an integral linear change of variables whose matrix lies in . A positive definite form is reduced when
with when or .
To reduce a form, apply a unimodular shear with chosen so that the new middle coefficient has . If the new final coefficient is smaller than , exchange the variables, using a determinant-one rotation, so that the positive leading coefficient decreases from to . Repeating must stop because a positive integer cannot decrease indefinitely. At termination , and elementary sign changes impose the boundary convention. This is the reduction algorithm for a positive definite binary quadratic form, and proves that every positive definite form is equivalent to a reduced one.
The displayed forms have discriminant , so the intended discriminant is . For any reduced form of this discriminant, enumeration of reduced binary quadratic forms gives
The boundary convention and direct checking of leave only
Suppose first that a prime is represented by . The identity
shows modulo both and that is a nonzero square. Hence
Similarly,
Modulo , this says is a square, while modulo it says is a square. Since , the multiplicativity of the Legendre symbol gives
Conversely, suppose the two displayed Legendre symbols have the same sign. By quadratic reciprocity,
Choose an odd integer satisfying . Since is odd, is also divisible by , so
is a positive definite integral form of discriminant that represents . Reducing yields either or , and equivalence preserves represented integers. The necessary symbol calculation above determines which one: the positive pair selects , and the negative pair selects . Therefore
Write an integral binary quadratic form as
A positive definite form is a reduced positive definite binary quadratic form when
with on the boundary or . The class number of a negative discriminant is the number of proper equivalence classes of primitive positive definite integral forms of discriminant .
Every such class has a reduced representative. For a reduced form,
so
There are only finitely many possible integers and , and then
is determined. Hence . There is at least one class: the principal form is
and
Thus , in agreement with the enumeration of reduced binary quadratic forms.
Now let be prime. The two forms
are primitive, positive definite, reduced, and have discriminant . They are not properly equivalent: represents one, while the least positive value of is two. Therefore
Assume henceforth that , so these are the only two classes. If
for a prime , then is odd and
Moreover , so is a quadratic residue modulo . This proves the necessity.
Conversely, suppose and is a quadratic residue modulo . By quadratic reciprocity, these two conditions imply
Indeed, for both relevant signs are positive, while for the signs from and reciprocity with cancel. Choose an even integer such that
Then
is a primitive positive definite integral form of discriminant and represents . It belongs to one of the two classes .
The second form cannot represent such a prime. If
then is odd and, since ,
This contradicts . Hence lies in the principal class , and proper equivalence of binary quadratic forms preserves represented integers. Therefore
This is the prime representation when h of minus eight q equals two.