Explain this convergence among Pythagorean triplets

$$\begin{align} a^{2}+(a+1)^{2}&=c^{2} \\ 2a^2+2a+1&=c^2 \\ 2\left(a+\frac{1}{2}\right)^2 +\frac{1}{2}&=c^2 \\ (2a+1)^2+1&=2c^2 \\ 2c^2-(2a+1)^2&=1 \\ 2c^2-d^2&=1 \quad | \quad d=2a+1 \end{align}$$

The above pell equation: $2c^2-d^2=1$ factors into $(c\sqrt 2-d)(c\sqrt 2 +d)=1$. With the initial solution being $(c_0,d_0)=(1,1)$, we have that $(\sqrt 2-1)(\sqrt 2 +1)=1$. Since we are permitted to multiply any equation by a constant we choose $(\sqrt 2-1)^2(\sqrt 2 +1)^2=(3-2\sqrt2)(3+2\sqrt 2)=1^2=1$. Doing this results in

$$\begin{align} (c\sqrt 2-d)(3-2\sqrt 2)(c\sqrt 2 +d)(3+2\sqrt 2)&=1 \\ &\implies \\ 2(3c+2d)^2-(4c+3d)^2&=1 \end{align}$$

This allows you to show iterative solutions:

$$\begin{cases} c_{k+1}=3c_k+2d_k \\ d_{k+1}=4c_k+3d_k \end{cases}$$

Which can be solved by the method I outlined here to produce:

$$c_k=\frac{2+\sqrt 2}{4} \left(3+2\sqrt 2\right)^k+\frac{2-\sqrt 2}{4} \left(3-2\sqrt 2\right)^k$$

note that the effect of $(3-2\sqrt 2)^k$ diminishes with increasing k, explaining your observation


The sequence $a_n$ is https://oeis.org/A001652.

This sequence is defined by $$\cases{a_n=6a_{n-1}+a_{n-2}+2\\ a_0=0\\a_1=3}$$

Therefore the ratio $r_n={a_n\over a_{n-1}}$ has limit $3+2\sqrt 2$ as observed by Klaus Brockhaus. I'll add a proof later.


The equation $a^2+(a+1)^2=c^2$ is equivalent to $$ (2a+1)^2+1=2c^2\tag1 $$ That is, $\frac{2a+1}c$ is a close under-approximation to $\sqrt2$. In fact, it can be shown that if $$ \left|\,\frac pq-r\,\right|\le\frac1{2q^2}\tag2 $$ then $\frac pq$ is a continued fraction convergent for $r$. From $(1)$, we get $$ \left(\sqrt2-\frac{2a+1}c\right)\left(\sqrt2+\frac{2a+1}c\right)=\frac1{c^2}\tag3 $$ From $(3)$, we get $$ \begin{align} \left(\sqrt2-\frac{2a+1}c\right)\sqrt2 &\le\left(\sqrt2-\frac{2a+1}c\right)\left(\sqrt2+\frac{2a+1}c\right)\\ &=\frac1{c^2}\\[3pt] &\le1\tag4 \end{align} $$ Thus, $\frac{2a+1}c\ge\sqrt2-\frac1{\sqrt2}$ and therefore $\sqrt2+\frac{2a+1}c\ge2\sqrt2-\frac1{\sqrt2}\gt2$. Applying $(3)$ again, we get that $$ \left|\,\frac{2a+1}c-\sqrt2\,\right|\le\frac1{2c^2}\tag5 $$ Thus, we see that $\frac{2a+1}c$ must be a convergent for $\sqrt2$.


If $\frac{2a+1}c$ is a convergent for $\sqrt2$, then it can be shown that $$ \left|\,\frac{2a+1}c-\sqrt2\,\right|\le\frac1{2c^2}\tag6 $$ If $\frac{2a+1}c\lt\sqrt2$, then we have $$ \begin{align} \left(\sqrt2-\frac{2a+1}c\right)\left(\sqrt2+\frac{2a+1}c\right) &\le\frac1{2c^2}\left(2\sqrt2+\frac1{2c^2}\right)\\ 2c^2-(2a+1)^2&\le\sqrt2+\frac1{4c^2}\tag7 \end{align} $$ which means that $a$ and $c$ satisfy $(1)$.


Thus, $(1)$ is satisfied precisely when $\frac{2a+1}c$ is a continued fraction convergent for $\sqrt2$ which is an under-estimate with odd numerator.


The continued fraction for $\sqrt2$ is $(1;\overline{2})$, so the convergents start $$ \begin{array}{c|c} &&1&2&2&2&2&\cdots\\\hline 0&1&\color{#C00}{1}&3&\color{#C00}{7}&17&\color{#C00}{41}&\cdots\\\hline 1&0&\color{#C00}{1}&2&\color{#C00}{5}&12&\color{#C00}{29}&\cdots \end{array}\tag8 $$ Because of the repetition of the continued fraction after the first term, the recurrence for the numerators and denominators for $n\ge1$ is $$ x_n=2x_{n-1}+x_{n-2}\tag9 $$ From this recurrence we get that all the numerators will be odd. It is a fact about continued fractions that convergents oscillate above and below the target limit, so that we only look at the convergents with even index: $1,\frac75,\frac{41}{29},\ldots$. Using $(9)$, we can derive the recurrence for every other numerator and denominator: $$ x_n=6x_{n-2}-x_{n-4}\tag{10} $$ This is the recurrence for the even indexed numerators and denominators from $(8)$; and thus, the possible values of $2a+1$ and $c$ from $(1)$: $$ \begin{array}{c|c} 2a_n+1&1&7&41&239&\cdots\\\hline c_n&1&5&29&169&\cdots \end{array}\tag{11} $$ where both $2a_n+1$ and $c_n$ satisfy the recurrence $$ x_n=6x_{n-1}-x_{n-2}\tag{12} $$ Solutions to the linear recurrence in $(12)$ are linear combinations of $\left(3+\sqrt8\right)^n$ and $\left(3-\sqrt8\right)^n$: $$ \begin{align} 2a_n+1&=\frac{1+\sqrt2}2\left(3+\sqrt8\right)^n+\frac{1-\sqrt2}2\left(3-\sqrt8\right)^n\tag{13}\\ c_n&=\frac{2+\sqrt2}4\left(3+\sqrt8\right)^n+\frac{2-\sqrt2}4\left(3-\sqrt8\right)^n\tag{14} \end{align} $$ $(13)$ gives the formula $$ a_n=-\frac12+\frac{1+\sqrt2}4\left(3+\sqrt8\right)^n+\frac{1-\sqrt2}4\left(3-\sqrt8\right)^n\tag{15} $$ As $n\to\infty$, $(14)$ and $(15)$ become asymptotically $$ \begin{align} a_n&\sim\frac{1+\sqrt2}4\left(3+\sqrt8\right)^n\tag{16}\\ c_n&\sim\frac{2+\sqrt2}4\left(3+\sqrt8\right)^n\tag{17} \end{align} $$