# Does the mean ratio of the perimeter to the hypotenuse of right triangles converge to $1 + \dfrac{4}{\pi}$?

Conjecture: Let $$\mu_x$$ be the arithmetic mean of the ratio of the perimeter to the hypotenuse of all primitive Pythagorean triplets in which no side exceeds $$x$$; then,

$$\lim_{x \to \infty}\mu_x = 1 + \frac{4}{\pi}$$

Based on data for $$x \le 10^{11}$$, the computed value agrees with the conjectured value up to $$5$$ decimal places.

Primitive Pythagorean triplets $$a^2 = b^2 + c^2, \gcd(b,c) = 1$$ are given by $$a = r^2 + s^2$$, $$b = r^2 - s^2$$ and $$c = 2rs$$ where $$r > s$$ are natural numbers. Let the $$n$$-th primitive triplet be the one formed by the $$n$$-th smallest pair in increasing order of $$(r,s)$$. It was proved in this post MSE that the arithmetic mean $$\mu_n$$ of the ratio of the perimeter to the hypotenuse of first $$n$$ primitive Pythagorean triplets approaches $$\dfrac{\pi}{2} + \log 2$$ as $$n \to \infty$$. However the above claim is still open.

Question: I am looking for a proof or disproof of this conjecture.

• You have some reason for believing the limit exists and equals $1+(4/\pi)$? – Gerry Myerson Oct 7 '19 at 5:45
• @GerryMyerson Three reasons to suspect the existence. (1) Similar limit of the first $n$ triplets exists and equals $\pi/2 + \log 2$ (2) May be related to Sieprinski's result that the number of triplets in which no side exceeds $x$ is $\frac{4x\log x}{\pi}+ O(x)$ and (3) Experiment data for $x \le 10^{11}$ seems to agree though this is the weakest of the three reasons. – Nilotpal Kanti Sinha Oct 7 '19 at 6:25

This is right. Primitive Pythagorean triples are parametrized as $$(u^2-v^2, 2uv, u^2+v^2)$$ with $$\mathrm{GCD}(u,v) = 1$$ and $$u+v \equiv 1 \bmod 2$$. To have $$0 < a,b < c \leq R^2$$, we must have $$0 < v < u$$ and $$u^2+v^2 \leq R^2$$. The ratio of perimeter to hypotenuse is $$\tfrac{(u^2-v^2)+(2uv)+(u^2+v^2)}{u^2+v^2} = \tfrac{2u(u+v)}{u^2+v^2}$$.

Ignoring the $$GCD$$ and parity conditions, we want to compute $$\sum_{0 Replacing these sums with integrals and changing to polar coordinates gives $$\int_{r=0}^R \int_{\theta=0}^{\pi/4} 2r ( \cos \theta) (\cos \theta+\sin \theta) \, dr \, d\theta = \frac{4+\pi}{8} R^2$$ and $$\int_{r=0}^R \int_{\theta=0}^{\pi/4} r \, dr \, d\theta = \frac{\pi}{8} R^2$$ so the ratio approaches $$1+\tfrac{4}{\pi}$$.

It remains to analyze replacing the sum by an integer, and the effect of the conditions $$\operatorname{GCD}(u,v) = 1$$ and $$u+v \equiv 1 \bmod 2$$. I'll sketch the argument.

The GCD condition can be represented as an inclusion-exclusion sum $$\sum_{1 \leq k \leq R} \mu(k) \sum_{0 The inner sum is exactly the one we discussed above, with $$R$$ replaces by $$R/k$$, so the integral approximation gives $$\tfrac{4+\pi}{8} (R/k)^2$$. Being more precise, the error in replacing the sum by an integral is $$O(R/k)$$. So the sum with GCD condition imposed is $$\tfrac{4+\pi}{8} R^2 \sum_k \tfrac{\mu(k)}{k^2} + O(\sum_{k \leq R} R/k) = \tfrac{4+\pi}{8} \tfrac{6}{\pi^2} R^2 + O(R \log R)$$. Likewise, the denominator is $$\tfrac{\pi}{8} \tfrac{6}{\pi^2} R^2 + O(R \log R)$$. So the limiting ratio is still the same. Imposing that $$u+v \equiv 1 \bmod 2$$ (once we have already imposed $$\mathrm{GCD}(u,v)=1$$) multiplies top and bottom by $$2/3$$.

• If we relax the $GCD$ condition the I think the mean will still converge to the same value but at a slower rate – Nilotpal Kanti Sinha Oct 7 '19 at 15:20
• The analysis above definitely shows it converges to the same value. I would guess the convergence is faster, but I am not an analytic number theorist, so that's just my guess. – David E Speyer Oct 7 '19 at 16:56

Let $$(a,b,c)$$ be a Pythagorean triple (in standard notation with $$c$$ being the hypotenuse). In the usual coordinate system the point $$(a,b)$$ corresponds to this triple. Now taking the sum of $$(a+b+c)/c$$, when $$0, and in particular for the longest side $$0 < c \leq R$$, then taking the limit $$R \rightarrow \infty$$ means that the sum can be replaced by an integral, (with some rescaling).

It seems to me this integral is in the limit (in polar coordinates) $$\frac{1}{\pi R^2/4} \int_{\phi=0}^{\pi/2}\int_{c=0}^R (1+\cos(\phi)+\sin(\phi))\, c\, d \phi \, d c=1+\frac{4}{\pi}$$

• Why can you replace the sum by an integral when $R \rightarrow \infty$? – Joël Oct 7 '19 at 13:07
• This is morally right, but the OP wanted to restrict to the case where $c$ is an integer (and also $GCD(a,b,c)=1$). I was in the middle of writing out an answer where I replace $(a,b,c)$ by $(u^2-v^2, 2uv, u^2+v^2)$, and integrate in the $(u,v)$ coordinates, but I seem to have an error somewhere in it. – David E Speyer Oct 7 '19 at 13:08
• Your integral should be written as $$\int_{\phi=0}^{\pi/2} \left( \int_{c=0}^R (1+\cos(\phi)+\sin(\phi))\, c\, dc\right)\, d \phi$$ rather than as $$\int_{\phi=0}^{\pi/2} \left( \int_{c=0}^R (1+\cos(\phi)+\sin(\phi))\, c\, d \phi\right) \, d c$$ – Michael Hardy Oct 7 '19 at 15:11