Mean value of a function associated with continued fractions

Suppose that an irrational $x$ in $(0,1)$ has convergents $c(k,x)$, and let

$$d(x) = \sum_{k=0}^{\infty} \mid x - c(k,x)\mid.$$

What is the mean value of $d$?

• The function $d(x)$ is continuous at any irrational $x$. So it is sufficient to know $d(x)$ for rational $x$. – Alexey Ustinov Jan 5 '16 at 6:04
• Are there any reasons to study this constant? – Alexey Ustinov Jan 5 '16 at 11:41
• Think of $d(x)$ as the deviance of x from its continued fraction, maximized by the golden ratio, with maximal value approximately $1.195955786017513596003474800021$. (One can also define upper and lower deviances, which are also maximized by the golden ratio.) I raised the question about the "mean deviance" because of the possibility that it doesn't exist; viz., is $d$ Lebesgue integrable? – Clark Kimberling Jan 12 '16 at 20:30

If $\frac{p_{2k}}{ q_{2k}}$ and $\frac{p_{2k+1}}{ q_{2k+1}}$ ($k\ge 0$) are consecutive convergents of the continued fraction expansion of $x$ then $$\left|x-\frac{p_{2k}}{ q_{2k}}\right|+\left|x-\frac{p_{2k+1}}{ q_{2k+1}}\right|=\frac{p_{2k+1}}{ q_{2k+1}}-\frac{p_{2k}}{ q_{2k}}=\frac{1}{q_{2k}q_{2k+1} }.$$
For example if $x=\frac{\sqrt{5}-1}{2 }$ then $$d(x)=\frac{1}{ F_1F_2}+\frac{1}{ F_3F_4}+\frac{1}{ F_5F_6}+\ldots=\frac{1}{ 1\times 1}+\frac{1}{2\times 3}+\frac{1}{5\times 8}+\ldots$$
Each interval $\left(\frac{a}{ b},\frac{c}{ d}\right)\subset(0,1)$ s.t. $ad-bc=-1$ may occur as $\left(\frac{p_{2k}}{ q_{2k}},\frac{p_{2k+1}}{ q_{2k+1}}\right)$. It means that $$D=\int_{0}^{1}d(x)dx=\sum_{{ad-bc=-1,b\le d\atop 0\le\frac{a}{ b}<\frac{c}{ d}\le 1}}\lambda\left(\frac{a}{ b},\frac{c}{ d}\right)\frac{1}{bd },$$ where $\lambda\left(\frac{a}{ b},\frac{c}{ d}\right)$ is a measure of the set $$\left\{x:\frac{a}{ b},\frac{c}{ d}\text{ are consecutive convergents of the continued fraction expansion of } x\right\}.$$ It is known that two fractions $\frac{P}{ Q}$ and $\frac{P'}{ Q'}$ are consecutive convergents of the continued fraction expansion of $x$ (and, moreover, the convergent $P/Q$ precedes the convergent $P'/Q'$ iff (see Lemma 1 here) $$0<\frac{Q'x-P'}{-Qx+P }<1.$$ For $P/Q<P'/Q'$ (and $Q\le Q'$) this condition defines the interval $\left(\frac{P+P'}{Q+Q' },\frac{P'}{Q' }\right)$ of the length $\frac{1}{ Q'(Q+Q')}$, so $\lambda\left(\frac{a}{ b},\frac{c}{ d}\right)=\frac{1}{ d(b+d)}$ and $$D=\sum_{{ad-bc=-1,b\le d\atop 0\le\frac{a}{ b}<\frac{c}{ d}\le 1}}\frac{1}{b(b+d)d^2}.$$ For each pair of denominatos $(b,d)$ s.t. $1\le b\le d$ and $(b,d)=1$ numerators $a$ and $c$ are uniquely defined (see for example section 3 here). Hence
$$D=\sum_{1\le b\le d,(b,d)=1}\frac{1}{b(b+d)d^2}=\frac{1}{ \zeta(4)}\sum_{1\le b\le d}\frac{1}{b(b+d)d^2}.$$
Calculation of this sum is another problem. It is better to ask people from MZV-community. I can only simplify it a little: $$\sum_{1\le b\le d}\frac{1}{b(b+d)d^2}=D_1-D_2,$$ where $$D_1=\sum_{1\le b\le d}\frac{1}{bd^3}=\frac{\pi^4}{ 72},$$ and $$D_2=\sum_{1\le b\le d}\frac{1}{(b+d)d^3}=\zeta(3)\log 2-\int_{0}^{1}\frac{\mathrm{Li}_3(t^2)}{1+t }dt=2\int_{0}^{1}\frac{\mathrm{Li}_2(t)}{t}\log(1+t)dt.$$