The number of ideals in a ring Here is a question that I first asked in math.stackexchange, but I think the question must be proposed here. 

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. 
 A: This is way too addictive, so I'm going to try to quit, and I'll just leave my thoughts here in case they're useful for other addicts. This is based on the ideas in the previous non-answer that I posted last year, so I'm just editing that answer. 
Denote the number of ideals of $R$ by $n(R)$, and define the Alexeq Quotient $q(R)$ to be $\frac{n(R)}{\vert R\vert}$, so the question asks about rings $R$ with $q(R)=1$.
$q(R)$ is multiplicative on direct products (i.e., $q(R\times S)=q(R)q(S)$), so one approach to finding rings with $q(R)=1$ is to look for examples with fairly simple fractions as $q(R)$ and take products.
For example, $q(\mathbb{F}_p)=\frac{2}{p}$, and $q(\mathbb{F}_4)=\frac{1}{2}$, so if we could find a ring with $q(R)=\frac{m}{2^k}$, where $m$ has at least $k$ prime factors (counted with multiplicity) then by taking a suitable direct product with fields we could achieve $q(R)=1$.
It's not hard to find $\mathbb{F}_2$-algebras with $q(R)>1$. For example, take $R$ to be the $d$-dimensional algebra $\mathbb{F}_2\oplus V$ where $V$ is a $(d-1)$-dimensional square-zero ideal for $d>3$.
However, $n(R)$ is bounded by the number of subspaces of $R$, which behaves roughly as a constant times $2^{d^2/4}$ for large values of $d=\dim(R)$. But the number of prime factors of a "typical" large number $n$ is roughly $\log\log n$, giving roughly $\log d$, so unless we can carefully design $R$ so that $n(R)$ has many prime factors, we probably need to be lucky to find an $\mathbb{F}_2$-algebra where $n(R)$ has as many prime factors as $\vert R\vert$.
It's possible to find rings where $n(R)$ has more prime factors than $\vert R\vert$. For example, $R=\mathbb{F}_q[x,y]/(x^2,y^2)$ has $n(R)=q+5$ and so $q(R)=\frac{q+5}{q^4}$. So if $q$ is a reasonably large prime of the form $2^k-5$ (e.g., $q=59$) then $n(R)$ has $2^k$ prime factors, but $\vert R\vert$ has only $4$.
Unfortunately, I don't know any way to do this without introducing large prime factors in the denominator of $q(R)$, which are hard to get rid of: it's difficult to design $S$ so that $n(S)$ is divisible by a particular prime, but $n(S)$ doesn't have many fewer prime factors than $\vert S\vert$.
A weakening of the original question, that I don't think I've found an answer to, is:
Question: Is there a finite commutative ring $R$ (apart from finite boolean rings), where $n(R)\geq \vert R\vert$ and $n(R)$ has at least as many prime factors than $\vert R\vert$?
I found one example that might be useful. If $R=\mathbb{F}_2[x]/(x^5)\oplus \mathbb{F}_2^4$, where $\mathbb{F}_2^4$ is a square zero ideal, then $n(R)=1296=2^43^4$, and so $q(R)=\frac{3^4}{2^5}$. This means that if we could find a $d$-dimensional $\mathbb{F}_3$-algebra $S$ where $n(S)$ has at least $\frac{5d}{4}$ prime factors then we could construct $T$ with $q(T)=1$.
A: I just wanted to note that you can use the GAP-package QPA (https://folk.ntnu.no/oyvinso/QPA/manual.pdf) to calculate the number of ideals in a given commutative quiver algebra to experiment and look at non-trivial examples. 
Namely, QPA can calculate the submodules of a given module and the ideals are exactly the submodules of the regular module over the enveloping algebras of the ring.
Using this, I think one might attack the following question by Jeremy Rickard in another answer in this thread:

Question: Is there a finite commutative ring R (apart from finite boolean rings), where n(R)≥|R| and n(R) has at least as many prime factors than |R|?

Let $R_n^q$ for $n \geq 1$ be the ring $K[x_1,...,x_n]/I$ with $I$ generated by all quadratic monomials over a field $K$ with $q$ elements. For $q=2$, the number of ideals minus one of $R_n$ starts for $n=1,2,3,...$ with 2, 5, 16, 67, 374 and should be The Sum of Gaussian binomial coefficients [n,k] for q=2 and k=0..n, see https://oeis.org/A006116.
For  general $q$, the number of ideals minus one should be The Sum of Gaussian binomial coefficients [n,k] for q and k=0..n.
Here an example: For $q=2$ and $n=8$, $2^{8+1}$ has 9 prime factors with multiplicity and there are 417199+1=417200 ideals . But 417200 has prime factors with multiplicity [ 2, 2, 2, 2, 5, 5, 7, 149 ] and their number is 8. So one nearly has an answer, but it does not work because still 9>8 :(
This leads to the following question:
For $q$ a prime power and $t \geq 0$ let $a_t^q=\sum\limits_{k=0}^{t}{[t,k]_q}$ with $[n,k]_q$ the Gaussian binomial coefficient, see https://en.wikipedia.org/wiki/Gaussian_binomial_coefficient.

Question: For which $t \geq 1$, does $a_t^q+1$ have at least $t+1$ prime divisors counted with multiplicity and $a_t^q+1 \geq q^{t+1}$?

This looks complicated, but maybe there is a solution.
A: It is known that any abelian group is a product of groups of the form $\mathbb{Z}/ n \mathbb{Z}$. Forgetting the multiplicative structure, your ring $A$ is of this form. An ideal of $A$ is a subgroup of $A_+$.
But how many subgroup there is in $A_+ = \bigoplus \mathbb{Z} / n_i\mathbb{Z}$ ?
It is the product of all the number of subgroups for each $\mathbb{Z}/ n_i \mathbb{Z}$. But a subgroup of $\mathbb{Z}/ n_i \mathbb{Z}$ is given by an element of $\mathbb{Z}/ n_i \mathbb{Z}$ that generates the subgroup. This element is not unique : for exemple the subgoup $\mathbb{Z}/ n_i \mathbb{Z}$ of $\mathbb{Z}/ n_i \mathbb{Z}$ is given by the class of an integer that is prime relative to $n_i$ : we have $\phi(n_i)$ choices. 
So, if $N(G)$ is the number of subgroup of $G$ an abelian group we have $N(A_+) = \Pi N(\mathbb{Z}/ n_i \mathbb{Z}) \leq \Pi (n_i - \phi(n_i))$
if you want $N(A_+)= card(A_+)$ we must have $\phi(n_i) = 0$ for all $i$.
and we have $A_+ \simeq (\mathbb{Z}/ 2 \mathbb{Z})^n$
Coming back to the original question, if we want the number of ideal of $A$ to be the number of subgroups of $A_+$, all the subgroups must be ideals and $A \simeq (\mathbb{Z}/ 2 \mathbb{Z})^n$ also as a ring.
So I think this result is also true for non commutative finite ring.
A: Let $R$ be a ring as in the satement. We clearly can assume that $R$ is local and have to show that $R=\mathbb{F}_2$ since otherwise the artinian ring $R$ can be decomposed as a finite product of local artinian rings (cf. answer on math.stackexchange). 
If $R$ is an integral domain then $R$ is a field (cf. wikipedia -- artinian ring -- example 1) and has two ideals which implies that the ring $R$ has two elements and must be $\mathbb{F}_2$. Therefore it suffices to show that $R$ is an integral domain. 
Suppose for a contradiction this is not the case. Then there exists $a_0$ and $b_0$ such that $a_0 b_0=0$ and both $a_0$ and $b_0$ are nonzero. This means that multiplication $a_0$ has nonzero kernel $K_0$ which is not the hole of $R$. If $K_0$ is not prime, we can find $c$ and $d$ such that both are not in $K_0$ but $cd\in K_0$. Let $a_1=a_0d$. The kernel $K_1$ of $a_1$ is an ideal which strictly contains $K_0$ and is not the whole of $R$. If $K_1$ is not prime, we can repeat and find $K_2$ which strictly contains $K_1$ and is not the whole of $R$. After finally many steps we find an $K_i$ which is nonzero prime and the kernel of multiplication with $a_i$ ($R$ noetherian). Since $R$ is local artinian we must have $K_i=\mathfrak{m}=\text{maximal ideal of }R$. This gives $\mathfrak{m}=\mathrm{Ann}(a_i)$. This means that $R$ contains the field $k=R/\mathfrak{m}$. This means that $R$ is a finite dimensional vectorspace. Let $n$ be the dimension of $R$. 
We can write $R=k[X_1,\ldots,X_r]/\mathfrak{m}^n$ for some $r\geq 1$. The monomials $$1,X_1,\ldots,X_1^{n-1},X_2,\ldots,X_2^{n-1},\ldots,X_r,\ldots,X_r^{n-1}$$ are clearly linearly independent. Therefore we have $1+r(n-1)\leq n$ and thus $(r-1)n\leq r-1$ and thus $n=1$ and thus $R=k$ -- a contradiction.
EDIT. I try to justify the reduction in the beginning. Let $R$ be as in the statement. Let $R_i$ be the local components of $R$ where $1\leq i\leq m$. Let $I_R=\{\text{Ideals of }R\}$. Since $|I_R|=|R|$ I think we must have $|I_{R_1}|\cdots |I_{R_m}|=|R_1|\cdots|R_m|$. In order to show that $|I_{R_i}|=|R_i|$ it therefore suffices to show that $|R_i|\geq|I_{R_i}|$ for all $i$. If $R_i$ is an integral domain and thus a field, the inequality holds. If $R_i$ is not an integral domain then it was proved above that $R_i=k_i[X]/(f_i^{n_i})$ where $f_i$ is irreducible and $n_i$ the dimension and $k_i$ the residue field. (N.B. I missed above the casse where $r=1$ in which I cannot divide by $(r-1)$. We are left precisely with the described principal rings.) By the paper "Commutative rings having only a finite number of ideals" by Horia Pop we then know that all ideals are powers of $(f_i)$ and thus $|I_{R_i}|= 
n$. On the other hand $|R_i|=n|k_i|$ which gives the desired inequality.
Using all this we are left to show that a ring $R$ which satisfies the assumptions of the statement and is of the form $R=k[X]/(f^n)$ where $f$ is irreducible and $k$ the residue field and $n\geq 2$ is the dimension does not exist.
I think this can be done explicitely or produce an example for factors different from $\mathbb{F}_2$. Indeed, we may assume that $f=X$ by the paper cited above. The map $R\to I_R$ with $a\mapsto(a)$ is surjective since $R$ is principal, hence also bijective since $R$ and $I_R$ have the same cardinality. This means that there can not be a unit in $R$ different from $1$ since it would produce the same ideal as $1$ in the image. Thus $k=\mathbb{F}_2$. Moreover we must have $n$ odd since if $n=2l$ then $(f^l+1)(f^l+1)=f^n+1=1$ and $f^l+1$ is a nontrivial unit. 
