= Solution
This language is \b[not context-free]. Let $p$ be a proposed <pumping length> and choose $n$ with $3^n\geq p$. In any pumping decomposition of the unary word $a^{3^n}$, pumping once more increases its length by an integer $d$ with $1\leq d\leq p$. But
$$
3^n<3^n+d\leq2\cdot3^n<3^{n+1},
$$
so the pumped length is not a power of three, contrary to the <pumping lemma for context-free languages>. This is also an instance of the fact that a <unary context-free language is regular>, whereas the powers of three are not ultimately periodic.
Back to article page