Examples of finite local rings of length 2 or 3 What is an example of a finite local rings, that has length 2 or 3? 
I want something different from $F_{q}[x] / x^{i}$ for $i=2, 3$; I'm looking for something more interesting. If you can give me examples of higher length, yet have "simple structure" (e.g. $F_{q}[x]/x^{i}$), that would be nice too. 
I know this is related to Classification of finite commutative rings, but I didn't completely understand the answer there. 
 A: There are a bunch of different notions of length/depth in ring theory:  Projective length, Artinian length, local depth, etc.  If we take length to mean Artinian length, then Charles is right:  The Artinian length of a finite-dimensional commutative algebra is just its dimension.  Every such algebra is a direct sum of local ones, and you can chip away at each local summand of the ring from the bottom end, one dimension at a time.
The local algebras that have a description that looks as nice as $\mathbb{F}[x]/(x^n)$ are the toric ones.  These local algebras are $\mathbb{F}[\vec{x}]$ divided by an ideal generated by monomials and a basis of monomials.  You can make a diagram of the exponents of the monomials that aren't killed by the ideal.  If the ring has $n$ generators, then the diagram is a stable stack of blocks in the $n$-dimensional orthant.  For example, the algebra $\mathbb{F}[x,y]/(x^3,x^2y,y^3)$ has a basis of seven monomials: 1, $x$, $x^2$, $y$, $xy$, $y^2$, $xy^2$.  The diagram of these monomials looks like this:
#
###
1##

I have put a 1 at the corner in the diagram corresponding to the monomial 1.
What is easy to forget is that all finite-dimensional local algebras with one generator in $m/m^2$ are of this form, but with more variables these are just special examples.

I was looking at the second part of the question first, interesting higher-dimensional examples.  Here are some non-isomorphic local rings $R$ (not necessarily algebras) that have length 2 or 3 and such that $R/m = \mathbb{Z}/p$:
Length 2:


*

*$(\mathbb{Z}/p)[x]/(x^2)$

*$\mathbb{Z}/p^2$


Length 3:


*

*$(\mathbb{Z}/p)[x]/(x^3)$

*$(\mathbb{Z}/p)[x,y]/(x^2,xy,y^2)$

*$(\mathbb{Z}/p^2)[x]/(px,x^2)$

* $(\mathbb{Z}/p^2)[\sqrt{p}]$  $\mathbb{Z}[\sqrt{p}]/p^{3/2} = \mathbb{Z}[x]/(x^2-\lambda p,x^3)$

*$\mathbb{Z}[x]/(x^2-\lambda p,x^3)$ where $\lambda \in \mathbb{Z}/p$ is not a square. (Noted by Jonathan Wise.)

*$\mathbb{Z}[x]/(x^2+2x,4)$ (Similar idea to previous, in characteristic 2.) 

*$\mathbb{Z}/p^3$


(Edit: My notation for #4 was not strictly correct.)
I think, although I can't really speak with authority, that these are all of them.  I thought that I knew all of these rings, but that was naive.   One point is that among algebras over $\mathbb{Z}/p$, the length is too small to see anything non-toric.  But you can also have local rings that look like these toric local algebras (which I listed first), but have carries.  The most creative one is the fourth one of length 3, namely $(\mathbb{Z}/p^2)[\sqrt{p}]$.  You can express an element of this ring as three digits in base $p$, say $d_2d_1d_0$.  Then addition carries from $d_0$ to $d_2$.
I would also guess that all of these generalize to $\mathbb{F}_q$, using the Witt vector construction in the cases with carries.  And maybe it is again all of them.
A: Any local rings of length 2 are of the form $R/n^2$ with $(R,n)$ a regular local ring of dimension 1.
Any local rings of length 3 are of the form $R/n^2$ with $(R,n)$ a regular local ring of dimension 2 or $R/n^3$ with $(R,n)$ a regular local ring of dimension 1.
Proof for the length 3 case: Let $A,m,k$ be our ring. Then the exact sequence:
$$ 0 \to m \to A \to k  \to 0 $$
shows that $length(m)=2$. So the number of generators of $m$ is at most 2. If it is 2, then 
$length(m/m^2)=2$, thus $m^2=0$. So $A=R/n^2$ with $(R,n)$ a regular local ring of dimension 2.
If it is 1, then $A$ is a quotient of a regular local ring of dimension 1, and counting length shows that we need to kill the cube of the (principal) maximal ideal. 
Of course, $R$ may or may not contains a field, so one may have things like $k[[x,y]]/(x^2,xy,y^2)$ or $Z_p[[x]]/(p^2,xp,x^2)$.
MORE: We can assume our regular $R$ is complete, since $A$, being Artinian, is complete. Then the  Cohen Structure Theorem completely described $R$. If $R$ contains a field, then 
$R \cong k[[x,y]]$. If $R$ is mixed charateristic and unramified, then $R\cong V[[x]]$, with 
$(V,pV)$ a discrete valuation ring. If $R$ is ramified, then $R=V[[x,y]]/(f)$, with $f=p+g$ such that $g \in (x,y)^2$. From those you can get $A$ accordingly by killing the square of the maximal ideal.   
A: I'm just going to consider the local rings with residue field $\mathbf{F}_p$.
Suppose A' is an extension of $\mathbf{Z}/p$ with ideal $\mathbf{Z}/p$.  If we take the fiber product with $\mathbf{Z}$, we get an extension of $\mathbf{Z}$ with ideal $\mathbf{Z}/p$.  Up to isomorphism, there is only one such extension: $B' = \mathbf{Z}[t] / (t^2, pt)$.  The kernel of the map from B' to A' is isomorphic to $\mathbf{Z}$ and reduces modulo t to the ideal generated by p.  Therefore, the square-zero extensions of $\mathbf{Z}/p$ are all isomorphic to $\mathbf{Z}[t] / (t^2, pt, p + \lambda t)$ for some $\lambda \not= 0$.  If $\lambda$ is not a multiple of p, we get $\mathbf{Z} / p^2$; if $\lambda$ is a multiple of $p$, we get $\mathbf{Z}[t] / (p, tp, t^2) = \mathbf{F}_p[t] / t^2$.  So these are all the length 2 finite local rings with residue field $\mathbf{F}_p$.
For length 3, we'll look for extensions of $\mathbf{Z} / p^2$ by $\mathbf{Z} / p$.  The same analysis shows that these are all of the form $\mathbf{Z}[t] / (t^2, pt, p^2 + \lambda t)$.  If $\lambda$ is not divisible by $p$, we get $\mathbf{Z} / p^3$ and if $\lambda$ is divisible by $p$ we get $\mathbf{Z}[t] / (p^2, pt, t^2)$.
We also have to look for extensions of $\mathbf{F}_p[t] / t^2$.  By base change, any such extension A' gives an extension B' of $\mathbf{Z}[t]$ with ideal $\mathbf{Z} / p$.  Once again, there is only one of these up to isomorphism (since $\mathbf{Z}[t]$ is projective, for example) and it is given by $\mathbf{Z}[t,u] / (u^2, pu, tu)$.  The ideal of the map from B' to A' generates the ideal of the map from $\mathbf{Z}[t]$ to $\mathbf{F}_p[t] / t^2$.  Since this is generated by p and t^2 the ideal of A' in B' is generated by $(p + \lambda u, t^2 + \mu u)$ and A' is of the form
$\mathbf{Z}[t,u] / (u^2, pu, tu, p + \lambda u, t^2 + \mu u)$
for some polynomials $\lambda, \mu \in \mathbf{Z}[t]$.  

Edit: If $\lambda$ is not in $(p, t)$ then it is invertible in the quotient, so we get 
$\mathbf{Z}[t,u] / (p^2, tp, t^2 + \mu \lambda^{-1} p)$.
There are two possibilities up to isomorphism here, depending on whether $- \mu \lambda^{-1}$ is a quadratic residue modulo p.
If $\lambda$ is in $(p,t)$ we get
$\mathbf{Z}[t,u] / (u^2, pu, tu, p, t^2 + \mu u) = \mathbf{F}_p[t,u] / (u^2, tu, t^2 + \mu u)$.
The $\mu$ is also not in $(p, t)$ then we get $\mathbf{F}[t] / t^3$.  If $\mu$ is in $(p,t)$ we get $\mathbf{F}_p[t,u] / (u^2, tu, t^2)$.
Modulo any mistake I made above, I think a complete list is of length 3 finite local rings with residue field $\mathbf{F}_p$ is


*

*$\mathbf{Z} / p^3$,

*$\mathbf{Z}[t] / (p^2, pt, t^2)$,

*$\mathbf{Z}[t] / (t^2 - p, t^3)$,

*$\mathbf{Z}[t] / (t^2 - \alpha p, t^3)$ where $\alpha$ is a non-quadratic residue modulo $p$,

*$\mathbf{F}_p[t] / t^3$, and

*$\mathbf{F}_p[t,u] / (t,u)^2$.

A: Isn't that the only one of length two? And for length three, shouldn't $\mathbb{F}_q[x,y]/(x^2,xy,y^2)$ work? I believe (possibly incorrectly) that here length and dimension over the base field agree.
