While exploring the CSGs I wondered if the language $\{a^{n^2}|n>0\}$ could be expressed by one of them.
At the end of the question I'll write the (maybe) solution I came up with, yet that alone risks to be too cryptical. I'll write below the reasoning behind it, so that mistakes and inaccuracies will be easier to point out.
For reasons that will be cleare later we'll skip $a,a^4$ that can be easily added as special cases to the final result.
So the property we are going to use is $(n+1)^2-n^2=n^2-(n-1)^2+2$. So the idea is to keep track of how many a's we have to add to obtain the next square. To do this we can place a symbol F which will act as a sort of flag that after every iteration has to end up 2 positions righter.
(Note: when I say below that a symbol "moves" I mean that it does so thanks to swapping productions).
So far we can try to guess the first production which may be something like $$S\rightarrow aaaaaaaFaa $$ where S is the starting symbol and F is the flag. Then we need to "duplicate" the string to the left of the flag. We can do that by "moving" the flag to the left leaving a trail of new a's while doing so, something like $$ aF\rightarrow Faa $$ but then two problems would occur:
-the flag has to return to the original position plus two in order to "tell" to the next iteration how many a's have to be added
-the flag has to know when it's time to head back
To solve this we put a head symbol, say H, at the beginning of the future string (NOTE: flag and head will have to be deleted to obtain a valid string). Moreover, the flag, while going toward the head, will leave non-terminal symbols, say A's, that will remind later how many a's the flag initially had to its left.
When the flag hits the head it becomes a return symbol, say R, that only the A's can pass to the left of (through an ad hoc production). Also we want the A's to become a's only after having passed R, so we impose that the A, after passing the R, becomes a B and that only then it can become an a.
Note that, before proceeding any further, we want to make sure that all the A's have passed R and become B's, so we can make R become a check symbol, say C, that can only swap to the right if there is an a to the right. When C then hits an end symbol, say E, it turns into the returning check symbol, say $C_R$, which will activate the B's that will become a's (we'll see precisely how) becoming at the same time $aaF $, ready for another iteration.
Let's see how all this handy-waviness is translated in more precise productions: $$1. S\rightarrow HaaaaaaaFaaE$$ $$2. aF\rightarrow FAa$$ $$3. HF\rightarrow HR $$ $$4. aA\rightarrow Aa $$ $$5. RA\rightarrow BR $$ $$6. R\rightarrow C $$ $$7. Ca\rightarrow aC $$ $$8. CE\rightarrow C_RE $$ $$9. aC_R\rightarrow C_Ra $$ $$10. BC_R\rightarrow aaaF $$ $$11. Ba\rightarrow aa $$
Note that some of the above productions are not actually allowed in the CSGs but I think that they can all be reduced to more legitimate productions. 10. and 11. should activate a domino effect that turns all B's into a's, plus, 10. moves the flag 2 positions righter from the starting position.
Yet with those productions we still can't get rid of F,H and E, and we can't add a production that turns them into the empty string, as it wouldn't be allowed in a CSG, so we take even $a^9$ as a special case and we substitute 1. for $$S\rightarrow Ha^9Fa^4E $$ (note $a^4$ and not $a^7$ as we have to add 3 more a's at the end) and we add the productions $$H\rightarrow a $$ $$E\rightarrow a $$ $$F\rightarrow a $$
The obvious questions here are, is this solution correct? Is there a faster way to do that? Are there more powerful tools in CSGs that I could/should have used?
So with @Peter Leupold's hint I think we can make this CSG, which, while not shorter, is maybe more understandable and surely more elegant. $$S\rightarrow HX_1E $$ $$X_1\rightarrow A_1B|A_1XB$$ $$X\rightarrow AB|AXB$$ $$A_1B\rightarrow BA_2$$ $$A_2B\rightarrow BA$$ $$AB\rightarrow aBA$$ $$Aa\rightarrow aA $$ $$AE\rightarrow aE $$ $$aB\rightarrow Ba $$ $$HB\rightarrow Ha $$ $$H\rightarrow a $$ $$E\rightarrow a $$
Note that $A_1,A_2,X_1$ are needed to avoid epsilon-productions of $H $ and $E $.