Let $\theta=\dfrac{1+\sqrt{-31}}{2}$, determine which ideals of $D=\mathbb{Z}[\theta]$ contains $1+\theta$.
I know that if i.e $6\in\mathfrak{a}\Rightarrow \mathfrak{a}\mid 6D$ and then $6D=Q^2PP$ and I can calculate the number of ideals with $6$ in it ($=3.2.2$ because $Q^2=2D$ and $PP'=3D$) but what must I do with $\theta$?
This is fairly straightforward. Asking which ideals contain $\theta+1$ is the same as asking which ideals divide the principal ideal $(1+\theta)$ by unique factorization.
Computing norms we see that $N(1+\theta)=10$, hence there is one ideal of norm $2$ and one ideal of norm $5$ containing $1+\theta$ and, in fact, $(1+\theta)=\mathfrak{p}\mathfrak{q}$ for distinct prime ideals $\mathfrak{p},\mathfrak{q}$ the former we will let be the prime over $2$ and the latter the prime over $5$. This tells you there are precisely $4$ such ideals, two being obvious, i.e. $\Bbb Z[\theta]$ and $(1+\theta)$. Since $\Bbb Z[\theta]$ is the entire integer ring, we know that we can write ideals based on their reductions modulo assorted $p$.
So we reduce $x^2-x+8$ (the minimal polynomial for $\theta$) modulo $2$ we get $x(x+1)$ so $(2)=(2, \theta)(2,\theta+1)$. Clearly these ideals are distinct, or else $1$ is in one of them, a contradiction. So the ideal we seek over $2$ is manifestly $(2,\theta+1)$. Again, since $\theta+1$ does not generate an ideal of norm $2$, it must be that both generators are necessary. For the ideal over $5$, we reduce $x^2-x+8$ modulo $5$ which gives the factorization $(x+1)(x+3)$, so the ideals over $5$ are $(5,\theta+1)$ and $(5,\theta+3)$, and again both generators in the first case are necessary.
We conclude a complete list is $\mathcal{O}_k, (1+\theta), (2,1+\theta), (5,1+\theta)$.