Given positive integers $ k $ and $ n $, I would like to generate a list of all the finite continued fractions of length $ k $ in the interval $ [0,1] $ whose partial quotients are bounded above by $ n $.
For instance, when $ k=3 $ and $ n=2 $, the list would be:
$$ \left\{ \frac{1}{1+\frac{1}{1+\frac{1}{1}}}, \frac{1}{1+\frac{1}{1+\frac{1}{2}}}, \frac{1}{1+\frac{1}{2+\frac{1}{1}}}, \frac{1}{1+\frac{1}{2+\frac{1}{2}}}, \frac{1}{2+\frac{1}{1+\frac{1}{1}}}, \frac{1}{2+\frac{1}{1+\frac{1}{2}}}, \frac{1}{2+\frac{1}{2+\frac{1}{1}}}, \frac{1}{2+\frac{1}{2+\frac{1}{2}}} \right\} = \left\{ \frac{2}{3}, \frac{3}{5}, \frac{3}{4}, \frac{5}{7}, \frac{2}{5}, \frac{3}{8}, \frac{3}{7}, \frac{5}{12} \right\}. $$
From this question, it is easy to produce a function that takes a string of integers and gives the corresponding continued fraction:
Contfrac[terms_List] := Fold[1/(#2 + #1) &, Reverse@terms]
For instance, evaluating
Contfrac[{1,1,1}]
returns $ \frac{2}{3} $, as desired. I'm guessing I can generate the list using this function and $ \texttt{Array} $ somehow, but my naive attempt
Array[Contfrac, {2, 2, 2}]
for the above example fails. Any suggestions?