Elements with equal annihilators 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.
 A: 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.  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.
