As part of a Computation Theory exercise, I am asked to find a context free language for the language L = a^(2^k).
How I tried tackling it: I want to work with an X sentence that recursively doubles all the a's that were produced by other sentences. That will lead me only to strings like a, a^2, a^4, a^8 which is the grammar I'm looking for.
But is such a thing possible? How can I do this?
S -> aS | X | ε
Χ -> (doubles all previous a's)
And there is also the problem of doubling a string of a
s that would yield a number of a
s not accepted by the a^(2^k) condition, for example a^3, a^5, a^6 all fall "in-between" the progression gaps of a^(2^k).