TITLE: Length of I/I^2 versus Ann(I)/Ann(I)^2 in Artinian rings.
QUESTION [13 upvotes]: Suppose that $(A,\mathfrak{m})$ is a local Artinian ring.
If $A$ is Gorenstein, then $A$ admits a dualizing functor
on finite length modules defined by $D(M):= Hom_A(M,A)$ which preserves
lengths.  If $M$ is a finite length $A$ module, let $\mathrm{length}(M)$
denote the length of $M$.
If $I$ is an ideal of $A$ and $J = \mathrm{Ann}(I)$, and
$A$ is Gorenstein, it is not hard to show that
$I = \mathrm{Ann}(J)$.
Question: Suppose that $A$ is a local Gorenstein Artinian ring, $I$ is an ideal,
and $J = \mathrm{Ann}(I)$. If $I$ is principal, is it the
case that
$$\mathrm{length}(J/J^2) \ge^{?} \mathrm{length}(I/I^2)$$
If so, can one characterize when equality holds?
Remarks:
1. If $J$ is also principal, then (reversing $I$ and $J$) one
predicts there should be an equality. One can show that this is the case.
However, equality sometimes occurs without $J$ being principal, as can be seen from
the example:
$A = \mathbf{F}_2[x,y]/(x^3,y^3)$, $I = (x^2+y^2)$, $J = (x^2 + y^2,xy)$, with
$\mathrm{length}(I/I^2) = \mathrm{length}(J/J^2) = 4$.
2. My reasons for believing that the answer to the question is "yes" are somewhat obscure, and I would not be entirely surprised if it turns out to be false.
3. I do not know a counterexample to the claim that $\mathrm{length}(J/J^2) \ge
\mathrm{length}(I/I^2)$ even without the Gorenstein hypothesis. I would
be interested in seeing such a counterexample, if one exists (although I'm more interested in the Gorenstein case).
EDIT: As usual with bounty questions, this has been "answered" although not yet completely solved --- further comments still welcome.

REPLY [6 votes]: The purpose of this separate answer is to address the other part of the question, when does equality happen? (also, my first answer is getting too long).
I.  As FC pointed out, equality happens if $J$ is principal (this can be proved using Fact 1 in my other answer). Consider the following:

$J$ is principal.
$R/I$ is Gorenstein.
$R/I$ is a complete intersection.

Then $(3)\Rightarrow (2) \Leftrightarrow (1)$. If $R$ is a complete intersection, then $(2)\Rightarrow (3)$. 
Sketch of proof: equivalent of (1) and (2) can be proved using the Facts of my other answer. For example, since $J$ is isomorphic to the canonical module of $R/I$, $R/I$ is Gorenstein forces $J$ to be principal. The last statement follows from a cute result by Kunz that an almost complete intersection is never Gorenstein! (E. Kunz, Almost complete intersections are not Gorenstein, J. Alg. 28(1974), 111–-115)
II. By my 10/04/10 update in the answer above, if $R$ has SLP (for example when $R$ is a monomial complete intersection, and conjecturally for all complete intersections), $k$ has char. $0$ and the socle degree is odd, then equality  occurs for $I$ generated by a general linear form (it may or may not happen when the socle degree is even).
For example, equality happens  $I=(x+y+u+v)$ in $R=\mathbb Q[x,y,u,v]/(x^6,y^7,u^7,v^7)$ (socle degree $23$) but not for $R=\mathbb Q[x,y,u,v]/(x^7,y^7,u^7,v^7)$ (socle degree $24$). Note that for such $I$, $J$ will typically not be principal unless if the number of variables is $2$, see part (III) below.
III. Here are some examples in positive characteristic, with the help of Macaulay 2 (thanks to Branden Stone for helping me with programming). Numerical evidences suggested:

Conjecture: Let $R=\mathbb Z/(p)[x,y]/(x^N,y^N)$ and $I=(x^n+y^n)$ with $N\geq n$. Then equality happens if and only if 
  there is an integer $k$ such that $N/n=k$ or $kp-1\leq N/n \leq kp+1$. 

Remark: the first condition is not surprising. In $2$ variables, if $n$ divides $N$  then $R/I$ is a complete intersection, so by part (I), equality happens. I think this one can be proved but did not have enough motivation to go through the details. The point is that $R/J$ is Gorenstein (Fact 3 above). In $2$ variables, this is the same as complete intersection, so $R/J$ is $k[x,y]/(f,g)$ so everything can be written down explicitly. Note that the length of $R/J$ is the product of degrees of $f,g$ by Bezout theorem.
I did not see any clear pattern when you have more variables. For example, when $R=\mathbb Z/(3)[x,y,z]/(x^N,y^N,z^N)$ and $I=(x^2+y^2+z^2)$, the values of $N$ between $2$ and $100$ such that equality fails to occur is  $3,9,27,33,75,81,99$. If you set the field to be $\mathbb Z/(5)$, those values will be $3,5,15,17,23,25,75,77,83,85,95,97$!