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






















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?

  • 1
    $\begingroup$ Do the (seemingly unnecessary?) parenthesis here havy any meaning? $\endgroup$
    – flawr
    Commented Apr 24, 2016 at 13:07
  • 1
    $\begingroup$ Your result is interesting because you must know that for classical continued fractions "having a value $(a+b\sqrt{c})/d), \ a,b,d \in \mathbb{Z}, d \in \mathbb{N}$ " (i.e., a real solution to a quadratic with integer coefficients is equivalent to having a periodical (classical...) continued fraction. Thus your generalized development in continuous fraction should be transformable into a classical periodical cont. fraction décomposition. $\endgroup$
    – Jean Marie
    Commented Apr 24, 2016 at 13:50
  • $\begingroup$ Up to $F(20)$ is fine. :) $\endgroup$ Commented Apr 24, 2016 at 16:48
  • $\begingroup$ @Tito Piezas III: thanks for checking ,I've just added to the list $\endgroup$
    – Nicco
    Commented Apr 24, 2016 at 17:09

1 Answer 1


Given your continued fraction $F(x)$, it seems it has a general closed-form. Define,



$$F(x) = x-1-\frac{(x+1)\big(-x^3+12x+d\sqrt{d}\big)}{6(3x^2-4)}\tag2$$ hence,

$$G(x)=\frac{-x^3+12x+d\sqrt{d}}{6(3x^2-4)}=\cfrac{1}{x+\cfrac{(-1)(5)} {3x+\cfrac{(1)(7)}{5x+\cfrac{(3)(9)}{7x+\cfrac{(5)(11)}{9x+\ddots}}}}}\tag3$$

Plugging in $x$, you'll recover all your values, including the missing $F(15)$ and $F(19)$.

If $d$ as defined by $(1)$ is supposed to be square-free $d'$, then the negative Pell equation,

$$p^2-d'q^2 = -1\tag4$$

always has a solution.

  1. Even $x$: If $x=2v$, then $d'=v^2+1$, and $p =v,\;q = 1$.
  2. Odd $x$: Then $d'=x^2+4$, and $p=\frac{x(x^2+3)}{2},\;q=\frac{x^2+1}{2}$ while $p,q$ are integers since $x$ is odd.
  • $\begingroup$ Fantastic @Tito,however a rigorous proof establishing the closed form is still needed. $\endgroup$
    – Nicco
    Commented Apr 24, 2016 at 17:46
  • $\begingroup$ @Nicco: Yes. However, another interesting point is what is the cfrac for the other root, $$G'(x) = \frac{-x^3+12x\color{red}{-}d\sqrt{d}}{6(3x^2-4)}$$ $\endgroup$ Commented Apr 24, 2016 at 17:51
  • $\begingroup$ I think ,just taking the reciprocal of the cfrac we have is good enough just like it is done when we need the conjugate of $\phi$ using its simple continued fraction $\endgroup$
    – Nicco
    Commented Apr 24, 2016 at 19:46
  • $\begingroup$ Hm, using the reciprocal would do. By the way, how come you didn't find $F(15)$ and $F(19)$? $\endgroup$ Commented Apr 24, 2016 at 20:28
  • $\begingroup$ @ Tito Piezas III :please ,see this closely related question $\endgroup$
    – Nicco
    Commented May 7, 2016 at 14:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .