TITLE: On finite commutative rings with the number of ideals equal to the number of elements of the ring
QUESTION [9 upvotes]: Let $R$ be a finite commutative ring with identity. Under what conditions the number of ideals of $R$ is equal to the number of elements of $R$? 

The only class of rings with this property that I know is the class of finite boolean rings. I do not know if the converse is true. So any suggestion would be helpful.

REPLY [2 votes]: Disclaimer. This is only a partial result.
Since a finite commutative ring is artinian it is isomorphic to a finite direct product of finite artinian local rings. Say $R\simeq R_1\times\cdots\times R_n$. 

Assume $R$ is a PIR.

Since $R$ is a PIR all $R_i$ are PIRs.
Suppose now that $R$ is local and let $\mathfrak m$ be its maximal ideal. There is $r\ge1$ such that $\mathfrak m^r=0$, and choose $r$ minimal. Since $\mathfrak m$ is principal the ideals of $R$ are $(0),\mathfrak m^{r-1},\dots,\mathfrak m,R$, so $R$ has $r+1$ ideals. On the other side, $|R|=|R/\mathfrak m|^{\ell(R)}$, where $\ell(R)$ denotes the length of $R$. In this case $\ell(R)=r$, and thus $|R|=|R/\mathfrak m|^r\ge r+1$. (Note that this inequality helps us to pass from the local to the global case.) In order to have equality we must have $|R/\mathfrak m|=2$ and $r=1$, so $R\simeq\mathbb F_2$.   
Conclusion: $R$ is a finite direct product of copies of $\mathbb F_2$.