Context-free grammar can generate the string $a^{2^n}$ for $n \geq 0$.The production rule P is $S \rightarrow SS | a$.The derivations is, for example:1) $S \Rightarrow a$ (this is when n = 0)2) $S \Rightarrow SS \Rightarrow aa$ (this is when n = 1)3) $S \Rightarrow SS \Rightarrow SS SS \Rightarrow aaaa$ (this is when n = 2)4) $S \Rightarrow SS \Rightarrow SS SS \Rightarrow SS SS SS SS \Rightarrow aaaa aaaa$ (this is when n = 3).Am I right?
Can context-free grammar generates $a^{2^n}$
context free