Let $p \equiv 5 \pmod{8}, q \equiv 7 \pmod{8}$ be primes and $N = pq$. I want to show that the class number $n$ of $\mathbb{Q}(\sqrt{-N})$ satisfies $n \equiv 2 \pmod{4}$ if $\left(\frac{q}{p}\right) = -1$ and $n \equiv 0 \pmod{4}$ otherwise. 


This comes from my trying to understand the answer to question 28462 (Why are there usually an even number of representations as a sum of 11 squares). 


In a comment, Paul Monsky wrote: "To see this note that the non-trivial ambiguous ideal class is represented by an ideal of norm q, and so is not in the principal genus."


Can someone explain more fully how to show this? 



Computing certain class numbers modulo 4
The way Gauss did things was in terms of SL(2,Z) equivalence classes of (primitive) binary quadratic forms over Z. So lets consider such definite forms, axx+bxy+cyy with b^2-4ac=-N. For simplicity suppose N is squarefree and odd. Gauss defines a composition on the classes, making
the set of classes into a finite group. For each prime dividing N he defines a genus character from this group to Z/2. The product of these characters is the trivial map, and the joint kernel of them all consists of the squares, a subgroup that he calls the principal genus. In the case N=pq, the character attached to p maps a form to (M/p) where M is any integer prime to p represented by the form. So the squares form, in your case, a subgroup of index 2, and there is a unique non-trivial class of order 2 in the group. Gauss calls the classes of order 2 the "ambiguous classes". They're easily written down in general and are represented by "reduced" forms
axx+bxy+cyy with b=0 or with a=b (or c). So in your case the non-trivial ambiguous class is represented by pxx+qyy. The genus character attached to p maps this class to (q/p). So the class is a square if and only if (q/p)=1, giving the result you want. The theory also works for even N not necessarily square-free, though there are 2 genus characters attached to the prime 2 when 32 divides N, and it works for indefinite forms as well. 


Oops--I should have said that the non-trivial ambiguous class is represented by qxx+qxy+(1/4)(p+q)yy.


