How to show that the language $L = \{a^n , n \geq 10000 \text{ and $n$ is prime number}\}$ is not context-free using closure property?

65 Views Asked by At

I proved $L' = \{a^n \mid n \text{ is a prime number}\}$ is not context-free language using the pumping lemma. But I couldn't derive that $L$ is not a context-free language by using closure properties of context-free languages and the result that $L'$ is not context-free.

1

There are 1 best solutions below

0
On

Hint. Two possibilities:

(1) You can use the fact that a context-free language on a one-letter alphabet is regular.

(2) You can also observe that $L = L' \cap K$ where $K$ is the set of all words of length $\geqslant 10000$.