Sums of digits of prime numbers: reference request I wonder if someone could point out to me a paper on the following problem, if it has been considered at all. If not, it would still be nice to have some good references to good papers related to the following problem:
Fix $q \geq 2$ and consider $q$-adic expansions of prime numbers $p$:
$$
p = \sum_{i=0}^\infty a_i q^i
$$
for integers $a_i$ with $0 \leq a_i \leq q-1$. 
Problem: Given a finite set $I \subseteq \mathbb{N}_0$ and a positive integer $s$ (with both $s, I$ reasonable enough to avoid trivial non-existence cases), does there exist a prime number $p = (a_0, a_1, \ldots)_q$ such that 
$$
\sum_{i \in I}a_i = s?
$$
Thanks very much.
Update: A.P. has given a nice answer to the problem. His proof follows partly from the fact that $I$ is fixed and so one can invoke Dirichlet's theorem after a trick. I think one could make this harder by making some restrictions, although I can imagine one walks into conjecture territory, such as the Mersenne prime conjecture. 
New problem: Fix an integer $q \geq 2$ and a positive real number $x$. Let $\mathcal{P}_x$ be the set of prime numbers up to $x$. There exists an index $N := N_q(x)$ such that for all $j > N$, we have $a_j(p) = 0$ for all $p \in \mathcal{P}_x$, where $a_j(p)$ is the $j$-th digit of $p$ in its $q$-adic representation.
Assume $N$ is the smallest such index (for all $p \in \mathcal{P}_x$). 
For what sets $I \subseteq [0,N] = \{0, 1, \ldots, N\}$ and positive integers $s$ can we prove there exists a prime $p \in \mathcal{P}_x$ such that
$$
\sum_{j \in I} a_j(p) = s?
$$
Again, if you know nice papers on the topic don't be shy to point them out! Thanks again.
 A: Actually, we can solve a harder problem, namely:
Proposition. Fix an integer $q \geq 2$. Furthermore, let $I \subset \Bbb{N}_0$ be a finite set and consider integers $0 \leq \alpha_i < q$ for $i \in I$. If either $0 \notin I$ or $\gcd(\alpha_0,q)=1$, then there are infinitely many primes
$$
p = \sum_{k=0}^\infty a_k q^k
$$
such that $a_i = \alpha_i$ for every $i \in I$.
Proof: Let $m$ be the maximum of $I$, and for every $0 \leq j < m$ not in $I$ define $\alpha_j = \delta_{0j}$, where $\delta$ is the Kronecker delta. Then the hypothesis on $\alpha_0$ implies that
$$
\alpha := \sum_{i = 0}^m \alpha_i q^i
$$
is comprime with $q$, hence $\alpha$ is coprime with $d := q^{m+1}$, too. Then the proposition follows from Dirichlet's theorem on arithmetic progressions, which states that the sequence
$$
\{\alpha + n d\}_{n=0}^\infty
$$
contains infinitely many primes. $\square$
Corollary. In the same setting of the above proposition, there is an effectively computable constant $c > 0$ such that the smallest prime $p$ with $a_i = \alpha_i$ for every $i \in I$ satisfies
$$
p \leq c q^{5\max I}.
$$
Proof: This follows immediately from Xylouris's refinement of Linnik's theorem (cfr. Xylouris's PhD thesis, theorem 2.1, page 12). $\square$
Corollary. Fix an integer $q \geq 2$. Let $I \subset \Bbb{N}_0$ be a finite set and consider an integer $0 \leq s \leq r(q-1)$, where $r := \#I$. Furthermore, if $0 \in I$ assume $s > 0$. If either $I \neq \{0\}$ or $\gcd(s,q)=1$, then there are infinitely many primes
$$
p = \sum_{k=0}^\infty a_k q^k
$$
such that
$$
\sum_{i \in I} a_i = s.
$$
Proof: Since $s \leq r(q-1)$ we can find integers $0 \leq \alpha_i < q$ such that $s = \sum_{i \in I} \alpha_i$. Moreover, observe that whenever $0 \in I$ we can choose $\alpha_0$ such that $\gcd(\alpha_0,q) = 1$. Indeed, if $I = \{0\}$ this is by hypothesis, otherwise let
$$
\alpha_0 =
\begin{cases}
q-1 & \text{if } s > q\\
1 & \text{otherwise}.
\end{cases}
$$
Now apply the proposition. $\square$
