The question with primes in the denominator:
The minimum that $r$ could possibly be is $C=\sum\limits_{i=1}^\infty\frac{1}{p_i^2}$. However, a sequence of $1$s and $2$s can be chosen so that $r$ can be any real number not less than $C$. Since $\sum\limits_{i=1}^\infty\left(\frac{1}{p_i}-\frac{1}{p_i^2}\right)$ diverges, consider the sum $ S_n=\sum_{i=1}^n b_i\left(\frac{1}{p_i}-\frac{1}{p_i^2}\right) $ where $b_i$ is $0$ or $1$. Choose $b_n=1$ while $S_{n-1}+\frac{1}{p_n}-\frac{1}{p_n^2}\le L-C$ and $b_n=0$ while $S_{n-1}+\frac{1}{p_n}-\frac{1}{p_n^2}>L-C$.
If we let $a_i=1$ when $b_i=1$ and $a_i=2$ when $b_i=0$, then $ \sum\limits_{i=1}^\infty\frac{1}{p_i^{a_i}}=\sum\limits_{i=1}^\infty\frac{1}{p_i^2}+\sum_{i=1}^\infty b_i\left(\frac{1}{p_i}-\frac{1}{p_i^2}\right)=C+(L-C)=L $ The question with non-negative integers in the denominator:
Changing $p_n$ from the $n^{th}$ prime to $n$ simply allows us to specify $C=\frac{\pi^2}{6}$. The rest of the procedure follows through unchanged. That is, choose any $L\ge C$ and let $ S_n=\sum_{i=1}^n b_i\left(\frac{1}{i}-\frac{1}{i^2}\right) $ where $b_i$ is $0$ or $1$. Choose $b_n=1$ while $S_{n-1}+\frac{1}{n}-\frac{1}{n^2}\le L-C$ and $b_n=0$ while $S_{n-1}+\frac{1}{n}-\frac{1}{n^2}>L-C$.
If we let $a_i=1$ when $b_i=1$ and $a_i=2$ when $b_i=0$, then $ \sum\limits_{n=1}^\infty\frac{1}{n^{a_i}}=\sum\limits_{n=1}^\infty\frac{1}{n^2}+\sum_{n=1}^\infty b_n\left(\frac{1}{n}-\frac{1}{n^2}\right)=C+(L-C)=L $ We don't need to worry about an infinite final sequence of $1$s in the binary number since that would map to a divergent series.