login
A345434
For 1<=x<=n, 1<=y<=n, write gcd(x,y) = u*x+v*y with u,v minimal; a(n) = sum of the values of u^2+v^2.
7
1, 4, 11, 20, 47, 62, 135, 196, 313, 394, 685, 838, 1317, 1578, 1991, 2484, 3573, 4084, 5595, 6410, 7621, 8792, 11505, 12710, 15539, 17536, 20619, 23018, 28417, 30650, 37215, 41308, 46405, 51072, 57607, 61596, 72927, 79670, 88055, 94618, 109799, 116312, 134067, 143952, 155287
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 A345434(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))) # Chai Wah Wu, Jun 22 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jun 22 2021
STATUS
approved