# Part 1: Does the arithmetic mean of sides right triangles to the mean of their hypotenuse converge?

Let $$a_k be the $$k$$-th primitive Pythagorean triplet in ascending order of the hypotenuse $$c_k$$. Define

$$l = \frac{b_1 + b_2 + b_3 + \cdots + b_k}{c_1 + c_2 + c_3 + \cdots + c_k}, \text{ } s = \frac{a_1 + a_2 + a_3 + \cdots + a_k}{c_1 + c_2 + c_3 + \cdots + c_k}$$

Question: What is the limiting value of $$l$$ and $$s$$?

The difference between this question and the related question: Part 2: Does the arithmetic mean of sides right triangles to the mean of their hypotenuse converge? is that here the triangles are in sequenced in ascending order of the hypotenuse $$c_k$$ where as in the related question, they are sequenced in ascending order of $$r$$ and $$s$$, and depending on the choice of sequencing, the limiting value differs.

SageMath Code

c  = 1
sa = 1
sb = 1
sc = 1
f  = 0
sx = 0
while(c <= 10^20):
a = c - 1
b = 3
while(a > b):
b = (c^2 - a^2)^0.5
if(b%1 == 0):
if(b <= a):
if(gcd(a,b) == 1):
f  = f + 1
sa = sa + a
sb = sb + b
sc = sc + c
sx = sx + 1/c.n()
print(f,c, sa/sc.n(),sb/sc.n(),sx)
else:
break
a = a - 1
c = c + 1

• You should mention that all values except $l,s$ are integer numbers. And so pay attention to your code b = (c^2 - a^2)^0.5, of that ^0.5 – Ripi2 Oct 25 '19 at 16:57

Quantities $$x=a/c$$ and $$y=b/c$$ are the legs of a pythagorean triangle having unit hypotenuse, hence they are the coordinates of points lying on a unit circle centred at the origin, and $$x=\cos\theta$$, $$y=\sin\theta$$ with $$\pi/4<\theta<\pi/2$$.
It is reasonable to think that, at least in the case of primitive triples, those points are spread evenly on that arc. In that case their average values are: $$\langle x\rangle={\int_{\pi/4}^{\pi/2}\cos\theta\,d\theta\over\int_{\pi/4}^{\pi/2}d\theta}= {4-2\sqrt2\over\pi}\approx 0.372923,$$ $$\langle y\rangle={\int_{\pi/4}^{\pi/2}\sin\theta\,d\theta\over\int_{\pi/4}^{\pi/2}d\theta}={2\sqrt2\over\pi}\approx 0.900316.$$ One should then justify that $$\langle a\rangle/\langle c\rangle$$ and $$\langle a/c\rangle$$ have the same limiting value, but that also seems very reasonable. I ran a simulation up to $$k\approx800000$$ and found the encouraging results: $$s_k\approx0.373,\quad l_k\approx0.900.$$