I do not agree with inelegant in lulu's comment since I think that this is the only way to do it (Newton method being probably the simplest).
We are looking for the zero of function
$$f(r)=\sum_{k=0}^{n} p_k(1+r)^{y_k}-a$$
$$f'(r)=\sum_{k=0}^{n} p_k y_k (r+1)^{y_k-1}$$ Since $r$ is usually small,we could start with a Taylor series built at $r=0$ and get
$$\sum_{k=0}^{n}\left( p_k+ p_k\, y_k\,r+O\left(r^2\right)\right)=a$$ and, ignoring the higher order terms, start using
$$r_0=\frac{a-\sum_{k=0}^{n} p_k}{\sum_{k=0}^{n} p_k\,y_k}$$
For illustration purposes, let us try using $p_k=1 \, \forall k$ and let $y_k$ be the $(k+1)^{th}$ prime number and use $a=15$ and $n=10$. This will give
$$r_0=\frac 4 {160}=0.025$$ Now, using Newton, the iterates will be
$$\left(
\begin{array}{cc}
n & r_n \\
0 & 0.02500000000 \\
1 & 0.02436451415 \\
2 & 0.02436017132 \\
3 & 0.02436017112
\end{array}
\right)$$ which is the solution for ten significant figures.
Let us repeat using $p_k=y_k$ and $a=400$, this will give
$$r_0=\frac {240}{3358}\approx 0.0714711$$ to get as Newton iterates
$$\left(
\begin{array}{cc}
n & r_n \\
0 & 0.07147111376 \\
1 & 0.05031952032 \\
2 & 0.04259538909 \\
3 & 0.04177575220 \\
4 & 0.04176752146
\end{array}
\right)$$
Edit
The first iterate of Newton method is, by Darboux-Fourier theorem, an overestimate of the solution since $f(0)<0$ and $f''(0)>0$. We can avoid this overshoot of the solution using things such are
$$r_0=\frac{2 f(0) f'(0)}{f(0) f''(0)-2 f'(0)^2}$$
$$r_0=\frac{3 \left(f(0)^2 f''(0)-2 f(0) f'(0)^2\right)}{f(0)^2 f'''(0)+6 f'(0)^3-6
f(0) f'(0) f''(0)}$$ For the worked examples, this would give $r_0=0.0200,0.0202$ and $r_0=0.0389,0.0415$ using the simple
$$f(0)=\sum _{k=0}^n p_k-a\qquad f'(0)=\sum _{k=0}^n p_k\, y_k$$ $$f''(0)=\sum _{k=0}^n p_k \, (y_k-1)\, y_k\qquad f'''(0)=\sum _{k=0}^n p_k (y_k-2) (y_k-1) \,y_k$$ and fasten the convergence using Halley or Householder methods.
Update
It seems that the problem could be simpler to look to the zero of function
$$g(r)=\log\left(\sum_{k=0}^{n} p_k(1+r)^{y_k}\right)-\log(a)$$ which is much more linear than $f(x)$. Using the same approach as before, the first estimate would be
$$r_0=\frac{ \log (a)-\log \left(\sum _{k=0}^n
p_k \right)}{\sum _{k=0}^n p_k \, y_k }\sum _{k=0}^n p_k$$
For the first worked example, the iterations would be
$$\left(
\begin{array}{cc}
n & r_n \\
0 & 0.02132315132 \\
1 & 0.02437812501 \\
2 & 0.02436017174 \\
3 & 0.02436017112
\end{array}
\right)$$
For the second worked example, the iterations would be
$$\left(
\begin{array}{cc}
n & r_n \\
0 & 0.04365887942 \\
1 & 0.04177001681 \\
2 & 0.04176752065 \\
3 & 0.04176752064
\end{array}
\right)$$
Edit
Just out of curiosity, I performed $10,000$ runs in which all numbers were randomly selected
- $2 \leq r \leq 6$ percent
- $5 \leq p_k \leq 25$
- $5 \leq y_k \leq 25$
- $5 \leq n \leq 25$
A quick and dirty regression $r=a+b\, r_0$ leads to a very good correlation
$(R^2=0.9973)$ with highly significant parameters
$$\begin{array}{clclclclc}
\text{} & \text{Estimate} & \text{Standard Error} & \text{Confidence Interval}
\\
a & 0.00074 & 0.00002 & \{0.00070, 0.00078\} \\
b & 0.96101 & 0.00050 & \{0.96003, 0.96199\} \\
\end{array}$$