Let $R$ be a finite commutative ring with unity. Let $a \in R$ and define $C\_a = \{b \in R : \operatorname{ann}(a) = \operatorname{ann}(b)\}$.


I want to know the cardinality of the set $C\_a$.


For example,


If $a=0$ then $|C\_a| = 1$.


If $a$ is a unit then $|C\_a| = |U(R)|$ the set of units of $R$.


If $a$ is a zero divisor then I don't know the answer.


If $R$ is the ring of integers modulo $n$ and $a$ is a non-zero zero divisor then $C\_a = \{x \in \mathbb Z\_n : (x,n)=d\}$ where $a = md$ for a proper divisor $d$ of $n$.


If $R$ is a reduced ring, then $R \cong F\_{q\_1} \times \cdots \times F\_{q\_k}$, product of finite fields. Define $\operatorname{supp}(a) = \{1 \le i \le k : a\_i \text{ is a unit }\}$ where $a = (a\_1,\dots,a\_k) \in R$. Then $C\_a = \{b \in R: \operatorname{supp}(b) = \operatorname{supp} (a)\}$. From this the cardinality of $C\_a$ can be obtained.



Elements with equal annihilators
Here is a partial answer. If $R$ is a quasi-Frobenius ring (which since $R$ is commutative is the same a a Frobenius ring), then two elements have the same annihilator if and only if they are associates (differ by multiplication by a unit) if and only if they generate the same principal ideal. This covers your examples. Of course computing the size of $C\_a$ in this case amounts to computing the stabilizer of $a$ in the group of units $R^\times$.


The definition of quasi-Frobenius ring is [here](https://en.wikipedia.org/wiki/Quasi-Frobenius_ring). For a finite commutative ring, being quasi-Frobenius amounts to being a direct product of local rings with unique minimal ideals. It is shown in Proposition 15.20 of Lam's Lectures on Modules and Rings that any isomorphism between submodules of a finitely generated projective module over a quasi-Frobenius ring $R$ extends to an automorphism.


The ring $R$ is a free $R$-module and the ideals $Ra$ and $Rb$ are isomorphic if and only if $\mathrm{ann}(a)=\mathrm{ann}(b)$. If $R$ is quasi-Frobenius, this will occur if and only if there is an $R$-module automorphism $\alpha\colon R\to R$ with $\alpha(a)=b$. But $\alpha$ is then given by multiplication by some unit $u\in R^\times$ and so $b=ua$.


This is not true in the non-quasi-Frobenius case. Take the ring $R=(\mathbb Z/2\mathbb Z)[x,y]/(x^2,xy,y^2)$. Then $x+(x^2,xy,y^2)$ and $y+(x^2,xy,y^2)$ have the same annihilator but they do not differ by multiplication by a unit.


**Added.** In fact, I think there is basically no hope to have a purely ring theoretic description of the cardinality of $C\_a$. To explain, let me give an example. Let $A$ be any $n\times n$ symmetric zero/one matrix. Let $\mathbb F\_2$ be the two element field. Let $R=\mathbb F\_2[x\_1,\ldots, x\_n]/I$ where $I$ is generated by all monomials of degree $3$ and by all products $x\_ix\_j$ with $A\_{ij}=0$. Then $R$ is a local ring with nilpotent maximal ideal $J$ generated by the cosets of $x\_1,\ldots, x\_n$ and $J^3=0$. In particular, the annihilator of any element of $J^2$ is all non-units and the annihilator of any element of $a+J^2$ is the same as the annihilator of $a$ for $a\in J\setminus J^2$. Now the annihilator of $a\in J\setminus J^2$ is basically controlled by the matrix $A$. So the cardinality of these annihilators is determined by the size of $J^2$ (which I guess is ring theoretic) and the combinatorics of $A$ which can be just about anything.


