  Given $g\ge 1$, the number $n(g)$ of numerical semigroups $S \subset \N$ of
genus $|\N \setminus S|$ equal to $g$ is the subject of challenging conjectures
of Bras-Amor\'os. In this paper, we focus on the counting function $n(g,2)$ of
\textit{two-generator} numerical semigroups of genus $g$, which is known to
also count certain special factorizations of $2g$. Further focusing on the case
$g=p^k$ for any odd prime $p$ and $k \ge 1$, we show that $n(p^k,2)$ only
depends on the class of $p$ modulo a certain explicit modulus $M(k)$. The main
ingredient is a reduction of $\gcd(p^\alpha+1, 2p^\beta+1)$ to a simpler form,
using the continued fraction of $\alpha/\beta$. We treat the case $k=9$ in
detail and show explicitly how $n(p^9,2)$ depends on the class of $p$ mod
$M(9)=3 \cdot 5 \cdot 11 \cdot 17 \cdot 43 \cdot 257$.
