I need a formula for the 2-adic valuation of the number of proper equivalence classes of primitive positive definite binary quadratic forms of discriminant $-D$, call it $h\_0(-D)$. I'm sure the answer is well-known, and in fact I have found it on slides for a talk somewhere (see [here](http://chengshantian.weebly.com/uploads/4/5/5/2/45525145/binary_quadratic_forms-reduction_theory_and_genus_theory.pdf), slide 21). According to this, the class number $h\_0(-D)$ is precisely divisible by $2^{\mu-1}$ where $\mu$ can be given explicitly in terms of the number of odd prime divisors of $D$, depending on the congruence class of $-D\pmod{32}$. Does anyone have a reference for this which one could cite (the slides are not really such a reference I'd say)? The textbooks I know which address this subject only treat the case where $-D$ is a fundamental discriminant, and I think it requires a bit of work to arrive at the general case. So a reference would be much appreciated.


Thanks a lot in advance!



2-parts of class numbers of binary quadratic forms for non-fundamental discriminants
Pretty sure what you want is D. A. Buell, *Binary Quadratic Forms*. Chapter 9 is called The 2-Sylow Subgroup. Back in chapter 7, pages 117-118, he compares form class numbers $h(\Delta) $ and $h(\Delta p^2),$ also $h(4 \Delta)$


As indicated in comments, the number of genera is predictable (and is a power of 2). However, it is possible that the principal genus (and therefore each genus) has an even number of forms. On page 160, Buell refers to classes of order 4 in the group. 


Not widely known, but I got some good use out of it, it was shown that the fourth powers in the class group coincide with the spinor kernel. See [Estes and Pall](http://zakuski.math.utsa.edu/~kap/Estes_Pall_1973.pdf) Most of the pdfs I put at at [KAP](http://zakuski.math.utsa.edu/~kap/) are about ternary forms.


