Let $R=\mathbb{Z}$ I must prove that
In $\mathbb{Z}$ the primary ideals s are precisely the ideals $(p^k)$ where $p$ is a prime number and $n\ge 1$.
$$$$ The definition of primary ideal.
Definition. An ideal $I$ of the ring $R$ is called primary if for all $a,b\in R$ $$(ab\in I\quad\text{and}\quad a\notin I)\Rightarrow b^n\in I, \text{for some positive integer $n$}.$$
Therefore I must prove that
$$(n)\;\text{is primary in}\;\mathbb{Z}\iff n=p^k, k\ge1,p\ge2,\;\text{where}\;p\;\text{is a prime}.$$
Proof ($\Leftarrow$) We suppose that $n=p^k$ for same prime $p$ and $k\ge 1$. Let $a,b\in\mathbb{Z}$ such that $ab\in(p^k)$ and $a\notin (p^k)$. Then $p^k\nmid a$, but $p^k \mid ab$ I no longer know how to proceed.
$(\Rightarrow)$ Let $(n)$ a primary ideal and we suppose for absurd that $n$ is not a power of a prime, then? how could I proceed?
Now, let $ab\in (p^k)$ with $a\notin(p^k)$, then $p^k\mid ab.$ Can I conclude that $p^k\mid b$?
How can I set up the other implication? Thanks
No. $2 \cdot 2^5 \in (2^6)$ and $2 \not\in (2^6)$, but $2^6 \not \mid 2^5$. What you do know is there are $6$ powers of two among $2$ and $2^5$.
If $a b \in (p^k)$, then $a b = m p^k$ for some $m \in \mathbb{Z}$. Since $a \not \in (p^k)$, $a = m' p^\ell$ for $m,\ell \in \mathbb{Z}$ where $m'|m$, $(m',p) = 1$, and $0 \leq \ell < p$. Then $b = \frac{m}{m'}p^{k-\ell}$. Since $k-\ell \geq 1$, $b^k \in (p^k)$.
For the other direction, you should see how to use a composite, as indicated above, to show that a non-prime-power generator of the ideal can be split into parts preventing the ideal being primary.