Properties or characterization of commutative rings with just $3$ ideals I am looking for a characterization of commutative rings $A$ with just 3 ideals $(0),(1),\frak{m}$.
Trivially $A$ is local Artian ring but it isn't a sufficient condition.
For example $\mathbb{Z}/p^2\mathbb{Z}$ (where $p$ is a prime) and $k[x]/((x-a)^2)$ (where $k$ is a field and $a\in k$) have 3 ideals, but all fields have only 2 ideals.
I want to know more necessary conditions, equivalent conditions, or examples.
 A: If $R$ is a PID and $p \in R$ is prime, then $R/p^2$ has exactly three ideals (since $p^2$ has exactly three divisors in $R$, up to units).
These are all: Let $A$ be a commutative ring which has exactly three ideals. The maximal ideal is generated by every non-zero non-unit. In particular, $A$ is a principal ideal ring. Hungerford has proven (T. Hungerford, On the structure of principal ideal rings, Pacific J. Math. 25, 1968, 543-547) that every principal ideal ring is a finite direct product of quotients of principal ideal domains. But since $A$ is local, we can only have one factor. So $A \cong R/I$ for some PID $ R$ and some ideal $I \subseteq R$. If $I = \langle a \rangle$, the condition that $A$ has exactly three ideals means that $a$ has exactly three divisors in $R$, up to units. If $a=0$, the PID $R$ has exactly three elements up to units, which is clearly wrong (take $0,1,p,p^2$ for any prime $p$). So $a \neq 0$, say $a \sim p_1^{k_1} \cdots p_s^{k_s}$. The number of its divisors up to units is $(k_1+1) \cdots (k_s+1)$, and this can only be $=3$ when $s=1$ and $k_1=2$.
