Why does this pattern fail (sometimes) for the continued fraction convergents of $\sqrt{2}$?

179 Views Asked by At

Remark: this question is based on a wrong numerical computation and persists only as an example for spurious imprecision in software (see comments)

This is connected to my post on the continued fraction convergents of pi. Motivated by Calvin Lin's comment whether a similar pattern exists for other constants, I checked $\sqrt{2}$. Its convergents are,

$$p_n = \frac{1}{1}, \frac{3}{2}, \frac{7}{5}, \frac{17}{12}, \frac{41}{29}, \frac{99}{70}, \frac{239}{169},\dots$$

Define the analogous $a,b,c$,

$$a_n,\,b_n,\,c_n = p_{n-2}-1,\;\; p_{n-1}-1,\;\; p_n-1$$

$$v_n=\text{Numerator}\,(a_n)\,\text{Numerator}(b_n)$$

and the same function in the other post,

$$F(n) = \sqrt{\frac{a_n c_n}{a_n-c_n}-v_n}$$

then for even $n>2$, we have,

$$\begin{array}{cc} n&F(n) \\ 4& \sqrt{2} \\ 6&5\sqrt{2} \\ 8&29\sqrt{2} \\ 10&169\sqrt{2} \\ 12&985\sqrt{2} \\ 14&5741\sqrt{2}\\ 16&33461\sqrt{2} \\ \vdots \\ 92&\sqrt{\text{huge number}} \\ 94&\text{integer}\sqrt{2} \\ \vdots \\ \end{array}$$

The sequence $1,5, 29, 169,985,\dots$ is A001653.

Question: Why does it fail at $n = 92$ (and other n as well) but, when it is $N\sqrt{2}$ again for some integer N, then N resumes being the correct kth term of the OEIS sequence?

Edit: As vadim123 pointed out, the case $n=94$ does in fact yield twice a square (and was just a bug in my old Mathematica V 4.)

1

There are 1 best solutions below

1
On BEST ANSWER

The likelihood of a new sequence agreeing with a known sequence for 45 terms, then never again, is very small. The likelihood of a sequence agreeing with a known sequence for (apparently) infinitely many terms, but disagreeing for some scattered subset, is almost nil. This is how I suspected that the disagreement was illusory.