Unary prime-length language
Context-Free Grammars & Languages

Answer & solution
Answer: D (no official key was published)
1. Primality of the input length is decidable, so a Turing machine accepts the language. It is not regular: if a pumping length is p, choose prime q>p; a pumpable nonempty segment has length d≤p, and pumping it q+1 times changes length to q+qd=q(1+d), composite.
2. Every unary context-free language is regular (its length set is ultimately periodic/semilinear), so this language is not context-free either. Therefore D.

