<s>[INST] Sum of the reciprocal $P$-smooth numbers for $P = \{ p, q \}$ ?? For distinct primes $p$ and $q$ (where $p < q$), the following sum
$$\sum_{n=0}^{\infty} \sum_{k=0}^n \frac{1}{p^n q^k}$$
yields the expression $\frac{f}{g}$ such that
$$f = p^2 q$$
and
$$g \equiv 1 \ (\text{mod} \ p).$$
The problem I'm having is finding an expression for $g$ in terms of $p$ and $q$. I'm probably just overlooking something.
 [/INST] Wikipedia's Geometric series article gives the formulas for the sums of a finite & infinite geometric series of
$$\sum_{k = 0}^{n-1}ar^k = a\left(\frac{1-r^n}{1-r}\right) \tag{1}\label{eq1A}$$
$$\sum_{k = 0}^{\infty}ar^k = \frac{a}{1-r}, \text{ for } \left|r\right| \lt 1 \tag{2}\label{eq2A}$$
Using \eqref{eq1A} and \eqref{eq2A}, plus making a few other manipulations as shown below, gives the following simplifications of your double summation
$$\begin{equation}\begin{aligned}
\sum_{n=0}^{\infty} \sum_{k=0}^n \frac{1}{p^n q^k} & = \sum_{n=0}^{\infty}\frac{1}{p^n} \sum_{k=0}^n \frac{1}{q^k} \\
& = \sum_{n=0}^{\infty}\frac{1}{p^n}\left(\frac{1-\left(\frac{1}{q}\right)^{n+1}}{1-\frac{1}{q}}\right) \\
& = \sum_{n=0}^{\infty}\frac{1}{p^n}\left(\frac{q-\left(\frac{1}{q}\right)^{n}}{q - 1}\right) \\
& = \left(\frac{1}{q-1}\right)\left(q\sum_{n=0}^{\infty}\frac{1}{p^n} - \sum_{n=0}^{\infty}\left(\frac{1}{pq}\right)^n \right) \\
& = \left(\frac{1}{q-1}\right)\left(\frac{q}{1-\frac{1}{p}} - \frac{1}{1 - \frac{1}{pq}}\right) \\
& = \left(\frac{1}{q-1}\right)\left(\frac{pq}{p - 1} - \frac{pq}{pq - 1}\right) \\
& = \left(\frac{pq}{q-1}\right)\left(\frac{(pq - 1) - (p - 1)}{(p - 1)(pq - 1)}\right) \\
& = \left(\frac{pq}{q-1}\right)\left(\frac{pq - p}{(p - 1)(pq - 1)}\right) \\
& = \left(\frac{p^2q}{q-1}\right)\left(\frac{q - 1}{(p - 1)(pq - 1)}\right) \\
& = \frac{p^2q}{(p - 1)(pq - 1)}
\end{aligned}\end{equation}\tag{3}\label{eq3A}$$
As such, you have
$$g = (p - 1)(pq - 1) \tag{4}\label{eq4A}$$
Note this also confirms the modulo statement you have of
$$g \equiv 1 \pmod p \tag{5}\label{eq5A}$$
</s>