Pumping lemma proves L = p prime not context-free, though a Turing machine can recognize it via Sieve of Eratosthenes simulation.
The language
is not context-free. This can be shown by using the pumping lemma for context-free languages.
The pumping lemma states that if a language L is context-free, then there exists a pumping length p such that for any string s in L of length at least p, there exists a substring w of length at most p such that removing w from s and replacing it with any other string of the same length results in a string that is also in L.
However, for the language L, no such pumping length exists. Consider the string a^{11}. This string is in L because 11 is a prime number. However, no matter what substring w we remove from a^{11} and replace it with another string of the same length, the resulting string will not be in L. For example, if we remove the substring a from a^{11} and replace it with b, we get the string ba^{10}, which is not in L because 10 is not a prime number.
Therefore, the language L is not context-free.