The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A345426 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. 3
0, 1, 2, 4, 5, 8, 8, 12, 12, 14, 15, 21, 14, 20, 20, 22, 24, 23, 14, 25, 16, 19, 23, 39, 11, 5, 4, -3, 6, 20, 8, 24, -10, -19, -10, -22, -43, -30, -44, -43, -47, -39, -92, -38, -51, -61, -55, -57, -127, -174, -163, -152, -171, -176, -188, -165, -167, -197, -186, -177, -298, -228 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
Minimal means minimize u^2+v^2. We follow Maple, PARI, etc., in setting u=0 and v=1 when x=y.
LINKS
MATHEMATICA
T[x_, y_] := T[x, y] = Module[{u, v}, MinimalBy[{u, v} /. Solve[u^2 + v^2 <= x^2 + y^2 && u*x + v*y == GCD[x, y], {u, v}, Integers], #.# &]];
a[n_] := a[n] = Sum[T[x, y][[1, 1]], {x, 1, n}, {y, 1, n}];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 62}] (* Jean-François Alcover, Mar 28 2023 *)
PROG
(Python)
from sympy.core.numbers import igcdex
def A345426(n): return sum(u 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, Jul 01 2021
CROSSREFS
Sequence in context: A085624 A331376 A369601 * A061884 A286002 A029935
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Jun 22 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 3 08:59 EDT 2024. Contains 373057 sequences. (Running on oeis4.)