Dedekind zeta function of an imaginary quadratic field I've known for a while that $\zeta_K(s)=\frac{1}{\mid \mathcal{O}_K^\times \mid}\sum_{[a,b,c]\in C_i} \sum_{(n,m) \neq (0,0)} \frac{1}{(am^2+bmn+cn^2)^s}$ where $C_i$ is a class of quadratic forms of discriminant $\Delta_K$. My question is, how do we get here from $\zeta_K(s)=\sum_{I\subset \mathcal{O}_K} \frac{1}{N(I)^s}$? 
I can get to $\zeta_K(s)=\sum_{c\in C_k} \sum_{I \sim c, I \subset \mathcal{O}_K}\frac{1}{N(I)^s}$, and my next thought is to use to use the fact that two ideals are equivilent if $aI=bI_c$ for any $a,b \in\mathcal{O}_k$, which makes me want to change the sum to  $\zeta_K(s)=\sum_{c\in C_k} \sum_{I_c \in c, a \in \mathcal{O}_K}\frac{1}{N(aI_c)^s}$, though I believe this is incorrect because $a$ doesnt necessarily have to be in $\mathcal{O}_k$, it can be in the field $K$, though im not sure which specific set of numbers, S, make it so that $\left \{ aI_c \mid a\in S, I_c\in c \right \}=c$. Thanks for any help.
 A: *

*First of all you need to make correspond the ideal classes of quadratic fields with the binary quadratic forms, for this find that $I_c$ is of finite index in a free $\Bbb{Z}$-module of rank $2$ thus $I_c=u\Bbb{Z}+v\Bbb{Z}$. Then $q(n,m)=N_{K/Q}(nu+mv)$ is a quadratic form, conversely any quadratic form is $an^2+bnm+cm^2=a(n-um)(n-u^* m)=aN_{F/Q}(u)$ with  $u=\frac{-b+\sqrt{b^2-4c}}{2}$.

*From there some work is needed to show that if the quadratic form  is not primitive then the lattice is not a $O_K$-module but only a $O$-module for some subring.

*Given an ideal $I_c\subset O_K$ pick another ideal $I_{c^{-1}}\subset O_K$ such that $I_cI_{c^{-1}}=(a)$ is principal then $I \subset O_K$ is in the class $c$ iff $I= \frac{b}{a}I_c$ with $b \in I_{c^{-1}}$. Moreover $\frac{b}aI_c,\frac{b_2}aI_c$ are the same ideal iff $b_2 \in b O_K^\times$ thus
$$\sum_{I \subset O_K, I \sim c} N(I)^{-s}=\sum_{b \in I_{c^{-1}}/O_K^\times} N(\frac{b}{a} I_c)^{-s}=\frac{N(I_c)^{-s}}{N(a)^{-s}} \sum_{b \in I_{c^{-1}}/O_K^\times} N(b)^{-s}$$

*If $K = \Bbb{Q}(\sqrt{D})$ then $I_{c^{-1}}=u\Bbb{Z}+v\Bbb{Z}$, if $D< 0$ then $O_K^\times$ has finitely many elements ($2,4$ or $6$) and $N(\alpha) = |\alpha|^2$ so that $$\sum_{b \in I_{c^{-1}}/O_K^\times} N(b)^{-s}= \frac1{|O_K|^\times}\sum_{(n,m) \ne (0,0)} |nu+mv|^{-2s}$$
