Consider the generalized continued fraction
$$F(x)=(x-1)-\cfrac{(x+1)}{x+\cfrac{(-1)(5)} {3x+\cfrac{(1)(7)}{5x+\cfrac{(3)(9)}{7x+\cfrac{(5)(11)}{9x+\ddots}}}}}$$
I experimentally discovered that at certain cases it converges to quadratic irrationals $\frac{a+b\sqrt{d}}{c}$ where $a,b,c$ and$ d\gt1$(square free) are integers. Here's a list of some of its closed forms
$$F(1)=\frac{11+5\sqrt{5}}{3}$$
$$F(2)=-\sqrt{2}$$
$$F(3)=\frac{120-26\sqrt{13}}{69}$$
$$F(4)=\frac{109-25\sqrt{5}}{33}$$
$$F(5)=\frac{349-29\sqrt{29}}{71}$$
$$F(6)=\frac{258-35\sqrt{10}}{39}$$
$$F(7)=\frac{3610-212\sqrt{53}}{429}$$
$$F(8)=\frac{485-51\sqrt{17}}{47}$$
$$F(9)=\frac{8841-425\sqrt{85}}{717}$$
$$F(10)=\frac{1604-143\sqrt{26}}{111}$$
$$F(11)=\frac{5988-1250\sqrt{5}}{359}$$
$$F(12)=\frac{6105-481\sqrt{37}}{321}$$
$$F(13)=\frac{32395-1211\sqrt{173}}{1509}$$
$$F(14)=\frac{1754-625\sqrt{2}}{73}$$
$$F(16)=\frac{16891-1105\sqrt{65}}{573}$$
$$F(17)=\frac{27935-879\sqrt{293}}{863}$$
$$F(18)=\frac{12840-779\sqrt{82}}{363}$$
$$F(20)=\frac{12471-707\sqrt{101}}{299}$$
$$F(22)=\frac{26330-1403\sqrt{122}}{543}$$
$$F(23)=\frac{82390-2132\sqrt{533}}{1583}$$
$$F(26)=\frac{16036-765\sqrt{170}}{253}$$
To my surprise, the discriminants $d$ of the quadratic irrationals are only numbers for which the negative pell equation $x^2-dy^2=-1$ is solvable,see OEIS A031396.
Question:Can the link between the continued fraction and pell equation be proven?