Clarify about primary ideals in a commutative ring In a commutative ring, if one takes a primary ideal $I$, then $\sqrt I$ is prime. It is not true in general that an ideal with such property is primary. For example, given a prime ideal $\mathfrak p$, one has that the radical of $\mathfrak p^n $ is $\mathfrak p$, clearly, but a $\mathfrak p^n $ is not always primary. The notes from which I'm studying prove that, in $\mathbb Z$, every ideal $I$ such that $\mathfrak q:=\sqrt I$ is prime is a power of $\mathfrak q$. Then they conclude noticing that every power of a prime ideal is primary; however, it seems to me that they only proved that in $\mathbb Z $, for an ideal, being a power of a prime is equivalent to have the property that its radical is prime. This proves that every primary is a power of a prime (in $\mathbb Z$) but not the converse, which is what we need. What am I missing? Thanks
Take $n=p_1^{a_1}p_2^{e_2}\dotsm p_k^{e_k}$. Then it's not difficult to show that $\sqrt{\smash[b]{(n)}}=(p_1p_2\dots p_n)$, so the radical is prime if and only if $n$ is a prime power.
Conversely, $(p)^e=(p^e)$ being a $(p)$-primary ideal is easy to show.
It is generally false that the power of a prime ideal is primary, but it can hold for particular prime ideals. Indeed, if $p$ is a prime element of a domain, then $(p^e)=(p)^e$ is $(p)$-primary.
We can prove that any power of a prime in $\mathbb{Z}$ is primary by hand. Let $I=(p^n)$ for a prime $p\in\mathbb{Z}$. Suppose $xy\in I$, but $x\not\in I$. Since $xy\in I$, $p^n m = xy$ for some $m$. $p^n$ divides the LHS, so $p^n$ must divide the RHS. Since $x\not\in I$, we have $p^j\mid x$ and $p^k\mid y$ for some $j$ strictly less than $n$ and some $k$ strictly greater than 0. Thus $y^n\in (p^{kn})\subset (p^n)$.