Porter's constant

edit · history · discussion · files · short url · continued fractions algorithms number theory
Number
$C_P$
1.467078079433975472897798484707229953449903322414887777399685817616606744329044808430369327511174015
Definition
For an integer $q\geq2$, let $\ell(p/q)$ count the entries, including the initial zero, in the canonical simple continued fraction of a reduced fraction $p/q$. Porter's constant $C_P$ is defined by $\frac1{\varphi(q)}\sum_{\substack{1\leq p<q\\\gcd(p,q)=1}}\ell(p/q)=\frac{12\log2}{\pi^2}\log q+C_P+o(1)$ as $q\to\infty$, where $\varphi$ is Euler's totient function [1].
Formulas
(1)
$C_P=\frac{\log2}{\zeta(2)}\left(3\log2+4\gamma-4\frac{\zeta'(2)}{\zeta(2)}-2\right)-\frac12$, where $\zeta$ is the Riemann zeta function, $\zeta'$ its derivative, and $\gamma$ the Euler-Mascheroni constant [1].
(2)
$C_P=\frac{6\log2}{\pi^2}\left(48\log A-\log2-4\log\pi-2\right)-\frac12$, where $A$ is the Glaisher-Kinkelin constant, characterized by $\log A=1/12-\zeta'(-1)$ with $\zeta$ the Riemann zeta function. This follows from (1) and the zeta reflection formula [4].
Comments
(3)
Write $p/q=[0;b_1,\ldots,b_s]$, with positive integer partial quotients and $b_s\geq2$. Then $\ell(p/q)=s+1$; the number of divisions in Euclid's algorithm is $s$, whose mean has constant term $C_P-1$ [1].
(4)
All logarithms are natural. The average is uniform over the reduced numerators at each fixed denominator; averaging over all denominators up to a bound is a different ensemble.
(5)
The name Lochs-Porter constant is also used for $C_P$ [3]. Lochs's constant is the distinct decimal-digit conversion rate $6\log2\log10/\pi^2$.
Programs
(P1)
Sage
import numberdb.sage as numberdb
from sage.rings.real_arb import RealBallField
R = RealBallField(512)
l = R(2).log()
z = R(2).zeta()
print(l/z * (3*l + 4*R.euler_constant() - 4*R(2).zetaderiv(1)/z - 2) - R(1)/2)
References
[1]
A. V. Ustinov, Asymptotic behaviour of the first and second moments for the number of steps in the Euclidean algorithm, Izvestiya: Mathematics 72(5) (2008), 1023-1059, sections 1-2, especially p. 1024. (doi)
Links
Similar tables
Lévy's constant —   Its logarithmic convention is $\beta=\pi^2/(12\log2)$, so the coefficient of $\log q$ in the defining mean is $1/\beta$.
Lochs's constant —   It is $\kappa\log10/2$ with $\kappa=12\log2/\pi^2$, whereas $C_P$ is the additive intercept in the fixed-denominator mean.
Values of the derivative $\zeta'(s)$ of the Riemann zeta function at rational numbers —   The value $\zeta'(2)$ occurs in the closed form for $C_P$.
Values of the logarithmic derivative $\zeta'(s)/\zeta(s)$ of the Riemann zeta function at rational numbers —   The value $\zeta'(2)/\zeta(2)$ occurs in the closed form for $C_P$.
Glaisher-Kinkelin constant $A$ —   Its logarithm gives the alternative closed form for $C_P$.
Data properties
Entries are of type: real number
Table is complete: yes (the sole named constant is stored, with the initial zero counted)
How they were obtained:

The zeta formula is evaluated using Sage 10.9 real Arb balls at 512 working bits [5]. The derivative is computed by RealBall.zetaderiv(1) at the exact argument 2. The final radius is below $10^{-150}$, and exact outward dyadic endpoints of the complete ball lie inside the interval represented by the stored 100-significant-digit decimal. All input constants and logarithms carry their uncertainties.

more

Independent mpmath 1.4.1 evaluations of the Glaisher formula and of the zeta derivative formula at 160 and 220 decimal digits lie inside the stored interval. The first 99 unrounded digits agree with [3]. Exact continued-fraction and Euclidean-division counts agree on all 3043 reduced fractions with denominators from 2 through 100; these check indexing, not the asymptotic limit. A known-value interval control passes, and shifts by 1 and by two last-place units are rejected. The attached generator, checks, inputs and evidence reproduce these results.