Unrestricted grammar to generate $a^{n^2}$
Set aside $n$ of the $n^2$ characters, and use that $(n+1)^2 = n^2 + 2n +1$.

So at any moment we have (say) $n^2-n$ symbols $A$ and $n$ symbols $B$. 
We also need endmarkers. $L,R$ count as A$.

$S\to LBBR$

In one linear phase we visit all symbols, and each symbol $B$ will generate two extra $A$'s. Finally we add a $B$.

$L \to LX$; $XA\to AX$; $XB\to AABX$; $XR\to BR$ 

Nondeterministically end, transforming all symbols into $a$.