# On those integers $n>1$ such that any commutative ring with identity having exactly $n$ ideals is a PIR

Convention : All rings are commutative with unity unless stated otherwise. By ideals we will mean to include $\{0\}$ and $R$ also.

Let us call an integer $n>1$ a "principal number" if any ring $R$ having exactly $n$ ideals is a PIR (from this answer we know that for any $n>1$ there exists a corresponding PIR, here we want all the corresponding rings be PIR). I know that any ring $R$ having $5$ or less ideals is a PIR, so certainly any $n \le 5$ is a principal number.

My question is:

Are there infinitely many principal numbers? Are there infinitely many positive integers which are not principal number? Can we in any way characterize the principal numbers?

To show that there are infinitely many positive integers which are not principal it suffices to exhibit infinitely many positive integers $n$ such that there exists a non-principal ring with $n$ ideals. This is straightforward and can be done in many ways; here's one.
Let $R = \mathbb{F}_q[x, y]/(x^2, xy, y^2)$. This ring is not principal because $m = (x, y)$ is not principal, and it has exactly $q + 4$ ideals, as follows. Beside the unit ideal $(1)$, these ideals correspond to subspaces of $\text{span}(x, y)$, of which there are $q + 3$: $1$ zero-dimensional, $q + 1$ one-dimensional, and $1$ two-dimensional.
This means that $n = q + 4$ is not principal whenever $q$ is a prime power. This sequence begins
$$6, 7, 8, 9, 11, 12, 13, 15, 17, 20, \dots$$
By taking the product of the rings above with the rings $\mathbb{F}_q[x]/x^k$ we can furthermore show that $n$ isn't principal whenever it is divisible by a number of the form $q + 4$, $q$ a prime power, which I believe more or less already implies that almost all positive integers aren't principal (in the sense that the principal positive integers have density $0$).
Various modifications of this construction can be done but I haven't been able to get as fine a control on the resulting number of ideals as I would like. I suspect it might even be true that every positive integer $n \ge 6$ is non-principal but am pretty far from showing this. Right now the smallest two numbers I don't know the status of are $n = 10, 19$.