Let $R$ by a commutative ring with $1$, and $I \subset R$ a nonzero integral ideal in $R$. When $R$ has finite quotients, and $I = P$ is prime in $R$, the group of units $(R/P)^{\times}$ of the finite ring $R/P$ is cyclic as $R/P$ is a finite field. Do there exist known sufficient and necessary conditions on $R$ and $I$ in general or for certain classes of unital rings for cyclicity of $(R/I)^{\times}$ ? In particular, do there exist more general analogues of the primitive root theorem, which answers this question for $R = \mathbb{Z}$ in terms of numbertheoretic criteria on the positive generators of the principal ideals $I = (n)$?

$\begingroup$ For anyone else who reads this post, this is also discussed in an old SE post: math.stackexchange.com/questions/73498/… $\endgroup$ – Daniel Santiago May 16 at 12:55
Throughout, let $R$ be a Noetherian ring and $I \subseteq R$ an ideal such that $R/I$ is finite. Then $R/I$ is Artinian, so we may write $I = I_1 \cdots I_r$ with $I_i = \mathfrak m_i^{n_i}$ where $\mathfrak m_1, \ldots, \mathfrak m_r \subseteq R$ are pairwise distinct prime ideals and $\mathfrak m_i^{n_i} \subsetneq \mathfrak m_i^{n_i1}$. Let $k_i = R/\mathfrak m_i$ and $p_i = \operatorname{char} k_i$, and write $q_i$ for the order of $k_i$ and $a_i$ for the order of $(R/I_i)^\times$.
Theorem. Let $R, I, I_i, \mathfrak m_i, n_i, k_i, p_i, q_i, a_i$ as above. Then $(R/I)^\times$ is cyclic if and only if all of the following hold:
 The $a_i$ are pairwise coprime;
 If $n_i > 1$, then $k_i$ is the prime field $\mathbf F_{p_i}$ and $\mathfrak m_i/\mathfrak m_i^2$ has dimension $1$ (over $\mathbf F_{p_i} = k_i$);
 When $p_i \neq 2$, either $n_i \leq 2$ or $R/I_i \cong \mathbf Z/p^{n_i}$;
 When $p_i = 2$, we have $n_i \leq 3$ and $R/I_i \not\cong \mathbf Z/8$.
If these hold, then $a_i = q_i  1$ if $n_i = 1$ and $a_i = \phi(p_i^{n_i}) = p_i^{n_i1}(p_i  1)$ if $n_i > 1$, and the order of $(R/I)^\times$ is the product of the $a_i$.
For $I = (m) \subseteq \mathbf Z$, the criteria are satisfied if and only if $m \mid 4$ or there exists an odd prime $p$ such that $m = p^n$ or $m = 2p^n$.
Indeed, criterion 2 is automatically satisfied. Criteria 3 and 4 give $n_i \leq 2$ if $p_i = 2$. We have $a_i = \phi(p_i^{n_i})$, which is even as soon as $p_i > 2$ or $n_i \geq 2$. This gives the result for $R = \mathbf Z$.
Notation. Given an Artinian local ring $(R,\mathfrak m)$ with $\mathfrak m^n = 0$ and $\mathfrak m^{n1} \neq 0$, write $v \colon R \to \{0,\ldots,n\}$ for the function such that $(r) = \mathfrak m^{v(r)}$ for all $r \in R$. If $p = \operatorname{char}(R/\mathfrak m)$, write $e = v(p)$ (if $R = \mathcal O_K/\mathfrak m^n$ for a finite extension $\mathbf Z_p \to \mathcal O_K$, then $e$ is the minimum of $n$ and the ramification index of $\mathbf Z_p \to \mathcal O_K$).
Proof of Theorem. The Chinese remainder theorem gives $$R/I \cong \prod_{i=1}^r R/I_i,$$ so we get the same statement for the unit groups. Since a product $\prod_i A_i$ of finite abelian groups is cyclic if and only the $A_i$ are cyclic of pairwise coprime degrees (again by the Chinese remainder theorem!), we get criterion 1 and reduce to the case $r = 1$. We will drop all subscripts $i$ and write $I = \mathfrak m^n$ with residue field $k$ of characteristic $p > 0$. Replacing $R$ by $R/I$ we may assume that $\mathfrak m^n = 0$ and $\mathfrak m^{n1} \neq 0$, and we use the notation of Notation above. For $0 \leq i \leq j \leq n$ we get a short exact sequence $$1 \to \frac{1+\mathfrak m^i}{1+\mathfrak m^j} \to \big(R/\mathfrak m^j\big)^\times \to \big(R/\mathfrak m^i\big)^\times \to 1.\tag{1}\label{1}$$ Moreover, for $1 \leq i \leq j \leq 2i$ we have an isomorphism \begin{align*} \psi \colon \frac{\mathfrak m^i}{\mathfrak m^j} &\stackrel\sim\to \frac{1+\mathfrak m^i}{1+\mathfrak m^j}\tag{2}\label{2}\\ x &\mapsto 1+x. \end{align*} Indeed, it is clearly a bijection, and the formula $$(1+x)(1+y) = 1 + x + y + xy \equiv 1 + x + y \pmod{\mathfrak m^{2i}}$$ shows that $\psi$ is a homomorphism.
Criteria 2, 3, 4 are necessary
We will first show that criteria 2, 3, and 4 are necessary. We will use repeatedly that subquotients of cyclic groups are cyclic. For criterion 2, if $n > 1$ then the sequence (\ref{1}) and the isomorphism (\ref{2}) for $(i,j) = (1,2)$ show that $$\mathfrak m/\mathfrak m^2 \hookrightarrow \big(R/\mathfrak m^2\big)^\times.$$ Thus if $R^\times$ is cyclic, so are $(R/\mathfrak m^2)^\times$ and hence $\mathfrak m/\mathfrak m^2$, so $$\dim_{\mathbf F_p} \mathfrak m/\mathfrak m^2 = 1.$$ This also forces $k = \mathbf F_p$ since $\mathfrak m/\mathfrak m^2$ is actually a $k$vector space, proving criterion 2. This also implies that $\mathfrak m^i/\mathfrak m^{i+1} \cong \mathbf F_p = \mathbf Z/p$ for $i < n$, which together with the sequence (\ref{1}) and the isomorphism (\ref{2}) proves the formula $$a = \begin{cases}q1, & n = 1, \\ p^{n1}(p1), & n > 1. \end{cases}$$ For criterion 3, assume $p>2$. If $e = 1$, then $(p) = \mathfrak m$, so the unique map $\mathbf Z/p^n \to R$ is surjective (see e.g. Tag 00DV(11)), hence an isomorphism by length considerations. Thus it suffices to show that if $e > 1$ and $n \geq 3$, then $(R/\mathfrak m^3)^\times$ is not cyclic. The truncated exponential \begin{align*} \exp \colon \mathfrak m/\mathfrak m^3 &\to \big(R/\mathfrak m^3\big)^\times\\ x &\mapsto 1 + x + \tfrac{x^2}{2} \end{align*} is an injective group homomorphism (here we use $p > 2$). Since $e \geq 2$, every element in $\mathfrak m/\mathfrak m^3$ is killed by $p$, so we conclude that $(R/\mathfrak m^3)^\times$ contains $\mathfrak m/\mathfrak m^3 \cong \mathbf Z/p \oplus \mathbf Z/p$, hence cannot be cyclic. This shows criterion 3.
For criterion 4, it is clear that $(\mathbf Z/8)^\times$ is not cyclic. Similar to the above, we see that $e = 1$ iff $R = \mathbf Z/2^n$, so it suffices to show that $(R/\mathfrak m^4)^\times$ is not cyclic if $n \geq 4$ and $e \geq 2$. For $x \in \mathfrak m^2$, we get $$(1+x)^2 = 1 + 2x + x^2 \in 1 + \mathfrak m^4$$ since $2 \in \mathfrak m^2$. Thus, all $4$ elements of $(1+\mathfrak m^2)/(1+\mathfrak m^4)$ have order $2$, so $(R/\mathfrak m^4)^\times$ is not cyclic. This shows criterion 4.
Criteria 2, 3, 4 are sufficient.
Conversely, given a finite Artinian local ring $(R,\mathfrak m)$ satisfying criteria 2, 3, and 4 (where $n = v(0)$ is the smallest integer such that $\mathfrak m^n = 0$), we have to show that $R^\times$ is cyclic. Clearly the case $n = 1$ is good, since $\mathbf F_q^\times$ is cyclic of order $q1$. The case $n = 2$ is also good, by the sequence (\ref{1}) and the isomorphism (\ref{2}): by assumption $\mathfrak m/\mathfrak m^2$ is cyclic of order $p$, and $k^\times$ is cyclic of order $p1$. Then the sequence (\ref{1}) for $(i,j) = (1,2)$ splits and the middle term is cyclic by the Chinese remainder theorem.
For $p > 2$ we have to show that $(\mathbf Z/p^n)^\times$ is cyclic. This follows since the $p$adic exponential \begin{align*} \exp \colon p\mathbf Z_p &\to 1 + p\mathbf Z_p\\ x &\to \sum_{i=0}^\infty \frac{x^i}{i!} \end{align*} converges (in general, it converges when $v(x) > \tfrac{e}{p1}$, so we're using that $e = 1$ and $p > 2$) and defines isomorphisms $p^i\mathbf Z_p \cong 1 + p^i\mathbf Z_p$ for all $i \geq 1$, hence an isomorphism $$\frac{1 + p\mathbf Z_p}{1+p^n\mathbf Z_p} \cong \frac{p\mathbf Z_p}{p^n\mathbf Z_p} \cong \mathbf Z/p^{n1}.$$ Then the sequence (\ref{1}) again splits (this time with $(i,j) = (1,n)$), and the Chinese remainder theorem shows that $(\mathbf Z/p^n)^\times$ is cyclic. (In fact the $p$adic exponential gives $\mathbf Z_p^\times \cong \mu_{p1} \times p\mathbf Z_p$, where $\mu_{p1}$ are the $(p1)^{\text{st}}$ roots of unity, so $\mathbf Z_p^\times$ is procyclic with generator $(\zeta_{p1},p) = \zeta_{p1}\exp(p)$ for a primitive $(p1)^{\text{st}}$ root of unity $\zeta_{p1}$.)
For $p = 2$ we have to show that $R^\times$ is cyclic if $n = 3$ and $e > 1$. We claim that $R^\times$ is generated by $1+\pi$ for any $\pi \in \mathfrak m \setminus \mathfrak m^2$. Indeed, $(1+\pi)^2 = 1 + 2\pi + \pi^2 \equiv 1 + \pi^2 \pmod{\mathfrak m^3}$ since $2 \in \mathfrak m^2$. Thus, $(1+\pi)^2 \neq 1$, so $1 + \pi$ has order $4$, hence generates.
This shows that the criteria are sufficient. We already saw that they are necessary and that the final statement holds. $\square$

$\begingroup$ This is amazing! Thank you so much! Out of curiosity for the infinite case, does there exist a ring $R$ with nonzero integral ideal $I$ such that $(R/I)^{\times} \cong \mathbb{Z}$? I think that such an example could come from group rings but I'm not certain $\endgroup$ – Daniel Santiago Apr 13 at 12:01

$\begingroup$ A commutative ring $R$ with $R^\times = \mathbf Z$ necessarily has characteristic $2$, since $1$ has order $2$ unless $1 = 1$. It is necessarily reduced since $1+x$ has order $2$ if $x \neq 0$ but $x^2 = 0$. An example is $R = \mathbf F_2[x,x^{1}]$, which is the group ring $\mathbf F_2[\mathbf Z]$. Any such $R$ contains $\mathbf F_2[x,x^{1}]$. Whenever $R$ is an example, so is the polynomial ring $R[x_i\ \ i \in I]$ for any set $I$. Classifying such rings is almost certainly impossible (as is for example writing down all $\mathbf C$algebras with $R^\times = \mathbf C^\times$). $\endgroup$ – R. van Dobben de Bruyn Apr 13 at 23:03
$\newcommand{\F}{\mathbb{F}} \newcommand{\Z}{\mathbb{Z}}$ [Throughout this answer all rings will be commutative (and unital!).]
It seems that van Dobben de Bruyn has essentially rediscovered a theorem of Gilmer:
Gilmer, Robert W., Jr. Finite rings having a cyclic multiplicative group of units. Amer. J. Math. 85 (1963), 447452.
A couple of preliminary comments: (i) In van Dobben de Bruyn's answer, we may as well take $I = (0)$: that is, he is giving necessary and sufficient conditions on a finite commutative ring to have cyclic unit group. (ii) A finite ring $R$ is indeed Artinian, hence a finite product $\prod_{i=1}^r R_i$ of local rings $R_i$, each of which must have prime power order. As seen in his answer, we quickly find that $R^{\times}$ is cyclic iff each $R_i^{\times}$ is cyclic and $\# R_1^{\times},\ldots, \# R_r^{\times}$ are pairwise coprime. Thus the critical case is the classification of finite local rings with cyclic unit group. Here is Gilmer's result:
Theorem Let $R$ be a finite local ring. Then $R^{\times}$ is cyclic iff $R$ is isomorphic to one of the following rings:
(A) A finite field $\F$.
(B) $\Z/p^a \Z$ for an odd prime number $p$ and $a \in \Z^+$.
(C) $\Z/4\Z$.
(D) $\Z/p\Z[t]/(t^2)$ for a prime number $p$.
(E) $\Z/2\Z[t]/(t^3)$.
(F) $\Z[t]/\langle 2t,t^22 \rangle$, a $\Z/4\Z$algebra of order $8$.
To compare Gilmer's classification to van Dobben de Bruyn's it is helpful to observe that the local rings of order $p^2$ are $\F_{p^2}$, $\Z/p^2\Z$ and $\Z/p\Z[t]/(t^2)$ and to know the six local rings of order $8$.
By the way, Gilmer's Theorem appears as Theorem 5.14 in this expository note of mine, where it used to derive Theorem 5.15, a 2013 result of HiranoMatsuoka that explicitly determines the product over all elements of the unit group of a finite ring. (Thus it is a generalization of Wilson's Theorem that $(p1)! \equiv 1 \pmod{p}$. It seems weird that it is so recent.) I wanted to include the proof of Gilmer's Theorem in the note, but it is rather long and computational. The proof of van Dobben de Bruyn looks a bit shorter!
A final comment leading to a question: It turns out that all the rings in Gilmer's classification are principal, i.e., every ideal is principal. (This is obvious except for (F), in which case you can see my paper if you don't want to do the calculation yourself.) In other words, for a finite ring $R$ the property that the unit group be cyclic forces every $R$submodule of $R$ to be cyclic. Is that just a coincidence, or can it be proved directly?

$\begingroup$ Wow thank you so much!! I had been told the classification results that I asked for along the lines of Gilmer's work exist but I had trouble finding them. It is amazing to see old results be rediscovered like this. $\endgroup$ – Daniel Santiago May 14 at 13:00

$\begingroup$ For your final question: as in my proof, it is necessary that $\mathfrak m/\mathfrak m^2$ has dimension $0$ or $1$ over $R/\mathfrak m$. Such rings are always principal; see e.g. Prop. 8.8 in Atiyah–MacDonald. (In fact, using the Cohen structure theorem plus a little computation, any finite local Artinian ring with $\dim \mathfrak m/\mathfrak m^2 = 1$ can be written as a quotient of a finite extension of $\mathbf Z_p$ ― this was my first approach until I realised it's really a question about Artinian rings.) $\endgroup$ – R. van Dobben de Bruyn May 14 at 16:46
