# Computing generator of maximal ideal in localization of number field?

Given the ring of integers $\mathcal{O}$ in an algebraic number field and a prime ideal $P$ of $\mathcal{O}$, we are able to form the local ring $\mathcal{O}_P$ which is a P.I.D., Dedekind domain, discrete valuation ring and all of these nice properties.

In the case that the prime ideal $P$ is not principal, how would one compute a generator $x$ where $(x)=\mathfrak{M}_P$, the unique maximal ideal of $\mathcal{O}_P$?

An example would be the prime ideal $P= \langle 2 , 1+\sqrt{-5}\rangle$ ideal of $\mathcal{O}= \mathbb{Z}[\sqrt{-5}]$ with its respective localization $\mathbb{Z}[\sqrt{-5}]_P$. my question would be to find a generator of the maximal ideal (since this is a P.I.D.).

-
Any element $x$ with the property that the factorization into prime ideals of $(x)$ has $P$ to the first power will generate $P_P$, which is the maximal ideal in question. –  Arturo Magidin Jul 3 '12 at 5:16
If you factor $(2)$ into ideals in $\mathcal{O}$, you will find that $(2)=P^2$. If you factor $(1+\sqrt{-5})$, you have $(1+\sqrt{-5}) = PQ$, where $Q\neq P$. When you localize at $P$, the factorization of $(1+\sqrt{-5})_{P}$ becomes $P_P$, so $1+\sqrt{-5}$ generates. –  Arturo Magidin Jul 3 '12 at 5:32