login
A345431
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) = sum of the values of u^2+v^2.
3
1, 3, 9, 15, 41, 47, 119, 171, 281, 333, 623, 755, 1233, 1419, 1799, 2231, 3319, 3705, 5215, 5943, 7075, 7953, 10665, 11665, 14467, 15983, 18949, 21081, 26479, 28239, 34803, 38403, 43203, 46779, 53215, 56555, 67885, 73115, 81015, 86711, 101891, 106999, 124753, 133461, 144273
OFFSET
1,2
COMMENTS
Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.
PROG
(Python)
from sympy.core.numbers import igcdex
def A345431(n): return sum(u**2+v**2 for u, v, w in (igcdex(x, y) for x in range(1, n+1) for y in range(1, n+1)) if w == 1) # Chai Wah Wu, Jun 22 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jun 22 2021
STATUS
approved