How to prove {a^(n^2) | n>0} is not context-free?
[Since (a) this is an instance of a standard problem and (b) I wasn't able to find it in the archives, I'll expand my comment into a hinted solution.]

As usual in problems like this, we assume that the language $L$ is context free, so the Pumping Lemma applies, meaning that there is an integer $p&gt;0$ such that we can write the string $a^{p^2}$ as the concatenation of strings $uvxyz$ with $|vy|&gt;0$ and $|vxy|=t\le p$. Hence, we'll have 
$$
0 &lt; |vy|=t\le p
$$
This means that when we pump $uvxyz$ to $uv^ixy^iz$ we'll have 
$$
p^2&lt;|uv^ixy^iz|=p^2+(i-1)t\le p^2+(i-1)p
$$
Choosing $i=2$ gives us 
$$
p^2&lt;|uv^2xy^2z|\le p^2+p
$$
Now, in length order, the next string in $L$ after $a^{p^2}$ will be $a^{(p+1)^2}$. Here's the hint: use this fact to show that $uv^ixy^iz$ can't possibly be in $L$, contradicting the Pumping Lemma consequence that all the pumped strings are in $L$, so consequently $L$ cannot be a CFL.



This idiom, BTW, can be used to show that other languages over a one-symbol alphabet aren't context-free, like the $a^{n^5}$ language or the $a^p$ language, where $p$ ranges over the primes. There are more general results, as well, like the one that says that any CFL over a one-symbol language is regular. That, along with another theorem that says, roughly, that a regular language over a one-symbol language can't be too "sparse", gives a higher-level proof of your question.