#### Calculating a continued fraction arising from an exceptional solution to Andrej Dujella's diophantine equation x^{2} − (k^{2}+1)y^{2} = k^{2}

We calculate the continued fraction of √(b/a), where b > a > 2, ab = k^{2} + 1, gcd(a, b) = 1.

Here a and b correspond to an exceptional solution (x, y) of Dujella's equation, i.e., where 1 ≤ y < k − 1:

if d = gcd(x + k, x − k), then a = gcd((x + k)/d, k^{2} + 1), b = gcd((x − k)/d, k^{2} + 1). See slides.
If a > b, it is convenient to interchange a and b.

All exceptional solutions are given by a recursively defined forest, starting from three types of root nodes:

- (t,t,0), t ≥ 2 (type 0),
- (t, t
^{2} + t + 1, t + 1), t ≥ 1 (type 1)
- (t, t
^{2} − t + 1, t − 1), t ≥ 2 (type -1).

A ternary expansion of n (digits 1, 0 or -1) determines a branch of the forest giving an exceptional solution as follows:

We find n = r _{0} + 3r_{1} + ··· + 3^{u −1}r_{u −1} + 3^{u}.

Then the exceptional solution (k,x,y) is obtained from a root node by applying first g+, then
successively g+, g0 or g-, according as r_{i} = 1, 0 or -1, for i = u-1,...,0.

We print the digit string r_{0}r_{1}···r_{u-1}1.
It is classical that the continued fraction is periodic after the first partial quotient. Here the period-length = 2h + 1, with partial quotients a_{0}, a_{1},..., a_{h}, a_{h},..., a_{1}, 2a_{0},... We print only a_{0}, a_{1},..., a_{h}.

This is done for t, t+1, t+2 and t+3, so as to allow guessing the linear polynomials in t that conjecturally form the partial quotients. The polynomial partial quotients are also given.

Three phenomena are clear experimentally:

- For exceptional solutions (k(t),x(t),y(t)) with root node (t,t,0), the period length is constant for t ≥ 2.
- For exceptional solutions (k(t),x(t),y(t)) with root node (t,t
^{2}+et+1,t+e), e=±1,
the period length for d = 1 is constant, say L, for t ≥ 2 and parity of t, while that for d = 2 is equal to 3L for t > 2 and opposite parity.
- If d = 1, all partial quotients are even.

*Last modified 14th January 2013*

Return to main page