I have an exercise where one is supposed to give a function that will enumerate the following language:
$L_1 = \{ a^pb^p \hspace{1mm} |\hspace{1mm} p \in \mathbb{N} \hspace{1mm} \wedge \text{ (P is a prime number )} \}$.
The solution is the following function: $f: \mathbb{N} \rightarrow \Sigma^*$ with $f(i) = a^{p_{i+1}}b^{p_{i+1}}$, where $p_{i+1}$ is the $(i+1)^{th}$ prime number, ordered by the prime's order.
Could anyone explain to why does this solution work? And especially why does the function include $p_{i+1}$ instead of $p_{i}$ ?
Thank you!