Let $\alpha$ be a number with continued fraction $[a_0; a_1, a_2, ...]$, and let $\frac{p_k}{q_k}=[a_0;a_1,a_2,...,a_k]$ be the $k$-th convergent. I'm interested in how many different fractions produce a convergent with $p_k=n$, which I will call $T(k,n)$. Also, define $T^*(k,n)$ to be cases where $a_0\ne 0$. Below, I use Euler's Rule for continuants to express $p_k$: https://en.wikipedia.org/wiki/Continuant_(mathematics)#Properties. For example:
$p_1=a_0a_1+1=5$ if $\alpha=[4;1,...], [2;2,...],$ or $[1;4,...]$. So $T(1,5)=3$. In fact, $T(1,n)=T^*(1,n)=\sigma(n-1)$ (the number of divisors of $n-1$) for $n>1$ and $T(1,1)=\infty$.
$p_2=a_0a_1a_2+a_0+a_2=3$ if $\alpha=[0;z,3,...],[1;1,1...]$, where $z\in \mathbb{N}$. Because $a_0$ can be zero, $T(2,k)=\infty$. But if we exclude $a_0=0$ then we get $T^*(2,3)=1$.
$p_3=a_0a_1a_2a_3+a_0a_1+a_0a_3+a_2a_3+1=7$ if $\alpha= [0;z,1,6,..], [0;z,2,3,..], [0;z,3,2,..],[0;z,6,1,..], [1;1,2,1,..], [1;2,1,1..]$, so $T(3,7)=\infty$ and $T^*(3,7)=2$.
I want to know if there are known formulas for $T(k,n)$ or $T^*(k,n)$.