# 2-parts of class numbers of binary quadratic forms for non-fundamental discriminants

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, 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.

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)$