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$?



Mean value of a function associated with continued fractions
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](http://iam.khv.ru/articles/Ustinov/nth13_eng.pdf))
$$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](http://iam.khv.ru/articles/Ustinov/nth19_eng.pdf)). 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.$$


