login
For 1<=x<=n, 1<=y<=n with gcd(x,y)=1, write 1 = gcd(x,y) = u*x+v*y with u,v minimal; a(n) = m^2*s, where s is the population variance of the values of u and m is the number of such values.
6

%I #9 Jun 25 2021 01:53:11

%S 0,2,24,68,364,504,2040,3606,7664,10422,25764,34226,70836,89994,

%T 128532,177276,316844,375952,623024,757604,986742,1188760,1828860,

%U 2093672,2885342,3379568,4347890,5089220,7134860,7835684,10700654,12422758,14837078,16812466,20404320

%N For 1<=x<=n, 1<=y<=n with gcd(x,y)=1, write 1 = gcd(x,y) = u*x+v*y with u,v minimal; a(n) = m^2*s, where s is the population variance of the values of u and m is the number of such values.

%C The factor m^2 is to ensure that a(n) is an integer.

%C A345423(n) = m*mu where mu is the mean of the values of u.

%C The population standard deviation sqrt(s) appears to grow linearly with n.

%o (Python)

%o from statistics import pvariance

%o from sympy.core.numbers import igcdex

%o def A345692(n):

%o zlist = [z for z in (igcdex(x,y) for x in range(1,n+1) for y in range(1,n+1)) if z[2] == 1]

%o return pvariance(len(zlist)*u for u, v, w in zlist)

%Y Cf. A345423, A345687, A345688, A345689, A345690, A345691.

%K nonn

%O 1,2

%A _Chai Wah Wu_, Jun 24 2021