Solution (source code)

= Solution

Distinct <prime-power ideals> are pairwise <comaximal ideals>[comaximal]. For comaximal ideals, <product of ideals>[product] equals <intersection of ideals>[intersection], so <mathematical induction>[induction] gives
$$
I=P_1^{m_1}\cdots P_k^{m_k}
=P_1^{m_1}\cap\cdots\cap P_k^{m_k}.
$$
The <Chinese remainder theorem> therefore gives the ring isomorphism
$$
\mathcal O_K/I\longrightarrow
\prod_i\mathcal O_K/P_i^{m_i}.
$$

The <ideal approximation theorem>, proved by applying this <Chinese remainder theorem>[Chinese-remainder] map one <prime power> deeper, supplies
$$
\alpha\in I,\qquad
\alpha\notin P_iI\quad(1\leq i\leq k).
$$
Equivalently, $v_{P_i}(\alpha)=m_i$ at every prime dividing $I$.

Since $(\alpha)\subseteq I$, the <fractional ideal>
$$
I'=(\alpha)I^{-1}
$$
is an <integral ideal> and $II'=(\alpha)$ is a <principal ideal>. At every $P_i\mid I$,
$v_{P_i}(I')=v_{P_i}(\alpha)-m_i=0$, so $I+I'=\mathcal O_K$.

Choose $\beta\in I$ and $\gamma\in I'$ with $\beta+\gamma=1$. Then
$\alpha,\beta\in I$. For any $x\in I$,
$$
x=x\beta+x\gamma\in(\beta)+II'=(\beta)+(\alpha).
$$
Thus
$$
\boxed{I=(\alpha,\beta)},
$$
so every <ideal> of $\mathcal O_K$ has a <generating set of an ideal>[generating set] of two elements.