[go: up one dir, main page]

login
A345694
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.
4
0, 2, 12, 28, 124, 168, 696, 1254, 2800, 3734, 9684, 13282, 27576, 34818, 51828, 71660, 129380, 153172, 254624, 312716, 413774, 496600, 767976, 879284, 1219286, 1422992, 1845842, 2173556, 3043292, 3345884, 4556174, 5288806, 6365966, 7188082, 8786288, 9615066
OFFSET
1,2
COMMENTS
The factor m^2 is to ensure that a(n) is an integer.
A345429(n) = m*mu where mu is the mean of the values of |u|.
The population standard deviation sqrt(s) appears to grow linearly with n.
PROG
(Python)
from statistics import pvariance
from sympy.core.numbers import igcdex
def A345694(n):
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]
return pvariance(len(zlist)*abs(u) for u, v, w in zlist)
KEYWORD
nonn
AUTHOR
Chai Wah Wu, Jun 24 2021
STATUS
approved