I have the following alphabet $\Sigma = \{0,\dots,9\}$ and the following language over $\Sigma \cup \{\#\}$: $$L=\{\#w \ |\ w \in\Sigma^*,\sum_{i\geq1}w_i\ \text{is prime}\}\\\\$$ This language represents all numbers wich have a prime as digit sum. I now want to show that this language is not context free. I want to show this with a reductio ad absurdum via the pumping lemma and I am not quite sure if I proofed it correctly:
My idea was to just pick a word wich is in $L$ and then show that it cannot be pumped up with the pumping lemma and because if the language is context free every word can be pumped up this shows that $L$ is not context free. But I am not quite sure if this is enough.
Let's assume that L is context free. Then the pumping lemma states that there is a number $k \in \mathbb{N}$ for wich every word $w \in L$ with $|w|\geq k$ can be splitted up like the following $w=xuyvz$ where the following constraints hold:
- $0<|uv|\leq|uyv|\leq k$
- $\forall n \in \mathbb{N}:xu^nyv^nz \in L$
Let $k=5$ and $w=\#11111$ because $|w|=6 \Rightarrow |w|\geq k$. We can split up $w$ like this $w=xuyvz$ where the following holds:
- $x=\#$
- $u=1$
- $y=11$
- $v=1$
- $z=1$
Because $|uv|=2 \ \land \ |uyv|=4 \Rightarrow 0<|uv|\leq|uyv|\leq k$. Now $\forall n \in \mathbb{N}:xu^nyv^nz \in L$ should also be true. But let $n=3$ then $w'=\#111111111 \notin L$. Thus $L$ is not context free, because the pumping lemma with a number $k \in \mathbb{N}$ is not working for every $w$ with $|w|\geq k$.
I am self learning and have no one who can help me with this, so I really would appreciate if someone could tell me if this proof is working or how I can improve it.