LetFbe a primitive form. We can write with a fundamental discriminant. Then if and only if either , or if

An explicit computation show that is a square modulo4. Hence, it can always be written as . Assume first . Then and so we can write with integral.Assume . A computation shows that

Since we have hence if , either ,i.e, or ,i.e.Assume now that

Since , . Since the square of an integer is congruent top=2. If , we have0or1modulo 4, it follows that in other words , hence once again either or as before.Conversely, assume that either or . If , then since

Fis primitive, by Proposition 3.3 (2), we have .Assume first

p>3. Then , hence , so .Assume now that

p=2. Then for some other quadratic form , hence , hence the same is true for and hence .Finally, assume that

p=3. From the explicit formulas, is equivalent to and , from which it follows by the formula for the discriminant that , and in particular .Assume now that , and . We may assume that , otherwise we are in the case which we have just dealt with.

By the same reasoning as before, writing , we have

Hence is equivalent to which implies , hence ifp>2we have .For

and since , we deduce that and hence , thus finishing the proof of the proposition.p=2and , we have as before